nine: always generate two-dimensional constant file accesses
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 23 Aug 2017 16:04:05 +0000 (18:04 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 4 Sep 2017 11:43:56 +0000 (13:43 +0200)
Acked-by: Roland Scheidegger <sroland@vmware.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/state_trackers/nine/nine_ff.c
src/gallium/state_trackers/nine/nine_shader.c

index 2175bdbcc51d9cf645a9e9dafe21fe1e4e1cbaeb..39fcb8b1591e0d6e9c87b7628695751b5ea458e9 100644 (file)
@@ -483,7 +483,7 @@ nine_ff_build_vs(struct NineDevice9 *device, struct vs_build_ctx *vs)
 
         for (i = 0; i < key->vertexblend; ++i) {
             for (c = 0; c < 4; ++c) {
-                cWM[c] = ureg_src_register(TGSI_FILE_CONSTANT, (160 + i * 4) * !key->vertexblend_indexed + c);
+                cWM[c] = ureg_src_dimension(ureg_src_register(TGSI_FILE_CONSTANT, (160 + i * 4) * !key->vertexblend_indexed + c), 0);
                 if (key->vertexblend_indexed)
                     cWM[c] = ureg_src_indirect(cWM[c], ureg_scalar(ureg_src(AR), i));
             }
index 5b60dcbac8f3fc0d994da09d958bb0eb95c07101..cc667ebfbcd9a81f1047d27a72275ef8f99dbe7e 100644 (file)
@@ -91,7 +91,7 @@ static inline const char *d3dsio_to_string(unsigned opcode);
    TGSI_SWIZZLE_##x, TGSI_SWIZZLE_##y, TGSI_SWIZZLE_##z, TGSI_SWIZZLE_##w
 
 #define NINE_CONSTANT_SRC(index) \
-   ureg_src_register(TGSI_FILE_CONSTANT, index)
+   ureg_src_dimension(ureg_src_register(TGSI_FILE_CONSTANT, index), 0)
 
 #define NINE_APPLY_SWIZZLE(src, s) \
    ureg_swizzle(src, NINE_SWIZZLE4(s, s, s, s))
@@ -1009,7 +1009,7 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param)
                     src = ureg_src_dimension(src, 0);
                 }
             } else
-                src = ureg_src_register(TGSI_FILE_CONSTANT, param->idx);
+                src = NINE_CONSTANT_SRC(param->idx);
         }
         if (!IS_VS && tx->version.major < 2) {
             /* ps 1.X clamps constants */
@@ -1035,8 +1035,7 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param)
                 src = ureg_src_register(TGSI_FILE_CONSTANT, param->idx);
                 src = ureg_src_dimension(src, 2);
             } else
-                src = ureg_src_register(TGSI_FILE_CONSTANT,
-                                        tx->info->const_i_base + param->idx);
+                src = NINE_CONSTANT_SRC(tx->info->const_i_base + param->idx);
         }
         break;
     case D3DSPR_CONSTBOOL:
@@ -1049,8 +1048,7 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param)
                src = ureg_src_register(TGSI_FILE_CONSTANT, r);
                src = ureg_src_dimension(src, 3);
            } else
-               src = ureg_src_register(TGSI_FILE_CONSTANT,
-                                       tx->info->const_b_base + r);
+               src = NINE_CONSTANT_SRC(tx->info->const_b_base + r);
            src = ureg_swizzle(src, s, s, s, s);
         }
         break;