[PATCH 1/5] wined3d: Only set TEXTURE_COMPARE_FUNC when ARB_depth_texture is supported.

Stefan Dösinger stefan at codeweavers.com
Mon Mar 23 12:59:06 CDT 2015


r200 implements sampler objects in modern mesa versions but the hardware
doesn't support depth textures.
---
 dlls/wined3d/sampler.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c
index ffa1155..b518a0a 100644
--- a/dlls/wined3d/sampler.c
+++ b/dlls/wined3d/sampler.c
@@ -92,10 +92,13 @@ static void wined3d_sampler_init(struct wined3d_sampler *sampler, struct wined3d
     GL_EXTCALL(glSamplerParameterf(sampler->name, GL_TEXTURE_MAX_LOD, desc->max_lod));
     if (gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC])
         GL_EXTCALL(glSamplerParameteri(sampler->name, GL_TEXTURE_MAX_ANISOTROPY_EXT, desc->max_anisotropy));
-    if (desc->compare)
-        GL_EXTCALL(glSamplerParameteri(sampler->name, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE));
-    GL_EXTCALL(glSamplerParameteri(sampler->name, GL_TEXTURE_COMPARE_FUNC,
-            wined3d_gl_compare_func(desc->comparison_func)));
+    if (gl_info->supported[ARB_DEPTH_TEXTURE])
+    {
+        if (desc->compare)
+            GL_EXTCALL(glSamplerParameteri(sampler->name, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE));
+        GL_EXTCALL(glSamplerParameteri(sampler->name, GL_TEXTURE_COMPARE_FUNC,
+                wined3d_gl_compare_func(desc->comparison_func)));
+    }
     if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE] && !desc->srgb_decode)
         GL_EXTCALL(glSamplerParameteri(sampler->name, GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT));
     checkGLcall("sampler creation");
-- 
2.3.3




More information about the wine-patches mailing list