Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 12 ++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 3 files changed, 15 insertions(+)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f4ba0573c24..11b99353059 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2475,6 +2475,18 @@ void CDECL wined3d_device_set_vs_resource_view(struct wined3d_device *device, wined3d_device_context_set_shader_resource_view(&device->cs->c, WINED3D_SHADER_TYPE_VERTEX, idx, view); }
+struct wined3d_shader_resource_view * CDECL wined3d_device_context_get_shader_resource_view( + const struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int idx) +{ + if (idx >= MAX_SHADER_RESOURCE_VIEWS) + { + WARN("Invalid view index %u.\n", idx); + return NULL; + } + + return context->state->shader_resource_view[shader_type][idx]; +} + static struct wined3d_shader_resource_view *wined3d_device_get_shader_resource_view( const struct wined3d_device *device, enum wined3d_shader_type shader_type, unsigned int idx) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 012f24e6556..f820ebd76d8 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -171,6 +171,7 @@ @ cdecl wined3d_device_context_get_rasterizer_state(ptr) @ cdecl wined3d_device_context_get_scissor_rects(ptr ptr ptr) @ cdecl wined3d_device_context_get_shader(ptr long) +@ cdecl wined3d_device_context_get_shader_resource_view(ptr long long) @ cdecl wined3d_device_context_get_viewports(ptr ptr ptr) @ cdecl wined3d_device_context_issue_query(ptr ptr long) @ cdecl wined3d_device_context_map(ptr ptr long ptr ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9b7ff4041fc..9729d2c1eac 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2568,6 +2568,8 @@ void __cdecl wined3d_device_context_get_scissor_rects(const struct wined3d_devic unsigned int *rect_count, RECT *rects); struct wined3d_shader * __cdecl wined3d_device_context_get_shader(const struct wined3d_device_context *context, enum wined3d_shader_type type); +struct wined3d_shader_resource_view * __cdecl wined3d_device_context_get_shader_resource_view( + const struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int idx); void __cdecl wined3d_device_context_get_viewports(const struct wined3d_device_context *context, unsigned int *viewport_count, struct wined3d_viewport *viewports); void __cdecl wined3d_device_context_issue_query(struct wined3d_device_context *context,
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 9fd144c0fb6..469ca0d6c49 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1650,7 +1650,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetConstantBuffers(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetShaderResources(ID3D11DeviceContext1 *iface, UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i;
TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", @@ -1662,7 +1662,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetShaderResources(ID3D1 struct wined3d_shader_resource_view *wined3d_view; struct d3d_shader_resource_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_ps_resource_view(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_shader_resource_view( + context->wined3d_context, WINED3D_SHADER_TYPE_PIXEL, start_slot + i))) { views[i] = NULL; continue; @@ -1914,7 +1915,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetPrimitiveTopology(ID3 static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetShaderResources(ID3D11DeviceContext1 *iface, UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i;
TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); @@ -1925,7 +1926,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetShaderResources(ID3D1 struct wined3d_shader_resource_view *wined3d_view; struct d3d_shader_resource_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_vs_resource_view(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_shader_resource_view( + context->wined3d_context, WINED3D_SHADER_TYPE_VERTEX, start_slot + i))) { views[i] = NULL; continue; @@ -1992,7 +1994,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GetPredication(ID3D11Devic static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShaderResources(ID3D11DeviceContext1 *iface, UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i;
TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); @@ -2003,7 +2005,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShaderResources(ID3D1 struct wined3d_shader_resource_view *wined3d_view; struct d3d_shader_resource_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_gs_resource_view(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_shader_resource_view( + context->wined3d_context, WINED3D_SHADER_TYPE_GEOMETRY, start_slot + i))) { views[i] = NULL; continue; @@ -2292,7 +2295,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSGetScissorRects(ID3D11De static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetShaderResources(ID3D11DeviceContext1 *iface, UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i;
TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); @@ -2303,7 +2306,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetShaderResources(ID3D1 struct wined3d_shader_resource_view *wined3d_view; struct d3d_shader_resource_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_hs_resource_view(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_shader_resource_view( + context->wined3d_context, WINED3D_SHADER_TYPE_HULL, start_slot + i))) { views[i] = NULL; continue; @@ -2383,7 +2387,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetConstantBuffers(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShaderResources(ID3D11DeviceContext1 *iface, UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i;
TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", @@ -2395,7 +2399,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShaderResources(ID3D1 struct wined3d_shader_resource_view *wined3d_view; struct d3d_shader_resource_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_ds_resource_view(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_shader_resource_view( + context->wined3d_context, WINED3D_SHADER_TYPE_DOMAIN, start_slot + i))) { views[i] = NULL; continue; @@ -2475,7 +2480,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetConstantBuffers(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetShaderResources(ID3D11DeviceContext1 *iface, UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i;
TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); @@ -2486,7 +2491,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetShaderResources(ID3D1 struct wined3d_shader_resource_view *wined3d_view; struct d3d_shader_resource_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_cs_resource_view(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_shader_resource_view( + context->wined3d_context, WINED3D_SHADER_TYPE_COMPUTE, start_slot + i))) { views[i] = NULL; continue; @@ -5024,7 +5030,8 @@ static void STDMETHODCALLTYPE d3d10_device_PSGetShaderResources(ID3D10Device1 *i struct wined3d_shader_resource_view *wined3d_view; struct d3d_shader_resource_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_ps_resource_view(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_shader_resource_view( + device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_PIXEL, start_slot + i))) { views[i] = NULL; continue; @@ -5261,7 +5268,8 @@ static void STDMETHODCALLTYPE d3d10_device_VSGetShaderResources(ID3D10Device1 *i struct wined3d_shader_resource_view *wined3d_view; struct d3d_shader_resource_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_vs_resource_view(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_shader_resource_view( + device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_VERTEX, start_slot + i))) { views[i] = NULL; continue; @@ -5340,7 +5348,8 @@ static void STDMETHODCALLTYPE d3d10_device_GSGetShaderResources(ID3D10Device1 *i struct wined3d_shader_resource_view *wined3d_view; struct d3d_shader_resource_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_gs_resource_view(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_shader_resource_view( + device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_GEOMETRY, start_slot + i))) { views[i] = NULL; continue;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 14 ++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 3 files changed, 17 insertions(+)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 11b99353059..d239d59a8f2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2514,6 +2514,20 @@ void CDECL wined3d_device_set_vs_sampler(struct wined3d_device *device, UINT idx wined3d_device_context_set_sampler(&device->cs->c, WINED3D_SHADER_TYPE_VERTEX, idx, sampler); }
+struct wined3d_sampler * CDECL wined3d_device_context_get_sampler(const struct wined3d_device_context *context, + enum wined3d_shader_type shader_type, unsigned int idx) +{ + TRACE("context %p, shader_type %#x, idx %u.\n", context, shader_type, idx); + + if (idx >= MAX_SAMPLER_OBJECTS) + { + WARN("Invalid sampler index %u.\n", idx); + return NULL; + } + + return context->state->sampler[shader_type][idx]; +} + static struct wined3d_sampler *wined3d_device_get_sampler(const struct wined3d_device *device, enum wined3d_shader_type shader_type, unsigned int idx) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index f820ebd76d8..6a7a8811051 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -169,6 +169,7 @@ @ cdecl wined3d_device_context_get_constant_buffer(ptr long long) @ cdecl wined3d_device_context_get_depth_stencil_state(ptr ptr) @ cdecl wined3d_device_context_get_rasterizer_state(ptr) +@ cdecl wined3d_device_context_get_sampler(ptr long long) @ cdecl wined3d_device_context_get_scissor_rects(ptr ptr ptr) @ cdecl wined3d_device_context_get_shader(ptr long) @ cdecl wined3d_device_context_get_shader_resource_view(ptr long long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9729d2c1eac..26dc7844090 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2564,6 +2564,8 @@ struct wined3d_depth_stencil_state * __cdecl wined3d_device_context_get_depth_st const struct wined3d_device_context *context, unsigned int *stencil_ref); struct wined3d_rasterizer_state * __cdecl wined3d_device_context_get_rasterizer_state( struct wined3d_device_context *context); +struct wined3d_sampler * __cdecl wined3d_device_context_get_sampler(const struct wined3d_device_context *context, + enum wined3d_shader_type shader_type, unsigned int idx); void __cdecl wined3d_device_context_get_scissor_rects(const struct wined3d_device_context *context, unsigned int *rect_count, RECT *rects); struct wined3d_shader * __cdecl wined3d_device_context_get_shader(const struct wined3d_device_context *context,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 469ca0d6c49..7e4212a4bc6 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1708,7 +1708,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetSamplers(ID3D11DeviceContext1 *iface, 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;
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 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; continue; @@ -1943,7 +1944,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetShaderResources(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetSamplers(ID3D11DeviceContext1 *iface, 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;
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 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; continue; @@ -2022,7 +2024,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShaderResources(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetSamplers(ID3D11DeviceContext1 *iface, 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;
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 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; continue; @@ -2350,7 +2353,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetSamplers(ID3D11DeviceContext1 *iface, 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;
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 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; continue; @@ -2443,7 +2447,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetSamplers(ID3D11DeviceContext1 *iface, 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;
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 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; continue; @@ -2561,7 +2566,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetSamplers(ID3D11DeviceContext1 *iface, 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;
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 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; continue; @@ -5082,7 +5088,8 @@ static void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device1 *iface, struct d3d_sampler_state *sampler_impl; 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; continue; @@ -5297,7 +5304,8 @@ static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device1 *iface, struct d3d_sampler_state *sampler_impl; 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; continue; @@ -5377,7 +5385,8 @@ static void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device1 *iface, struct d3d_sampler_state *sampler_impl; 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; continue;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 14 ++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 3 files changed, 17 insertions(+)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d239d59a8f2..33b06b44c29 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2878,6 +2878,20 @@ struct wined3d_sampler * CDECL wined3d_device_get_cs_sampler(const struct wined3 return wined3d_device_get_sampler(device, WINED3D_SHADER_TYPE_COMPUTE, idx); }
+struct wined3d_unordered_access_view * CDECL wined3d_device_context_get_unordered_access_view( + const struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int idx) +{ + TRACE("context %p, pipeline %#x, idx %u.\n", context, pipeline, idx); + + if (idx >= MAX_UNORDERED_ACCESS_VIEWS) + { + WARN("Invalid UAV index %u.\n", idx); + return NULL; + } + + return context->state->unordered_access_view[pipeline][idx]; +} + static struct wined3d_unordered_access_view *wined3d_device_get_pipeline_unordered_access_view( const struct wined3d_device *device, enum wined3d_pipeline pipeline, unsigned int idx) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 6a7a8811051..442b06ed4ea 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -173,6 +173,7 @@ @ cdecl wined3d_device_context_get_scissor_rects(ptr ptr ptr) @ cdecl wined3d_device_context_get_shader(ptr long) @ cdecl wined3d_device_context_get_shader_resource_view(ptr long long) +@ cdecl wined3d_device_context_get_unordered_access_view(ptr long long) @ cdecl wined3d_device_context_get_viewports(ptr ptr ptr) @ cdecl wined3d_device_context_issue_query(ptr ptr long) @ cdecl wined3d_device_context_map(ptr ptr long ptr ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 26dc7844090..e5e522e9fb2 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2572,6 +2572,8 @@ struct wined3d_shader * __cdecl wined3d_device_context_get_shader(const struct w enum wined3d_shader_type type); struct wined3d_shader_resource_view * __cdecl wined3d_device_context_get_shader_resource_view( const struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int idx); +struct wined3d_unordered_access_view * __cdecl wined3d_device_context_get_unordered_access_view( + const struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int idx); void __cdecl wined3d_device_context_get_viewports(const struct wined3d_device_context *context, unsigned int *viewport_count, struct wined3d_viewport *viewports); void __cdecl wined3d_device_context_issue_query(struct wined3d_device_context *context,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 7e4212a4bc6..460e9c2bf4a 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2105,7 +2105,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargetsAndUnord UINT unordered_access_view_start_slot, UINT unordered_access_view_count, ID3D11UnorderedAccessView **unordered_access_views) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_unordered_access_view *wined3d_view; struct d3d11_unordered_access_view *view_impl; unsigned int i; @@ -2125,8 +2125,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargetsAndUnord wined3d_mutex_lock(); for (i = 0; i < unordered_access_view_count; ++i) { - if (!(wined3d_view = wined3d_device_get_unordered_access_view(device->wined3d_device, - unordered_access_view_start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_unordered_access_view(context->wined3d_context, + WINED3D_PIPELINE_GRAPHICS, unordered_access_view_start_slot + i))) { unordered_access_views[i] = NULL; continue; @@ -2512,7 +2512,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetShaderResources(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetUnorderedAccessViews(ID3D11DeviceContext1 *iface, UINT start_slot, UINT view_count, ID3D11UnorderedAccessView **views) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i;
TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); @@ -2523,7 +2523,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetUnorderedAccessViews( struct wined3d_unordered_access_view *wined3d_view; struct d3d11_unordered_access_view *view_impl;
- if (!(wined3d_view = wined3d_device_get_cs_uav(device->wined3d_device, start_slot + i))) + if (!(wined3d_view = wined3d_device_context_get_unordered_access_view( + context->wined3d_context, WINED3D_PIPELINE_COMPUTE, start_slot + i))) { views[i] = NULL; continue;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com