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,