mesa/glsl: move BlendSupport bitfield to gl_program
This will let us to make _CurrentFragmentProgram a gl_program pointer allowing for simpilifications to be made. We also need to add a field to gl_shader to hold it during parsing. In gl_program we put it inside a union in anticipation of moving more fields here that can be only fs or vertex stage fields. Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
@@ -1818,7 +1818,7 @@ set_shader_inout_layout(struct gl_shader *shader,
|
||||
shader->info.EarlyFragmentTests = state->fs_early_fragment_tests;
|
||||
shader->info.InnerCoverage = state->fs_inner_coverage;
|
||||
shader->info.PostDepthCoverage = state->fs_post_depth_coverage;
|
||||
shader->info.BlendSupport = state->fs_blend_support;
|
||||
shader->BlendSupport = state->fs_blend_support;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -1829,7 +1829,6 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog,
|
||||
linked_shader->info.uses_gl_fragcoord = false;
|
||||
linked_shader->info.origin_upper_left = false;
|
||||
linked_shader->info.pixel_center_integer = false;
|
||||
linked_shader->info.BlendSupport = 0;
|
||||
|
||||
if (linked_shader->Stage != MESA_SHADER_FRAGMENT ||
|
||||
(prog->data->Version < 150 &&
|
||||
@@ -1894,7 +1893,7 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog,
|
||||
linked_shader->Program->info.fs.post_depth_coverage |=
|
||||
shader->info.PostDepthCoverage;
|
||||
|
||||
linked_shader->info.BlendSupport |= shader->info.BlendSupport;
|
||||
linked_shader->Program->sh.fs.BlendSupport |= shader->BlendSupport;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -463,7 +463,7 @@ get_main(gl_linked_shader *sh)
|
||||
bool
|
||||
lower_blend_equation_advanced(struct gl_linked_shader *sh)
|
||||
{
|
||||
if (sh->info.BlendSupport == 0)
|
||||
if (sh->Program->sh.fs.BlendSupport == 0)
|
||||
return false;
|
||||
|
||||
/* Lower early returns in main() so there's a single exit point
|
||||
@@ -547,7 +547,8 @@ lower_blend_equation_advanced(struct gl_linked_shader *sh)
|
||||
ir_factory f(&main->body, mem_ctx);
|
||||
|
||||
ir_variable *result_dest =
|
||||
calc_blend_result(f, mode, fb, blend_source, sh->info.BlendSupport);
|
||||
calc_blend_result(f, mode, fb, blend_source,
|
||||
sh->Program->sh.fs.BlendSupport);
|
||||
|
||||
/* Copy the result back to the original values. It would be simpler
|
||||
* to demote the program's output variables, and create a new vec4
|
||||
|
||||
Reference in New Issue
Block a user