From 8ea80395aa0b1300a64c1d99782f2ee120c8b73a Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Thu, 22 May 2025 18:01:25 +0200 Subject: [PATCH] radeonsi: allow sparse depth textures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák (cherry picked from commit 1cc52dff05b602e267477f068f89a42db9886214) Part-of: --- .pick_status.json | 2 +- src/amd/common/ac_surface.c | 3 ++- .../drivers/radeonsi/ci/gfx11-navi31-fail.csv | 13 ------------- src/gallium/drivers/radeonsi/si_texture.c | 6 ++---- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index bbe13836736..9cb27aab2e6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -26974,7 +26974,7 @@ "description": "radeonsi: allow sparse depth textures", "nominated": false, "nomination_type": 0, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index bb86ed72817..dc7cdb24c42 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -2574,7 +2574,8 @@ static int gfx9_compute_surface(struct ac_addrlib *addrlib, const struct radeon_ AddrSurfInfoIn.flags.opt4space = 1; /* For GFX10+ MSAA PRT surface won't use the prt flag because it's not supported. */ AddrSurfInfoIn.flags.prt = (surf->flags & RADEON_SURF_PRT) != 0 && - (config->info.samples <= 1 || info->gfx_level < GFX10); + (config->info.samples <= 1 || info->gfx_level < GFX10) && + is_color_surface; AddrSurfInfoIn.numMipLevels = config->info.levels; AddrSurfInfoIn.numSamples = MAX2(1, config->info.samples); diff --git a/src/gallium/drivers/radeonsi/ci/gfx11-navi31-fail.csv b/src/gallium/drivers/radeonsi/ci/gfx11-navi31-fail.csv index b5e8d2a2ed9..3cab0beaa5e 100644 --- a/src/gallium/drivers/radeonsi/ci/gfx11-navi31-fail.csv +++ b/src/gallium/drivers/radeonsi/ci/gfx11-navi31-fail.csv @@ -35,11 +35,6 @@ GTF-GL46.gtf21.GL2Tests.glGetUniform.glGetUniform,Fail KHR-GL46.shaders.uniform_block.random.nested_structs_instance_arrays.0,Fail -KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup_texture_2d_array_depth_component16,Fail -KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup_texture_2d_depth_component16,Fail -KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup_texture_cube_map_array_depth_component16,Fail -KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup_texture_cube_map_depth_component16,Fail -KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup_texture_rectangle_depth_component16,Fail # See Khronos issue 5587: the test expects one-dimensional (array) texture to work while # it's explicitely marked as non-supported by EXT_sparse_texture2. KHR-GL46.sparse_texture2_tests.StandardPageSizesTestCase_texture_1d_array_r11f_g11f_b10f,Fail @@ -434,14 +429,6 @@ KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor_texture_1d_rgb KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor_texture_1d_rgba8_snorm,Fail KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor_texture_1d_rgba8i,Fail KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor_texture_1d_rgba8ui,Fail -KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor_texture_2d_array_depth_component16,Fail -KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor_texture_2d_depth_component16,Fail -KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor_texture_cube_map_array_depth_component16,Fail -KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor_texture_cube_map_depth_component16,Fail -KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupResidency_texture_2d_array_depth_component16,Fail -KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupResidency_texture_2d_depth_component16,Fail -KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupResidency_texture_cube_map_array_depth_component16,Fail -KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupResidency_texture_cube_map_depth_component16,Fail KHR-GL46.transform_feedback_overflow_query_ARB.advanced-single-stream-interleaved-attribs,Fail KHR-GL46.transform_feedback_overflow_query_ARB.advanced-single-stream-separate-attribs,Fail KHR-GL46.transform_feedback_overflow_query_ARB.multiple-streams-multiple-buffers-per-stream,Fail diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 60e04f370cd..ab8a8833034 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1493,7 +1493,7 @@ bool si_texture_commit(struct si_context *ctx, struct si_resource *res, unsigned assert(ctx->gfx_level >= GFX9); - if (ctx->gfx_level >= GFX10 && samples > 1) { + if ((ctx->gfx_level >= GFX10 && samples > 1) || (surface->flags & RADEON_SURF_Z_OR_SBUFFER)) { uint64_t prev_offset = res->bo_size; for (int i = 0; i < box->depth; i++) { @@ -2480,9 +2480,7 @@ static int si_get_sparse_texture_virtual_page_size(struct pipe_screen *screen, return 0; /* Unsupported formats. */ - /* TODO: support these formats. */ - if (util_format_is_depth_or_stencil(format) || - util_format_get_num_planes(format) > 1 || + if (util_format_get_num_planes(format) > 1 || util_format_is_compressed(format)) return 0;