[Mesa-dev,03/17] tgsi/scan: add info about declared samplers

Submitted by Marek Olšák on Oct. 6, 2015, 1:26 a.m.

Details

Message ID 1444094790-19442-4-git-send-email-maraeo@gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Marek Olšák Oct. 6, 2015, 1:26 a.m.
From: Marek Olšák <marek.olsak@amd.com>

---
 src/gallium/auxiliary/tgsi/tgsi_scan.c | 2 ++
 src/gallium/auxiliary/tgsi/tgsi_scan.h | 1 +
 2 files changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index 00b07c8..1c45748 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -208,6 +208,8 @@  tgsi_scan_shader(const struct tgsi_token *tokens,
                   assert(fullinst->Instruction.Texture);
                   assert(src->Register.Index < Elements(info->is_msaa_sampler));
 
+                  info->samplers_declared |= 1 << src->Register.Index;
+
                   if (fullinst->Instruction.Texture &&
                       (fullinst->Texture.Texture == TGSI_TEXTURE_2D_MSAA ||
                        fullinst->Texture.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA)) {
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
index 3ceb557..d60ccab 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
@@ -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];