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

Nicolai Hähnle nhaehnle at gmail.com
Mon Aug 28 08:58:16 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/hud/hud_context.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index 2deb48d18e7..ed2e8491143 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -1611,31 +1611,31 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
    {
       static const char *vertex_shader_text = {
          "VERT\n"
          "DCL IN[0..1]\n"
          "DCL OUT[0], POSITION\n"
          "DCL OUT[1], COLOR[0]\n" /* color */
          "DCL OUT[2], GENERIC[0]\n" /* texcoord */
          /* [0] = color,
           * [1] = (2/fb_width, 2/fb_height, xoffset, yoffset)
           * [2] = (xscale, yscale, 0, 0) */
-         "DCL CONST[0..2]\n"
+         "DCL CONST[0][0..2]\n"
          "DCL TEMP[0]\n"
          "IMM[0] FLT32 { -1, 0, 0, 1 }\n"
 
          /* v = in * (xscale, yscale) + (xoffset, yoffset) */
-         "MAD TEMP[0].xy, IN[0], CONST[2].xyyy, CONST[1].zwww\n"
+         "MAD TEMP[0].xy, IN[0], CONST[0][2].xyyy, CONST[0][1].zwww\n"
          /* pos = v * (2 / fb_width, 2 / fb_height) - (1, 1) */
-         "MAD OUT[0].xy, TEMP[0], CONST[1].xyyy, IMM[0].xxxx\n"
+         "MAD OUT[0].xy, TEMP[0], CONST[0][1].xyyy, IMM[0].xxxx\n"
          "MOV OUT[0].zw, IMM[0]\n"
 
-         "MOV OUT[1], CONST[0]\n"
+         "MOV OUT[1], CONST[0][0]\n"
          "MOV OUT[2], IN[1]\n"
          "END\n"
       };
 
       struct tgsi_token tokens[1000];
       struct pipe_shader_state state;
       if (!tgsi_text_translate(vertex_shader_text, tokens, ARRAY_SIZE(tokens))) {
          assert(0);
          pipe_resource_reference(&hud->font.texture, NULL);
          FREE(hud);
-- 
2.11.0



More information about the mesa-dev mailing list