[Mesa-dev] [PATCH 4/5] tgsi: add clip and cull distance writemasks into tgsi_shader_info
Marek Olšák
maraeo at gmail.com
Tue Dec 9 03:28:21 PST 2014
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/auxiliary/tgsi/tgsi_scan.c | 4 ++++
src/gallium/auxiliary/tgsi/tgsi_scan.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index b6c88af..9d155c9 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -227,10 +227,14 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
if (semName == TGSI_SEMANTIC_CLIPDIST) {
info->num_written_clipdistance +=
util_bitcount(fulldecl->Declaration.UsageMask);
+ info->clipdist_writemask |=
+ fulldecl->Declaration.UsageMask << (semIndex*4);
}
else if (semName == TGSI_SEMANTIC_CULLDIST) {
info->num_written_culldistance +=
util_bitcount(fulldecl->Declaration.UsageMask);
+ info->culldist_writemask |=
+ fulldecl->Declaration.UsageMask << (semIndex*4);
}
else if (semName == TGSI_SEMANTIC_VIEWPORT_INDEX) {
info->writes_viewport_index = TRUE;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
index b50b650..5607997 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
@@ -81,6 +81,8 @@ struct tgsi_shader_info
boolean writes_layer;
boolean is_msaa_sampler[PIPE_MAX_SAMPLERS];
+ unsigned clipdist_writemask;
+ unsigned culldist_writemask;
unsigned num_written_culldistance;
unsigned num_written_clipdistance;
/**
--
2.1.0
More information about the mesa-dev
mailing list