[Mesa-dev] [PATCH v2 10/12] gallium/tests: always use two-dimensional constant references

Nicolai Hähnle nhaehnle at gmail.com
Mon Aug 28 08:58:18 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Acked-by: Roland Scheidegger <sroland at vmware.com>
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
---
 src/gallium/auxiliary/util/u_tests.c                 | 4 ++--
 src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh | 8 ++++----
 src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh   | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c
index 7ec8eef65fc..60e77b2e3bc 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -411,24 +411,24 @@ util_test_constant_buffer(struct pipe_context *ctx,
    cb = util_create_texture2d(ctx->screen, 256, 256,
                               PIPE_FORMAT_R8G8B8A8_UNORM);
    util_set_common_states_and_clear(cso, ctx, cb);
 
    pipe_set_constant_buffer(ctx, PIPE_SHADER_FRAGMENT, 0, constbuf);
 
    /* Fragment shader. */
    {
       static const char *text = /* I don't like ureg... */
             "FRAG\n"
-            "DCL CONST[0]\n"
+            "DCL CONST[0][0]\n"
             "DCL OUT[0], COLOR\n"
 
-            "MOV OUT[0], CONST[0]\n"
+            "MOV OUT[0], CONST[0][0]\n"
             "END\n";
       struct tgsi_token tokens[1000];
       struct pipe_shader_state state;
 
       if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
          puts("Can't compile a fragment shader.");
          util_report_result(FAIL);
          return;
       }
       pipe_shader_state_from_tgsi(&state, tokens);
diff --git a/src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh b/src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh
index 85fb9ea4e7f..097774336f7 100644
--- a/src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh
+++ b/src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh
@@ -1,13 +1,13 @@
 FRAG
 
 DCL IN[0], COLOR, LINEAR
 DCL OUT[0], COLOR
-DCL CONST[1]
-DCL CONST[3]
+DCL CONST[0][1]
+DCL CONST[0][3]
 DCL TEMP[0..1]
 
-ADD TEMP[0], IN[0], CONST[1]
-RCP TEMP[1], CONST[3].xxxx
+ADD TEMP[0], IN[0], CONST[0][1]
+RCP TEMP[1], CONST[0][3].xxxx
 MUL OUT[0], TEMP[0], TEMP[1]
 
 END
diff --git a/src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh b/src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh
index e227917fd3b..0b05ca8b677 100644
--- a/src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh
+++ b/src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh
@@ -1,16 +1,16 @@
 VERT
 
 DCL IN[0]
 DCL IN[1]
 DCL OUT[0], POSITION
 DCL OUT[1], COLOR
-DCL CONST[1]
-DCL CONST[3]
+DCL CONST[0][1]
+DCL CONST[0][3]
 DCL TEMP[0..1]
 
 MOV OUT[0], IN[0]
-ADD TEMP[0], IN[1], CONST[1]
-RCP TEMP[1], CONST[3].xxxx
+ADD TEMP[0], IN[1], CONST[0][1]
+RCP TEMP[1], CONST[0][3].xxxx
 MUL OUT[1], TEMP[0], TEMP[1]
 
 END
-- 
2.11.0



More information about the mesa-dev mailing list