d3d11: Use wined3d_device_context_get_sampler().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-04-17 18:39:35 -05:00 committed by Alexandre Julliard
parent 0a2ea1cadc
commit 4f61f6eed9
1 changed files with 24 additions and 15 deletions

View File

@ -1708,7 +1708,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetShader(ID3D11DeviceCo
static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetSamplers(ID3D11DeviceContext1 *iface, static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetSamplers(ID3D11DeviceContext1 *iface,
UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers)
{ {
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
unsigned int i; unsigned int i;
TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n",
@ -1720,7 +1720,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetSamplers(ID3D11Device
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
struct d3d_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
if (!(wined3d_sampler = wined3d_device_get_ps_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_context_get_sampler(
context->wined3d_context, WINED3D_SHADER_TYPE_PIXEL, start_slot + i)))
{ {
samplers[i] = NULL; samplers[i] = NULL;
continue; continue;
@ -1943,7 +1944,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetShaderResources(ID3D1
static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetSamplers(ID3D11DeviceContext1 *iface, static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetSamplers(ID3D11DeviceContext1 *iface,
UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers)
{ {
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
unsigned int i; unsigned int i;
TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n",
@ -1955,7 +1956,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetSamplers(ID3D11Device
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
struct d3d_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
if (!(wined3d_sampler = wined3d_device_get_vs_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_context_get_sampler(
context->wined3d_context, WINED3D_SHADER_TYPE_VERTEX, start_slot + i)))
{ {
samplers[i] = NULL; samplers[i] = NULL;
continue; continue;
@ -2022,7 +2024,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShaderResources(ID3D1
static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetSamplers(ID3D11DeviceContext1 *iface, static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetSamplers(ID3D11DeviceContext1 *iface,
UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers)
{ {
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
unsigned int i; unsigned int i;
TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n",
@ -2034,7 +2036,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetSamplers(ID3D11Device
struct d3d_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
if (!(wined3d_sampler = wined3d_device_get_gs_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_context_get_sampler(
context->wined3d_context, WINED3D_SHADER_TYPE_GEOMETRY, start_slot + i)))
{ {
samplers[i] = NULL; samplers[i] = NULL;
continue; continue;
@ -2350,7 +2353,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetShader(ID3D11DeviceCo
static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetSamplers(ID3D11DeviceContext1 *iface, static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetSamplers(ID3D11DeviceContext1 *iface,
UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers)
{ {
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
unsigned int i; unsigned int i;
TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n",
@ -2362,7 +2365,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetSamplers(ID3D11Device
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
struct d3d_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
if (!(wined3d_sampler = wined3d_device_get_hs_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_context_get_sampler(
context->wined3d_context, WINED3D_SHADER_TYPE_HULL, start_slot + i)))
{ {
samplers[i] = NULL; samplers[i] = NULL;
continue; continue;
@ -2443,7 +2447,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShader(ID3D11DeviceCo
static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetSamplers(ID3D11DeviceContext1 *iface, static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetSamplers(ID3D11DeviceContext1 *iface,
UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers)
{ {
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
unsigned int i; unsigned int i;
TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n",
@ -2455,7 +2459,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetSamplers(ID3D11Device
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
struct d3d_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
if (!(wined3d_sampler = wined3d_device_get_ds_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_context_get_sampler(
context->wined3d_context, WINED3D_SHADER_TYPE_DOMAIN, start_slot + i)))
{ {
samplers[i] = NULL; samplers[i] = NULL;
continue; continue;
@ -2561,7 +2566,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetShader(ID3D11DeviceCo
static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetSamplers(ID3D11DeviceContext1 *iface, static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetSamplers(ID3D11DeviceContext1 *iface,
UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers)
{ {
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
unsigned int i; unsigned int i;
TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n",
@ -2573,7 +2578,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetSamplers(ID3D11Device
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
struct d3d_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
if (!(wined3d_sampler = wined3d_device_get_cs_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_context_get_sampler(
context->wined3d_context, WINED3D_SHADER_TYPE_COMPUTE, start_slot + i)))
{ {
samplers[i] = NULL; samplers[i] = NULL;
continue; continue;
@ -5082,7 +5088,8 @@ static void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device1 *iface,
struct d3d_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
if (!(wined3d_sampler = wined3d_device_get_ps_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_context_get_sampler(
device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_PIXEL, start_slot + i)))
{ {
samplers[i] = NULL; samplers[i] = NULL;
continue; continue;
@ -5297,7 +5304,8 @@ static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device1 *iface,
struct d3d_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
if (!(wined3d_sampler = wined3d_device_get_vs_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_context_get_sampler(
device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_VERTEX, start_slot + i)))
{ {
samplers[i] = NULL; samplers[i] = NULL;
continue; continue;
@ -5377,7 +5385,8 @@ static void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device1 *iface,
struct d3d_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
if (!(wined3d_sampler = wined3d_device_get_gs_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_context_get_sampler(
device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_GEOMETRY, start_slot + i)))
{ {
samplers[i] = NULL; samplers[i] = NULL;
continue; continue;