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,