tgsi: fix parsing of shared memory declarations
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 7 Mar 2016 17:52:19 +0000 (18:52 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 7 Mar 2016 21:13:08 +0000 (22:13 +0100)
The SHARED TGSI keyword is only allowed with TGSI_FILE_MEMORY and not
with TGSI_FILE_BUFFER. I have found this by using the nouveau_compiler
from command line.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
src/gallium/auxiliary/tgsi/tgsi_text.c

index 91baa01ad8bdebad44ec44ba43f9d7a5166080d2..77598d2cb7954bb32ace26a81c2fc4760780edec 100644 (file)
@@ -1388,7 +1388,9 @@ static boolean parse_declaration( struct translate_ctx *ctx )
          if (str_match_nocase_whole(&cur, "ATOMIC")) {
             decl.Declaration.Atomic = 1;
             ctx->cur = cur;
-         } else if (str_match_nocase_whole(&cur, "SHARED")) {
+         }
+      } else if (file == TGSI_FILE_MEMORY) {
+         if (str_match_nocase_whole(&cur, "SHARED")) {
             decl.Declaration.Shared = 1;
             ctx->cur = cur;
          }