var->name = ralloc_strdup(var, name);
var->type = type;
var->data.mode = mode;
+ var->data.how_declared = nir_var_declared_normally;
if ((mode == nir_var_shader_in &&
shader->info.stage != MESA_SHADER_VERTEX) ||
nir_depth_layout_unchanged
} nir_depth_layout;
+/**
+ * Enum keeping track of how a variable was declared.
+ */
+typedef enum {
+ /**
+ * Normal declaration.
+ */
+ nir_var_declared_normally = 0,
+
+ /**
+ * Variable is implicitly generated by the compiler and should not be
+ * visible via the API.
+ */
+ nir_var_hidden,
+} nir_var_declaration_type;
+
/**
* Either a uniform, global variable, shader input, or shader output. Based on
* ir_variable - it should be easy to translate between the two.
*/
unsigned xfb_stride;
+ /**
+ * How the variable was declared. See nir_var_declaration_type.
+ *
+ * This is used to detect variables generated by the compiler, so should
+ * not be visible via the API.
+ */
+ unsigned how_declared:2;
+
/**
* ARB_shader_image_load_store qualifiers.
*/
var->state_slots[0].swizzle = SWIZZLE_XYZW;
memcpy(var->state_slots[0].tokens, state->options->state_tokens,
sizeof(var->state_slots[0].tokens));
-
+ var->data.how_declared = nir_var_hidden;
state->transform = var;
}
return nir_load_var(&state->b, state->transform);