summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ir_optimization.h
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-06-30 14:55:40 +1000
committerTimothy Arceri <[email protected]>2016-06-30 16:51:25 +1000
commit1fb8c6df884c2a17cf980c4ea32db4c214903b55 (patch)
treea21b0de699816ce28de37dd61531a025cc984114 /src/compiler/glsl/ir_optimization.h
parent378f07ccb5bff7857d87a4fe5dff0b5e83f99895 (diff)
glsl/mesa: split gl_shader in two
There are two distinctly different uses of this struct. The first is to store GL shader objects. The second is to store information about a shader stage thats been linked. The two uses actually share few fields and there is clearly confusion about their use. For example the linked shaders map one to one with a program so can simply be destroyed along with the program. However previously we were calling reference counting on the linked shaders. We were also creating linked shaders with a name even though it is always 0 and called the driver version of the _mesa_new_shader() function unnecessarily for GL shader objects. Acked-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_optimization.h')
-rw-r--r--src/compiler/glsl/ir_optimization.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/compiler/glsl/ir_optimization.h b/src/compiler/glsl/ir_optimization.h
index ba14e34b71e..ba790762a62 100644
--- a/src/compiler/glsl/ir_optimization.h
+++ b/src/compiler/glsl/ir_optimization.h
@@ -86,7 +86,8 @@ bool do_copy_propagation(exec_list *instructions);
bool do_copy_propagation_elements(exec_list *instructions);
bool do_constant_propagation(exec_list *instructions);
void do_dead_builtin_varyings(struct gl_context *ctx,
- gl_shader *producer, gl_shader *consumer,
+ gl_linked_shader *producer,
+ gl_linked_shader *consumer,
unsigned num_tfeedback_decls,
class tfeedback_decl *tfeedback_decls);
bool do_dead_code(exec_list *instructions, bool uniform_locations_assigned);
@@ -119,26 +120,30 @@ bool lower_variable_index_to_cond_assign(gl_shader_stage stage,
bool lower_temp, bool lower_uniform);
bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz);
bool lower_const_arrays_to_uniforms(exec_list *instructions);
-bool lower_clip_cull_distance(struct gl_shader_program *prog, gl_shader *shader);
+bool lower_clip_cull_distance(struct gl_shader_program *prog,
+ gl_linked_shader *shader);
void lower_output_reads(unsigned stage, exec_list *instructions);
bool lower_packing_builtins(exec_list *instructions, int op_mask);
-void lower_shared_reference(struct gl_shader *shader, unsigned *shared_size);
-void lower_ubo_reference(struct gl_shader *shader, bool clamp_block_indices);
+void lower_shared_reference(struct gl_linked_shader *shader,
+ unsigned *shared_size);
+void lower_ubo_reference(struct gl_linked_shader *shader,
+ bool clamp_block_indices);
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_linked_shader *shader,
bool disable_varying_packing, bool xfb_enabled);
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);
+bool lower_vector_derefs(gl_linked_shader *shader);
+void lower_named_interface_blocks(void *mem_ctx, gl_linked_shader *shader);
bool optimize_redundant_jumps(exec_list *instructions);
bool optimize_split_arrays(exec_list *instructions, bool linked);
bool lower_offset_arrays(exec_list *instructions);
void optimize_dead_builtin_variables(exec_list *instructions,
enum ir_variable_mode other);
-bool lower_tess_level(gl_shader *shader);
+bool lower_tess_level(gl_linked_shader *shader);
-bool lower_vertex_id(gl_shader *shader);
+bool lower_vertex_id(gl_linked_shader *shader);
bool lower_subroutine(exec_list *instructions, struct _mesa_glsl_parse_state *state);
void propagate_invariance(exec_list *instructions);