diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2020-11-09 10:10:10 +0100 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-11-09 19:23:41 +0000 |
commit | 23dbf7964b7df0bc10bdad03ea2ac99b2b2d48f5 (patch) | |
tree | ac4ea78b9253e28aff85c6d2654faf0f300204cf | |
parent | 956228da3a11a83d938c929415efb375ffc2ca1f (diff) |
panfrost: Force late pixel kill when depth/stencil is written from the FS
If we don't do that, pixels might be killed early thus preventing the
fragment shader from being called and updating the depth/stencil value.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7501>
-rw-r--r-- | .gitlab-ci/deqp-panfrost-g52-fails.txt | 29 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_assemble.c | 8 | ||||
-rw-r--r-- | src/panfrost/lib/pan_blit.c | 12 |
3 files changed, 18 insertions, 31 deletions
diff --git a/.gitlab-ci/deqp-panfrost-g52-fails.txt b/.gitlab-ci/deqp-panfrost-g52-fails.txt index 12b946dce78..affce53fe4c 100644 --- a/.gitlab-ci/deqp-panfrost-g52-fails.txt +++ b/.gitlab-ci/deqp-panfrost-g52-fails.txt @@ -1,5 +1,4 @@ dEQP-GLES2.functional.clipping.triangle_vertex.clip_three.clip_neg_x_neg_z_and_pos_x_pos_z_and_neg_x_neg_y_pos_z,Fail -dEQP-GLES2.functional.depth_stencil_clear.depth_stencil_masked,Fail dEQP-GLES2.functional.fbo.completeness.renderable.renderbuffer.color0.r16f,Fail dEQP-GLES2.functional.fbo.completeness.renderable.renderbuffer.color0.rg16f,Fail dEQP-GLES2.functional.fbo.completeness.renderable.renderbuffer.color0.rgba16f,Fail @@ -22,40 +21,12 @@ dEQP-GLES2.functional.fbo.render.color.blend_rbo_rgb565,Fail dEQP-GLES2.functional.fbo.render.color.blend_rbo_rgb565_depth_component16,Fail dEQP-GLES2.functional.fbo.render.color.blend_tex2d_rgb,Fail dEQP-GLES2.functional.fbo.render.color.blend_tex2d_rgb_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_rbo_rgb565_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_rbo_rgb565_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_rbo_rgb5_a1_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_rbo_rgb5_a1_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_rbo_rgba4_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_rbo_rgba4_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_tex2d_rgba_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_tex2d_rgba_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_tex2d_rgb_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.no_rebind_tex2d_rgb_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_rbo_rgb565_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_rbo_rgb565_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_rbo_rgb5_a1_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_rbo_rgb5_a1_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_rbo_rgba4_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_rbo_rgba4_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_tex2d_rgba_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_tex2d_rgba_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_tex2d_rgb_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_tex2d_rgb_stencil_index8,Fail dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565,Fail dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565_depth_component16,Fail dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb5_a1_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgba4_depth_component16,Fail dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb,Fail -dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgba_depth_component16,Fail dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb_depth_component16,Fail dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb_stencil_index8,Fail -dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgb565_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgb5_a1_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgba4_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.shared_depthbuffer.tex2d_rgba_depth_component16,Fail -dEQP-GLES2.functional.fbo.render.shared_depthbuffer.tex2d_rgb_depth_component16,Fail dEQP-GLES2.functional.fbo.render.texsubimage.between_render_tex2d_rgb,Fail dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_dst_alpha,Fail dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_dst_color,Fail diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index 876b14e2d18..6804a919b9b 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -79,7 +79,13 @@ pan_prepare_bifrost_props(struct panfrost_shader_state *state, case MESA_SHADER_FRAGMENT: pan_prepare(&state->properties, RENDERER_PROPERTIES); /* Early-Z set at draw-time */ - state->properties.bifrost.zs_update_operation = MALI_PIXEL_KILL_STRONG_EARLY; + if (state->writes_depth || state->writes_stencil) { + state->properties.bifrost.zs_update_operation = MALI_PIXEL_KILL_FORCE_LATE; + state->properties.bifrost.pixel_kill_operation = MALI_PIXEL_KILL_FORCE_LATE; + } else { + state->properties.bifrost.zs_update_operation = MALI_PIXEL_KILL_STRONG_EARLY; + state->properties.bifrost.pixel_kill_operation = MALI_PIXEL_KILL_FORCE_EARLY; + } state->properties.uniform_buffer_count = state->ubo_count; state->properties.bifrost.shader_modifies_coverage = state->can_discard; diff --git a/src/panfrost/lib/pan_blit.c b/src/panfrost/lib/pan_blit.c index 8d0a1612167..c16e4d6552e 100644 --- a/src/panfrost/lib/pan_blit.c +++ b/src/panfrost/lib/pan_blit.c @@ -597,7 +597,17 @@ bifrost_load_emit_rsd(struct pan_pool *pool, struct MALI_DRAW *draw, pan_pack(t.cpu, RENDERER_STATE, cfg) { panfrost_load_prepare_rsd(pool, &cfg, image, loc); - cfg.properties.bifrost.zs_update_operation = MALI_PIXEL_KILL_STRONG_EARLY; + if (loc >= FRAG_RESULT_DATA0) { + cfg.properties.bifrost.zs_update_operation = + MALI_PIXEL_KILL_STRONG_EARLY; + cfg.properties.bifrost.pixel_kill_operation = + MALI_PIXEL_KILL_FORCE_EARLY; + } else { + cfg.properties.bifrost.zs_update_operation = + MALI_PIXEL_KILL_FORCE_LATE; + cfg.properties.bifrost.pixel_kill_operation = + MALI_PIXEL_KILL_FORCE_LATE; + } cfg.properties.bifrost.allow_forward_pixel_to_kill = true; cfg.preload.fragment.coverage = true; } |