void
program_resource_visitor::process(ir_variable *var, bool use_std430_as_default)
+{
+ const glsl_type *t =
+ var->data.from_named_ifc_block ? var->get_interface_type() : var->type;
+ process(var, t, use_std430_as_default);
+}
+
+void
+program_resource_visitor::process(ir_variable *var, const glsl_type *var_type,
+ bool use_std430_as_default)
{
unsigned record_array_count = 1;
const bool row_major =
get_internal_ifc_packing(use_std430_as_default) :
var->type->get_internal_ifc_packing(use_std430_as_default);
- const glsl_type *t =
- var->data.from_named_ifc_block ? var->get_interface_type() : var->type;
+ const glsl_type *t = var_type;
const glsl_type *t_without_array = t->without_array();
/* false is always passed for the row_major parameter to the other
{
public:
tfeedback_candidate_generator(void *mem_ctx,
- hash_table *tfeedback_candidates)
+ hash_table *tfeedback_candidates,
+ gl_shader_stage stage)
: mem_ctx(mem_ctx),
tfeedback_candidates(tfeedback_candidates),
+ stage(stage),
toplevel_var(NULL),
varying_floats(0)
{
{
/* All named varying interface blocks should be flattened by now */
assert(!var->is_interface_instance());
+ assert(var->data.mode == ir_var_shader_out);
this->toplevel_var = var;
this->varying_floats = 0;
- program_resource_visitor::process(var, false);
+ const glsl_type *t =
+ var->data.from_named_ifc_block ? var->get_interface_type() : var->type;
+ if (!var->data.patch && stage == MESA_SHADER_TESS_CTRL) {
+ assert(t->is_array());
+ t = t->fields.array;
+ }
+ program_resource_visitor::process(var, t, false);
}
private:
*/
hash_table * const tfeedback_candidates;
+ gl_shader_stage stage;
+
/**
* Pointer to the toplevel variable that is being traversed.
*/
producer->Stage == MESA_SHADER_GEOMETRY));
if (num_tfeedback_decls > 0) {
- tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates);
+ tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates, producer->Stage);
/* From OpenGL 4.6 (Core Profile) spec, section 11.1.2.1
* ("Vertex Shader Variables / Output Variables")
*
*/
void process(ir_variable *var, bool use_std430_as_default);
+ /**
+ * Begin processing a variable
+ *
+ * Classes that overload this function should call \c ::process from the
+ * base class to start the recursive processing of the variable.
+ *
+ * \param var The variable that is to be processed
+ * \param var_type The glsl_type reference of the variable
+ *
+ * Calls \c ::visit_field for each leaf of the variable.
+ *
+ * \warning
+ * When processing a uniform block, this entry should only be used in cases
+ * where the row / column ordering of matrices in the block does not
+ * matter. For example, enumerating the names of members of the block, but
+ * not for determining the offsets of members.
+ */
+ void process(ir_variable *var, const glsl_type *var_type,
+ bool use_std430_as_default);
+
/**
* Begin processing a variable of a structured type.
*