From b106752782d1ddd832ab465d544970a84a2dea89 Mon Sep 17 00:00:00 2001 From: Oskar Rundgren Date: Fri, 5 May 2023 10:16:41 +0100 Subject: pvr: Add back S8_UINT support Revert "pvr: Don't advertise S8_UINT support" Adding back support for S8_UINT format. It's used in many deqp tests. Example: dEQP-VK.api.copy_and_blit.core.image_to_image.all_formats .depth_stencil.2d.d24_unorm_s8_uint_d24_unorm_s8_uint.optimal_optimal This reverts commit ff07610462d5100a1ade101c1960beb4a454e7ce. Signed-off-by: Oskar Rundgren Reviewed-by: Frank Binns Part-of: --- src/imagination/vulkan/pvr_formats.c | 2 ++ src/imagination/vulkan/pvr_job_render.c | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/imagination/vulkan/pvr_formats.c b/src/imagination/vulkan/pvr_formats.c index a977c11c36f..76c7a160362 100644 --- a/src/imagination/vulkan/pvr_formats.c +++ b/src/imagination/vulkan/pvr_formats.c @@ -200,6 +200,8 @@ static const struct pvr_format pvr_format_table[] = { FORMAT_DEPTH_STENCIL(D16_UNORM, U16, U16, INVALID), /* VK_FORMAT_D32_SFLOAT = 126. */ FORMAT_DEPTH_STENCIL(D32_SFLOAT, F32, F32, INVALID), + /* VK_FORMAT_S8_UINT = 127. */ + FORMAT_DEPTH_STENCIL(S8_UINT, U8, INVALID, U8), /* VK_FORMAT_D24_UNORM_S8_UINT = 129. */ FORMAT_DEPTH_STENCIL(D24_UNORM_S8_UINT, ST8U24, X8U24, U8X24), /* VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147. */ diff --git a/src/imagination/vulkan/pvr_job_render.c b/src/imagination/vulkan/pvr_job_render.c index d3301678522..34cd261b632 100644 --- a/src/imagination/vulkan/pvr_job_render.c +++ b/src/imagination/vulkan/pvr_job_render.c @@ -1445,11 +1445,12 @@ static void pvr_frag_state_stream_init(struct pvr_render_ctx *ctx, if (job->has_stencil_attachment) { value.addr = job->ds.addr; - /* This should be set if we only have a stencil attachment; all - * currently supported formats with a stencil component also contain - * depth. + /* Enable separate stencil. This should be enabled iff the buffer set + * in CR_ISP_STENCIL_LOAD_BASE does not contain a depth component. */ - value.enable = false; + assert(job->has_depth_attachment || + job->ds.vk_format == VK_FORMAT_S8_UINT); + value.enable = !job->has_depth_attachment; } } stream_ptr += pvr_cmd_length(CR_ISP_STENCIL_LOAD_BASE); -- cgit v1.2.1