[PATCH] wined3d: bind default sampler object when setting sampler state with no texture.

Paul Gofman gofmanp at gmail.com
Sat Feb 20 08:00:55 CST 2016


When sampler state was applied and no stage texture was present in state, no glBindSampler
was issued for the stage after dummy texture was bound, and previously bound
sampler was still active. This could result in undefined behaviour, especially if previously
bound sampler was a shadow sample (this caused warnings from Nvidia driver).

Signed-off-by: Paul Gofman <gofmanp at gmail.com>
---
 dlls/wined3d/state.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 60bfd41..aa13a95 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3627,6 +3627,11 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
     else
     {
         context_bind_texture(context, GL_NONE, 0);
+        if (gl_info->supported[ARB_SAMPLER_OBJECTS])
+        {
+            GL_EXTCALL(glBindSampler(mapped_stage, 0));
+            checkGLcall("glBindSampler");
+        }
     }
 }
 
-- 
2.5.0




More information about the wine-patches mailing list