summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-19 09:15:57 +1100
committerTimothy Arceri <[email protected]>2016-10-26 14:29:36 +1100
commit9d2b391165e64f3c64021e5a563037e0ccc09d84 (patch)
tree9f1849a81c187cd412762f8ea17567ecb56f3ef5 /src/mesa
parentdebed12fdde9766fd9cf99d679207a36a4599a82 (diff)
glsl: add temporary copy_shader_info() function
This function is added here to ease refactoring towards using the new shared shader_info. Once refactoring is complete and values are set directly it will be removed. We call it from _mesa_copy_linked_program_data() rather than glsl_to_nir() so that the values will be set for all drivers. In order to do this some calls need to be moved around so that we make sure to call do_set_program_inouts() before _mesa_copy_linked_program_data() Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_link.cpp8
-rw-r--r--src/mesa/main/shaderapi.c2
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp4
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp2
4 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index f0e504d99ab..f75b384d673 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -231,10 +231,12 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
prog->Parameters = _mesa_new_parameter_list();
- _mesa_copy_linked_program_data(shProg, shader);
-
process_glsl_ir(brw, shProg, shader);
+ do_set_program_inouts(shader->ir, prog, shader->Stage);
+
+ _mesa_copy_linked_program_data(shProg, shader);
+
/* Make a pass over the IR to add state references for any built-in
* uniforms that are used. This has to be done now (during linking).
* Code generation doesn't happen until the first time this shader is
@@ -258,8 +260,6 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
}
}
- do_set_program_inouts(shader->ir, prog, shader->Stage);
-
prog->SamplersUsed = shader->active_samplers;
prog->ShadowSamplers = shader->shadow_samplers;
_mesa_update_shader_textures_used(shProg, prog);
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 358969b082c..bbaf7706407 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2218,6 +2218,8 @@ _mesa_copy_linked_program_data(const struct gl_shader_program *src,
default:
break;
}
+
+ copy_shader_info(src, dst_sh);
}
/**
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 97fef082c04..303b36e9467 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -382,6 +382,8 @@ st_nir_get_mesa_program(struct gl_context *ctx,
prog->Parameters = _mesa_new_parameter_list();
+ do_set_program_inouts(shader->ir, prog, shader->Stage);
+
_mesa_copy_linked_program_data(shader_program, shader);
_mesa_generate_parameters_list_for_uniforms(shader_program, shader,
prog->Parameters);
@@ -421,8 +423,6 @@ st_nir_get_mesa_program(struct gl_context *ctx,
prog->Instructions = NULL;
prog->NumInstructions = 0;
- do_set_program_inouts(shader->ir, prog, shader->Stage);
-
prog->SamplersUsed = shader->active_samplers;
prog->ShadowSamplers = shader->shadow_samplers;
prog->ExternalSamplersUsed = gl_external_samplers(shader);
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index b2bd2152488..4d2b1f60ebb 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6397,7 +6397,6 @@ get_mesa_program_tgsi(struct gl_context *ctx,
v->have_fma = pscreen->get_shader_param(pscreen, ptarget,
PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED);
- _mesa_copy_linked_program_data(shader_program, shader);
_mesa_generate_parameters_list_for_uniforms(shader_program, shader,
prog->Parameters);
@@ -6467,6 +6466,7 @@ get_mesa_program_tgsi(struct gl_context *ctx,
prog->NumInstructions = 0;
do_set_program_inouts(shader->ir, prog, shader->Stage);
+ _mesa_copy_linked_program_data(shader_program, shader);
shrink_array_declarations(v->inputs, v->num_inputs,
&prog->InputsRead, prog->DoubleInputsRead, &prog->PatchInputsRead);
shrink_array_declarations(v->outputs, v->num_outputs,