[PATCH 02/18] wined3d: Set default sampler minification filter to GL_NEAREST.

Józef Kucia jkucia at codeweavers.com
Mon Dec 5 05:04:25 CST 2016


This seems to be required for reading stencil values. The GL spec says
"When sampling the stencil index only NEAREST filtering is supported.".
The GL spec is inconsistent about this, but Mesa refuses to sample
stencil index values with the GL_NEAREST_MIPMAP_NEAREST filter.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---

The GL_NEAREST is also allowed filter type for integer textures, so this
change should be fine.

---
 dlls/wined3d/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 5b64978..72fb5b5 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -811,7 +811,7 @@ static void create_default_samplers(struct wined3d_device *device, struct wined3
          */
         GL_EXTCALL(glGenSamplers(1, &device->default_sampler));
         GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
-        GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST));
+        GL_EXTCALL(glSamplerParameteri(device->default_sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST));
         checkGLcall("Create default sampler");
 
         /* In D3D10+, a NULL sampler maps to the default sampler state. */
-- 
2.7.3




More information about the wine-patches mailing list