[Mesa-dev] [PATCH 07/20] tgsi/scan: record if a shader writes the position output
Marek Olšák
maraeo at gmail.com
Wed Nov 16 18:38:30 UTC 2016
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/auxiliary/tgsi/tgsi_scan.c | 2 ++
src/gallium/auxiliary/tgsi/tgsi_scan.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index f0dba0b..84d6456 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -568,20 +568,22 @@ scan_declaration(struct tgsi_shader_info *info,
break;
case TGSI_SEMANTIC_SAMPLEMASK:
info->writes_samplemask = true;
break;
case TGSI_SEMANTIC_EDGEFLAG:
info->writes_edgeflag = true;
break;
case TGSI_SEMANTIC_POSITION:
if (procType == PIPE_SHADER_FRAGMENT)
info->writes_z = true;
+ else
+ info->writes_position = true;
break;
}
break;
case TGSI_FILE_SAMPLER:
STATIC_ASSERT(sizeof(info->samplers_declared) * 8 >= PIPE_MAX_SAMPLERS);
info->samplers_declared |= 1u << reg;
break;
case TGSI_FILE_SAMPLER_VIEW:
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
index 602a870..fe503e8 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
@@ -103,20 +103,21 @@ struct tgsi_shader_info
boolean uses_linear_opcode_interp_centroid;
boolean uses_linear_opcode_interp_offset;
boolean uses_linear_opcode_interp_sample;
boolean uses_instanceid;
boolean uses_vertexid;
boolean uses_vertexid_nobase;
boolean uses_basevertex;
boolean uses_primid;
boolean uses_frontface;
boolean uses_invocationid;
+ boolean writes_position;
boolean writes_psize;
boolean writes_clipvertex;
boolean writes_viewport_index;
boolean writes_layer;
boolean writes_memory; /**< contains stores or atomics to buffers or images */
boolean is_msaa_sampler[PIPE_MAX_SAMPLERS];
boolean uses_doubles; /**< uses any of the double instructions */
boolean uses_derivatives;
unsigned clipdist_writemask;
unsigned culldist_writemask;
--
2.7.4
More information about the mesa-dev
mailing list