<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, May 16, 2018 at 11:01 PM, Timothy Arceri <span dir="ltr"><<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 17/05/18 10:59, Marek Olšák wrote:<div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sat, May 12, 2018 at 12:49 AM, Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a> <mailto:<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>><wbr>> wrote:<br>
<br>
This allows us to get the variable mode as specified by the GLSL<br>
spec. We will use this in the following patch.<br>
---<br>
src/compiler/glsl/ast_to_<wbr>hir.cpp | 73 ++++++++++++++++++++++++++++++<wbr>++<br>
1 file changed, 73 insertions(+)<br>
<br>
diff --git a/src/compiler/glsl/ast_to_hir<wbr>.cpp<br>
b/src/compiler/glsl/ast_to_hir<wbr>.cpp<br>
index 3bf581571e2..a7a9ac80769 100644<br>
--- a/src/compiler/glsl/ast_to_hir<wbr>.cpp<br>
+++ b/src/compiler/glsl/ast_to_hir<wbr>.cpp<br>
@@ -4175,6 +4175,79 @@ apply_type_qualifier_to_variab<wbr>le(const struct<br>
ast_type_qualifier *qual,<br>
apply_image_qualifier_to_varia<wbr>ble(qual, var, state, loc);<br>
}<br>
<br>
+/**<br>
+ * Get the GLSL mode specified in for system values (if any).<br>
+ */<br>
+static enum ir_variable_mode<br>
+glsl_external_mode(enum ir_variable_mode internal_mode,<br>
gl_shader_stage stage,<br>
+ unsigned slot) {<br>
+ if (internal_mode == ir_var_system_value) {<br>
+ switch (slot) {<br>
+ case SYSTEM_VALUE_SUBGROUP_SIZE:<br>
+ return ir_var_uniform;<br>
+ case SYSTEM_VALUE_PRIMITIVE_ID:<br>
+ if (stage == MESA_SHADER_GEOMETRY) {<br>
+ return ir_var_shader_out;<br>
<br>
<br>
System values are always inputs. This one is gl_PrimitiveIDIn.<br>
<br>
+ } else {<br>
+ return ir_var_shader_in;<br>
+ }<br>
+ case SYSTEM_VALUE_TESS_LEVEL_OUTER:<br>
+ case SYSTEM_VALUE_TESS_LEVEL_INNER:<br>
+ if (stage == MESA_SHADER_TESS_CTRL) {<br>
+ return ir_var_shader_out;<br>
<br>
<br>
System values are always inputs, i.e. TESS_CTRL isn't allowed here.<br>
</blockquote>
<br></div></div>
Hmm yeah your right I seem to have confused myself here a bit. However SYSTEM_VALUE_SUBGROUP_SIZE seems to be the odd one out in that its a uniform.<br></blockquote><div><br></div><div>Why is it uniform?</div><div><br></div><div>Marek<br></div></div></div></div>