tgsi/scan: add info about declared samplers (v2)
authorMarek Olšák <marek.olsak@amd.com>
Sun, 4 Oct 2015 22:08:30 +0000 (00:08 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 9 Oct 2015 20:02:18 +0000 (22:02 +0200)
v2: get it from declarations, not instructions

src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index d76dddbf7d94d1f8654b4c06c24ffb2ea68e2b39..b84a1753eeb7486eb01992fe22baced8cec0172f 100644 (file)
@@ -409,6 +409,8 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                         info->writes_edgeflag = TRUE;
                      }
                   }
+               } else if (file == TGSI_FILE_SAMPLER) {
+                  info->samplers_declared |= 1 << reg;
                }
             }
          }
index 3ceb55717eeebd695fbc14cc433dff57941a9579..d60ccabda6d2cc1cd4ad813a162bda1c14c927e7 100644 (file)
@@ -64,6 +64,7 @@ struct tgsi_shader_info
    uint file_count[TGSI_FILE_COUNT];  /**< number of declared registers */
    int file_max[TGSI_FILE_COUNT];  /**< highest index of declared registers */
    int const_file_max[PIPE_MAX_CONSTANT_BUFFERS];
+   unsigned samplers_declared; /**< bitmask of declared samplers */
 
    ubyte input_array_first[PIPE_MAX_SHADER_INPUTS];
    ubyte input_array_last[PIPE_MAX_SHADER_INPUTS];