Mesa (master): tgsi: added tgsi_shader_info::indirect_files field
Brian Paul
brianp at kemper.freedesktop.org
Wed Jul 21 16:19:54 UTC 2010
Module: Mesa
Branch: master
Commit: 85206e56a1c3400be47229d4a8c6a1cd7a2f476e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=85206e56a1c3400be47229d4a8c6a1cd7a2f476e
Author: Brian Paul <brianp at vmware.com>
Date: Wed Jul 21 09:51:11 2010 -0600
tgsi: added tgsi_shader_info::indirect_files field
Indicates which register files are accessed with indirect addressing.
---
src/gallium/auxiliary/tgsi/tgsi_scan.c | 13 +++++++++++++
src/gallium/auxiliary/tgsi/tgsi_scan.h | 6 ++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index ced9c94..90198a4 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -109,6 +109,19 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
info->input_usage_mask[ind] |= usage_mask;
}
}
+
+ /* check for indirect register reads */
+ if (src->Register.Indirect) {
+ info->indirect_files |= (1 << src->Register.File);
+ }
+ }
+
+ /* check for indirect register writes */
+ for (i = 0; i < fullinst->Instruction.NumDstRegs; i++) {
+ const struct tgsi_full_dst_register *dst = &fullinst->Dst[i];
+ if (dst->Register.Indirect) {
+ info->indirect_files |= (1 << dst->Register.File);
+ }
}
info->num_instructions++;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
index e752803..f8aa90c 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
@@ -63,6 +63,12 @@ struct tgsi_shader_info
boolean writes_edgeflag; /**< vertex shader outputs edgeflag */
boolean uses_kill; /**< KIL or KILP instruction used? */
+ /**
+ * Bitmask indicating which register files are accessed with
+ * indirect addressing. The bits are (1 << TGSI_FILE_x), etc.
+ */
+ unsigned indirect_files;
+
struct {
unsigned name;
unsigned data[8];
More information about the mesa-commit
mailing list