[PATCH 3/5] wined3d: Enable SM4 support in the GLSL shader backend when possible.

Matteo Bruni mbruni at codeweavers.com
Mon Oct 24 11:58:47 CDT 2011


---
 dlls/wined3d/directx.c     |    4 ++--
 dlls/wined3d/glsl_shader.c |    8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 2ae9f7f..23eab0c 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4750,7 +4750,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
      * are the same among all shader models. So to avoid code duplication set the shader version
      * specific, but otherwise constant caps here
      */
-    if (caps->VertexShaderVersion == WINED3DVS_VERSION(3,0))
+    if (caps->VertexShaderVersion >= WINED3DVS_VERSION(3,0))
     {
         /* Where possible set the caps based on OpenGL extensions and if they
          * aren't set (in case of software rendering) use the VS 3.0 from
@@ -4787,7 +4787,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
         caps->MaxVertexShader30InstructionSlots = 0;
     }
 
-    if (caps->PixelShaderVersion == WINED3DPS_VERSION(3,0))
+    if (caps->PixelShaderVersion >= WINED3DPS_VERSION(3,0))
     {
         /* Where possible set the caps based on OpenGL extensions and if they
          * aren't set (in case of software rendering) use the PS 3.0 from
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 7e736d8..c3f1e84 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -4917,9 +4917,15 @@ static BOOL shader_glsl_dirty_const(void)
 
 static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct shader_caps *caps)
 {
+    if (gl_info->supported[EXT_GPU_SHADER4] && gl_info->supported[ARB_GEOMETRY_SHADER4]
+            && gl_info->glsl_version >= MAKEDWORD_VERSION(1, 50))
+    {
+        caps->VertexShaderVersion = WINED3DVS_VERSION(4,0);
+        caps->PixelShaderVersion = WINED3DPS_VERSION(4,0);
+    }
     /* ARB_shader_texture_lod or EXT_gpu_shader4 is required for the SM3
      * texldd and texldl instructions. */
-    if (gl_info->supported[ARB_SHADER_TEXTURE_LOD] || gl_info->supported[EXT_GPU_SHADER4])
+    else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD] || gl_info->supported[EXT_GPU_SHADER4])
     {
         caps->VertexShaderVersion = WINED3DVS_VERSION(3,0);
         caps->PixelShaderVersion = WINED3DPS_VERSION(3,0);
-- 
1.7.3.4




More information about the wine-patches mailing list