diff options
author | Timothy Arceri <[email protected]> | 2016-10-19 13:45:18 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-10-26 14:29:36 +1100 |
commit | 17e28a1571b6141368fefc84cc8b0a3b4e52f8ee (patch) | |
tree | 9046dd8d18afba16a7dadc3a855c01da74b3d384 /src/compiler | |
parent | 91d5b0eda9eeb2a41342e7ab46bd1c779d8b93c9 (diff) |
i965/mesa/st/swrast: set fs shader_info directly and switch to using it
Note we access shader_info from the program struct rather than the
nir_shader pointer because shader cache won't create a nir_shader.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/ir_set_program_inouts.cpp | 14 | ||||
-rw-r--r-- | src/compiler/shader_info.c | 3 |
2 files changed, 4 insertions, 13 deletions
diff --git a/src/compiler/glsl/ir_set_program_inouts.cpp b/src/compiler/glsl/ir_set_program_inouts.cpp index a1772199638..e68ecfb11cd 100644 --- a/src/compiler/glsl/ir_set_program_inouts.cpp +++ b/src/compiler/glsl/ir_set_program_inouts.cpp @@ -26,8 +26,6 @@ * * Sets the InputsRead and OutputsWritten of Mesa programs. * - * Additionally, for fragment shaders, set the IsSample bitfield. - * * Mesa programs (gl_program, not gl_shader_program) have a set of * flags indicating which varyings are read and written. Computing * which are actually read from some sort of backend code can be @@ -123,9 +121,7 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len, prog->DoubleInputsRead |= bitfield; if (stage == MESA_SHADER_FRAGMENT) { - gl_fragment_program *fprog = (gl_fragment_program *) prog; - if (var->data.sample) - fprog->IsSample |= bitfield; + prog->info.fs.uses_sample_qualifier |= var->data.sample; } } else if (var->data.mode == ir_var_system_value) { prog->SystemValuesRead |= bitfield; @@ -411,8 +407,7 @@ ir_set_program_inouts_visitor::visit_enter(ir_discard *) /* discards are only allowed in fragment shaders. */ assert(this->shader_stage == MESA_SHADER_FRAGMENT); - gl_fragment_program *fprog = (gl_fragment_program *) prog; - fprog->UsesKill = true; + prog->info.fs.uses_discard = true; return visit_continue; } @@ -439,9 +434,8 @@ do_set_program_inouts(exec_list *instructions, struct gl_program *prog, prog->PatchOutputsWritten = 0; prog->SystemValuesRead = 0; if (shader_stage == MESA_SHADER_FRAGMENT) { - gl_fragment_program *fprog = (gl_fragment_program *) prog; - fprog->IsSample = 0; - fprog->UsesKill = false; + prog->info.fs.uses_sample_qualifier = false; + prog->info.fs.uses_discard = false; } visit_list_elements(&v, instructions); } diff --git a/src/compiler/shader_info.c b/src/compiler/shader_info.c index 9329e518a37..7118e79ae4d 100644 --- a/src/compiler/shader_info.c +++ b/src/compiler/shader_info.c @@ -44,10 +44,7 @@ copy_shader_info(const struct gl_shader_program *shader_prog, struct gl_fragment_program *fp = (struct gl_fragment_program *)sh->Program; - info->fs.uses_discard = fp->UsesKill; - info->fs.uses_sample_qualifier = fp->IsSample != 0; info->fs.early_fragment_tests = sh->info.EarlyFragmentTests; - info->fs.depth_layout = fp->FragDepthLayout; break; } |