freedreno: Fix gmem invalidating the depth or stencil of packed d/s.

The gmem store stores both depth and stencil for z24s8.  So, if we're
doing a write (clear or draw) to one or the other of the channels, we need
the other one restored as well.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13649>
This commit is contained in:
Emma Anholt 2021-11-03 09:19:42 -07:00 committed by Marge Bot
parent 858424bd2e
commit 29093bc42d
3 changed files with 10 additions and 6 deletions

View file

@ -158,7 +158,6 @@ KHR-GLES3.copy_tex_image_conversions.required.texture3d_texture2d,Fail
KHR-GLES3.packed_depth_stencil.blit.depth24_stencil8,Fail
KHR-GLES3.packed_depth_stencil.blit.depth32f_stencil8,Fail
KHR-GLES3.packed_depth_stencil.verify_read_pixels.depth24_stencil8,Fail
# "Non-integer comparison: 1, 0, 18, 1e-05: 0.142857 == 0: not equal.
# Copy stage: Gradient comparison failed during ReadPixels for input = [GL_RG, GL_FLOAT] output = [GL_RED, GL_FLOAT]"

View file

@ -1,8 +1,6 @@
# New in VK-GL-CTS 1.2.7.0
KHR-GL33.cull_distance.coverage,Fail
KHR-GL33.packed_depth_stencil.verify_get_tex_image.depth24_stencil8,Fail
KHR-GL33.packed_depth_stencil.verify_read_pixels.depth24_stencil8,Fail
KHR-GL33.transform_feedback.capture_vertex_interleaved_test,Fail
KHR-GL33.transform_feedback.capture_vertex_separate_test,Fail
KHR-GL33.transform_feedback.discard_vertex_test,Fail
@ -11,9 +9,6 @@ KHR-GL33.transform_feedback.draw_xfb_stream_instanced_test,Crash
KHR-GL33.transform_feedback.query_vertex_interleaved_test,Fail
KHR-GL33.transform_feedback.query_vertex_separate_test,Fail
# "*** Color comparison failed"
KHR-GLES3.packed_depth_stencil.verify_read_pixels.depth24_stencil8,Fail
# Lots of errors like "[279] Check failed. Received: [3,0,0,2] instead of: [5,0,0,2]"
KHR-GLES31.core.geometry_shader.layered_framebuffer.depth_support,Fail

View file

@ -69,6 +69,11 @@ batch_draw_tracking_for_dirty_bits(struct fd_batch *batch) assert_dt
if (fd_depth_enabled(ctx)) {
if (fd_resource(pfb->zsbuf->texture)->valid) {
restore_buffers |= FD_BUFFER_DEPTH;
/* storing packed d/s depth also stores stencil, so we need
* the stencil restored too to avoid invalidating it.
*/
if (pfb->zsbuf->texture->format == PIPE_FORMAT_Z24_UNORM_S8_UINT)
restore_buffers |= FD_BUFFER_STENCIL;
} else {
batch->invalidated |= FD_BUFFER_DEPTH;
}
@ -84,6 +89,11 @@ batch_draw_tracking_for_dirty_bits(struct fd_batch *batch) assert_dt
if (fd_stencil_enabled(ctx)) {
if (fd_resource(pfb->zsbuf->texture)->valid) {
restore_buffers |= FD_BUFFER_STENCIL;
/* storing packed d/s stencil also stores depth, so we need
* the depth restored too to avoid invalidating it.
*/
if (pfb->zsbuf->texture->format == PIPE_FORMAT_Z24_UNORM_S8_UINT)
restore_buffers |= FD_BUFFER_DEPTH;
} else {
batch->invalidated |= FD_BUFFER_STENCIL;
}