[PATCH v2] wined3d: Cleanup extension check for shader model 4 support.

Matteo Bruni mbruni at codeweavers.com
Thu Oct 29 09:09:53 CDT 2015


This essentially enables shader model 4 support with Mesa or OS X when
using core profile.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
v2: It turns out that GLSL 1.50 doesn't necessarily imply GL 3.2 so add
an explicit check for that (thanks Henri.)

 dlls/wined3d/directx.c     | 2 ++
 dlls/wined3d/glsl_shader.c | 6 ++----
 dlls/wined3d/wined3d_gl.h  | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index d7f0512..046c6eb 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -3553,6 +3553,8 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
 
     if (gl_version >= MAKEDWORD_VERSION(2, 0))
         gl_info->supported[WINED3D_GL_VERSION_2_0] = TRUE;
+    if (gl_version >= MAKEDWORD_VERSION(3, 2))
+        gl_info->supported[WINED3D_GL_VERSION_3_2] = TRUE;
 
     if (gl_info->supported[APPLE_FENCE])
     {
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 4a95e44..44e7090 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -7761,10 +7761,8 @@ static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct s
 {
     UINT shader_model;
 
-    if (gl_info->supported[EXT_GPU_SHADER4] && gl_info->supported[ARB_SHADER_BIT_ENCODING]
-            && gl_info->supported[ARB_GEOMETRY_SHADER4] && gl_info->glsl_version >= MAKEDWORD_VERSION(1, 50)
-            && gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] && gl_info->supported[ARB_DRAW_INSTANCED]
-            && gl_info->supported[ARB_TEXTURE_RG] && gl_info->supported[ARB_SAMPLER_OBJECTS])
+    if (gl_info->glsl_version >= MAKEDWORD_VERSION(1, 50) && gl_info->supported[WINED3D_GL_VERSION_3_2]
+            && gl_info->supported[ARB_SHADER_BIT_ENCODING] && gl_info->supported[ARB_SAMPLER_OBJECTS])
         shader_model = 4;
     /* ARB_shader_texture_lod or EXT_gpu_shader4 is required for the SM3
      * texldd and texldl instructions. */
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index 2be7262..437f62f 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -165,6 +165,7 @@ enum wined3d_gl_extension
     WINED3D_GL_NORMALIZED_TEXRECT,
     WINED3D_GL_LEGACY_CONTEXT,
     WINED3D_GL_VERSION_2_0,
+    WINED3D_GL_VERSION_3_2,
 
     WINED3D_GL_EXT_COUNT,
 };
-- 
2.4.10




More information about the wine-patches mailing list