diff options
author | Zack Rusin <[email protected]> | 2013-08-02 01:24:41 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2013-08-02 20:11:18 -0400 |
commit | 36096af02603a72855fee1c4a48a0a60baba7c32 (patch) | |
tree | d43c0986239ecb38301e3c018f78da4fafee54a6 /src/gallium/auxiliary/tgsi/tgsi_scan.c | |
parent | 2da1daaa4e1f2b8243a02526cc0e5ff2d78e1774 (diff) |
tgsi: detect prim id and front face usage in fs
Adding code to detect the usage of prim id and front face
semantics in fragment shaders.
Signed-off-by: Zack Rusin <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_scan.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_scan.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index 1fe1a07d7c3..e7bf6e660e0 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -166,9 +166,14 @@ tgsi_scan_shader(const struct tgsi_token *tokens, info->input_cylindrical_wrap[reg] = (ubyte)fulldecl->Interp.CylindricalWrap; info->num_inputs++; - if (procType == TGSI_PROCESSOR_FRAGMENT && - fulldecl->Semantic.Name == TGSI_SEMANTIC_POSITION) + if (procType == TGSI_PROCESSOR_FRAGMENT) { + if (fulldecl->Semantic.Name == TGSI_SEMANTIC_POSITION) info->reads_position = TRUE; + else if (fulldecl->Semantic.Name == TGSI_SEMANTIC_PRIMID) + info->uses_primid = TRUE; + else if (fulldecl->Semantic.Name == TGSI_SEMANTIC_FACE) + info->uses_frontface = TRUE; + } } else if (file == TGSI_FILE_SYSTEM_VALUE) { unsigned index = fulldecl->Range.First; |