[PATCH 2/6] wined3d: Fix SM4 pixel shader output registers mapping.

Józef Kucia jkucia at codeweavers.com
Mon Feb 29 11:35:48 CST 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
I'm not sure if the sysval_map is useful at all. It looks odd,
especially the WINED3D_SV_TARGET defines.
---
 dlls/wined3d/shader_sm4.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index 45bd9f0..8c48fff 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -432,7 +432,6 @@ static const enum wined3d_primitive_type input_primitive_type_table[] =
 static const struct sysval_map sysval_map[] =
 {
     {WINED3D_SV_DEPTH,      WINED3DSPR_DEPTHOUT,    0},
-    {WINED3D_SV_TARGET0,    WINED3DSPR_COLOROUT,    0},
     {WINED3D_SV_TARGET1,    WINED3DSPR_COLOROUT,    1},
     {WINED3D_SV_TARGET2,    WINED3DSPR_COLOROUT,    2},
     {WINED3D_SV_TARGET3,    WINED3DSPR_COLOROUT,    3},
@@ -548,6 +547,14 @@ static void *shader_sm4_init(const DWORD *byte_code, const struct wined3d_shader
             continue;
         }
 
+        if (!e->sysval_semantic
+                && (!strcmp(e->semantic_name, "SV_TARGET") || !strcmp(e->semantic_name, "SV_Target")))
+        {
+            priv->output_map[e->register_idx].register_type = WINED3DSPR_COLOROUT;
+            priv->output_map[e->register_idx].register_idx = e->semantic_idx;
+            continue;
+        }
+
         for (j = 0; j < ARRAY_SIZE(sysval_map); ++j)
         {
             if (e->sysval_semantic == sysval_map[j].sysval)
-- 
2.4.10




More information about the wine-patches mailing list