[Mesa-dev] [PATCH 08/10] gallium/u_tests: test NULL in constbuf[1] instead of constbuf[0]

Marek Olšák maraeo at gmail.com
Wed Apr 25 21:16:29 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

radeonsi doesn't support constbuf[0] = NULL.
---
 src/gallium/auxiliary/util/u_tests.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c
index 293a4580a9f..e7d11ce117e 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -421,30 +421,30 @@ util_test_constant_buffer(struct pipe_context *ctx,
    struct pipe_resource *cb;
    void *fs, *vs;
    bool pass = true;
    static const float zero[] = {0, 0, 0, 0};
 
    cso = cso_create_context(ctx, 0);
    cb = util_create_texture2d(ctx->screen, 256, 256,
                               PIPE_FORMAT_R8G8B8A8_UNORM, 0);
    util_set_common_states_and_clear(cso, ctx, cb);
 
-   pipe_set_constant_buffer(ctx, PIPE_SHADER_FRAGMENT, 0, constbuf);
+   pipe_set_constant_buffer(ctx, PIPE_SHADER_FRAGMENT, 1, constbuf);
 
    /* Fragment shader. */
    {
       static const char *text = /* I don't like ureg... */
             "FRAG\n"
-            "DCL CONST[0][0]\n"
+            "DCL CONST[1][0]\n"
             "DCL OUT[0], COLOR\n"
 
-            "MOV OUT[0], CONST[0][0]\n"
+            "MOV OUT[0], CONST[1][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);
-- 
2.17.0



More information about the mesa-dev mailing list