diff options
author | Francisco Jerez <[email protected]> | 2018-02-14 11:53:49 -0800 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2018-02-24 15:28:36 -0800 |
commit | 537bb1da98c34eafbed714d468c56fc0af543e49 (patch) | |
tree | e2b9eb2585c75d156f7c27da116b21143fc5e71d /src/compiler/glsl | |
parent | ef9e3f63ca369e3549b4f17b39934dc4b3cbbb05 (diff) |
glsl: Specify framebuffer fetch coherency mode in lower_blend_equation_advanced().
This requires passing an extra argument to the lowering pass because
the KHR_blend_equation_advanced specification doesn't seem to define
any mechanism for the implementation to determine at compile-time
whether coherent blending can ever be used (not even an "#extension
KHR_blend_equation_advanced_coherent" directive seems to be required
in the shader source AFAICT).
In the long run we'll probably want to do state-dependent recompiles
based on the value of ctx->Color.BlendCoherent, but right now there
would be no benefit from that because the only driver that supports
coherent framebuffer fetch is i965 on SKL+ hardware, which are unable
to support the non-coherent path for the moment because of texture
layout issues, so framebuffer fetch coherency is always enabled for
them.
Reviewed-by: Plamena Manolova <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/ir_optimization.h | 2 | ||||
-rw-r--r-- | src/compiler/glsl/lower_blend_equation_advanced.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/glsl/ir_optimization.h b/src/compiler/glsl/ir_optimization.h index 2b8c195151a..81049a479e8 100644 --- a/src/compiler/glsl/ir_optimization.h +++ b/src/compiler/glsl/ir_optimization.h @@ -166,7 +166,7 @@ bool lower_tess_level(gl_linked_shader *shader); bool lower_vertex_id(gl_linked_shader *shader); bool lower_cs_derived(gl_linked_shader *shader); -bool lower_blend_equation_advanced(gl_linked_shader *shader); +bool lower_blend_equation_advanced(gl_linked_shader *shader, bool coherent); bool lower_subroutine(exec_list *instructions, struct _mesa_glsl_parse_state *state); void propagate_invariance(exec_list *instructions); diff --git a/src/compiler/glsl/lower_blend_equation_advanced.cpp b/src/compiler/glsl/lower_blend_equation_advanced.cpp index c6db58142cd..b05a2e0f0bb 100644 --- a/src/compiler/glsl/lower_blend_equation_advanced.cpp +++ b/src/compiler/glsl/lower_blend_equation_advanced.cpp @@ -462,7 +462,7 @@ get_main(gl_linked_shader *sh) } bool -lower_blend_equation_advanced(struct gl_linked_shader *sh) +lower_blend_equation_advanced(struct gl_linked_shader *sh, bool coherent) { if (sh->Program->sh.fs.BlendSupport == 0) return false; @@ -480,6 +480,7 @@ lower_blend_equation_advanced(struct gl_linked_shader *sh) fb->data.location = FRAG_RESULT_DATA0; fb->data.read_only = 1; fb->data.fb_fetch_output = 1; + fb->data.memory_coherent = coherent; fb->data.how_declared = ir_var_hidden; ir_variable *mode = new(mem_ctx) ir_variable(glsl_type::uint_type, |