type_size_vec4_times_4() was introduced as a fix in
8dcf807cb43383
however since
3810c1561 we can just use type_size_scalar() and
get the actual number of outputs we need.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
return 0;
}
-/**
- * Returns the number of scalar components needed to store type, assuming
- * that vectors are padded out to vec4.
- *
- * This has the packing rules of type_size_vec4(), but counts components
- * similar to type_size_scalar().
- */
-extern "C" int
-type_size_vec4_times_4(const struct glsl_type *type)
-{
- return 4 * type_size_vec4(type);
-}
-
/* Attribute arrays are loaded as one vec4 per element (or matrix column),
* except for double-precision types, which are loaded as one dvec4.
*/
for (unsigned count = 0; count < num_elements; count += 4) {
this->outputs[*location] = *reg;
this->output_components[*location] = MIN2(4, num_elements - count);
- *reg = offset(*reg, bld, 4);
+ *reg = offset(*reg, bld, this->output_components[*location]);
(*location)++;
}
}
{
if (is_scalar) {
nir_assign_var_locations(&nir->outputs, &nir->num_outputs,
- type_size_vec4_times_4);
- nir_lower_io(nir, nir_var_shader_out, type_size_vec4_times_4);
+ type_size_scalar);
+ nir_lower_io(nir, nir_var_shader_out, type_size_scalar);
} else {
nir_foreach_variable(var, &nir->outputs)
var->data.driver_location = var->data.location;
int type_size_scalar(const struct glsl_type *type);
int type_size_vec4(const struct glsl_type *type);
int type_size_dvec4(const struct glsl_type *type);
-int type_size_vec4_times_4(const struct glsl_type *type);
int type_size_vs_input(const struct glsl_type *type);
unsigned tesslevel_outer_components(GLenum tes_primitive_mode);