[PATCH 2/5] wined3d: Only copy POSITION0 output semantics into gl_Position.

Matteo Bruni mbruni at codeweavers.com
Fri Feb 6 08:25:32 CST 2015


This is a bit of a digression, prompted by a shader used in an older test
version of World of Tanks (shader that since then changed). As the test
in patch 5/5 shows, "position" varyings don't work on AMD so I don't
expect to find them in the wild, but better be safe than sorry I guess.
---
 dlls/wined3d/glsl_shader.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index f3e921c..adb9f13 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -4377,7 +4377,7 @@ static GLuint generate_param_reorder_function(struct wined3d_shader_buffer *buff
                     shader_addline(buffer, "gl_FrontSecondaryColor%s = vs_out[%u]%s;\n",
                             reg_mask, i, reg_mask);
             }
-            else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_POSITION))
+            else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_POSITION) && !semantic_idx)
             {
                 shader_addline(buffer, "gl_Position%s = vs_out[%u]%s;\n",
                         reg_mask, i, reg_mask);
@@ -4419,9 +4419,10 @@ static GLuint generate_param_reorder_function(struct wined3d_shader_buffer *buff
             if (!(map & 1)) continue;
 
             semantic_name = output_signature[i].semantic_name;
+            semantic_idx = output_signature[i].semantic_idx;
             shader_glsl_write_mask_to_str(output_signature[i].mask, reg_mask);
 
-            if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_POSITION))
+            if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_POSITION) && !semantic_idx)
             {
                 shader_addline(buffer, "gl_Position%s = vs_out[%u]%s;\n",
                         reg_mask, i, reg_mask);
-- 
2.0.5




More information about the wine-patches mailing list