void lower_ubo_reference(struct gl_shader *shader);
void lower_packed_varyings(void *mem_ctx,
unsigned locations_used, ir_variable_mode mode,
- unsigned gs_input_vertices, gl_shader *shader);
+ unsigned gs_input_vertices, gl_shader *shader,
+ bool disable_varying_packing);
bool lower_vector_insert(exec_list *instructions, bool lower_nonconstant_index);
bool lower_vector_derefs(gl_shader *shader);
void lower_named_interface_blocks(void *mem_ctx, gl_shader *shader);
ir_var_shader_in);
}
- if (!disable_varying_packing) {
- if (producer) {
- lower_packed_varyings(mem_ctx, slots_used, ir_var_shader_out,
- 0, producer);
- }
- if (consumer) {
- lower_packed_varyings(mem_ctx, slots_used, ir_var_shader_in,
- consumer_vertices, consumer);
- }
+ if (producer) {
+ lower_packed_varyings(mem_ctx, slots_used, ir_var_shader_out,
+ 0, producer, disable_varying_packing);
+ }
+
+ if (consumer) {
+ lower_packed_varyings(mem_ctx, slots_used, ir_var_shader_in,
+ consumer_vertices, consumer,
+ disable_varying_packing);
}
return true;
ir_variable_mode mode,
unsigned gs_input_vertices,
exec_list *out_instructions,
- exec_list *out_variables);
+ exec_list *out_variables,
+ bool disable_varying_packing);
void run(struct gl_shader *shader);
* Exec list into which the visitor should insert any new variables.
*/
exec_list *out_variables;
+
+ bool disable_varying_packing;
};
} /* anonymous namespace */
lower_packed_varyings_visitor::lower_packed_varyings_visitor(
void *mem_ctx, unsigned locations_used, ir_variable_mode mode,
unsigned gs_input_vertices, exec_list *out_instructions,
- exec_list *out_variables)
+ exec_list *out_variables, bool disable_varying_packing)
: mem_ctx(mem_ctx),
locations_used(locations_used),
packed_varyings((ir_variable **)
mode(mode),
gs_input_vertices(gs_input_vertices),
out_instructions(out_instructions),
- out_variables(out_variables)
+ out_variables(out_variables),
+ disable_varying_packing(disable_varying_packing)
{
}
if (var->data.explicit_location)
return false;
+ if (disable_varying_packing)
+ return false;
+
const glsl_type *type = var->type->without_array();
if (type->vector_elements == 4 && !type->is_double())
return false;
void
lower_packed_varyings(void *mem_ctx, unsigned locations_used,
ir_variable_mode mode, unsigned gs_input_vertices,
- gl_shader *shader)
+ gl_shader *shader, bool disable_varying_packing)
{
exec_list *instructions = shader->ir;
ir_function *main_func = shader->symbols->get_function("main");
lower_packed_varyings_visitor visitor(mem_ctx, locations_used, mode,
gs_input_vertices,
&new_instructions,
- &new_variables);
+ &new_variables,
+ disable_varying_packing);
visitor.run(shader);
if (mode == ir_var_shader_out) {
if (shader->Stage == MESA_SHADER_GEOMETRY) {