Paul Gofman : wined3d: Bind default sampler object when setting sampler state with no texture.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 24 11:01:41 CST 2016


Module: wine
Branch: master
Commit: 749d5a577b5c09f57ad062777f33be802e1373dd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=749d5a577b5c09f57ad062777f33be802e1373dd

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Sat Feb 20 17:00:55 2016 +0300

wined3d: Bind default sampler object when setting sampler state with no texture.

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>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/state.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 58d2fed..3e08907 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");
+        }
     }
 }
 




More information about the wine-cvs mailing list