AddrSurfInfoIn.flags.matchStencilTileCfg = 1;
/* Keep the depth mip-tail compatible with texturing. */
- if (config->info.levels > 1)
+ if (config->info.levels > 1 && !(surf->flags & RADEON_SURF_NO_STENCIL_ADJUST))
AddrSurfInfoIn.flags.noStencil = 1;
}
* used as transfer resource. This flag indicates not to set flags.texture flag in
* gfx9_compute_surface(). */
#define RADEON_SURF_NO_TEXTURE (1ull << 34)
+#define RADEON_SURF_NO_STENCIL_ADJUST (1ull << 35)
struct legacy_surf_level {
uint32_t offset_256B; /* divided by 256, the hw can only do 40-bit addresses */
if (is_depth) {
flags |= RADEON_SURF_ZBUFFER;
- if (is_depth && is_stencil &&
- !(pCreateInfo->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) &&
- device->physical_device->rad_info.gfx_level <= GFX8)
- flags |= RADEON_SURF_NO_RENDER_TARGET;
+ if (is_depth && is_stencil && device->physical_device->rad_info.gfx_level <= GFX8) {
+ if (!(pCreateInfo->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT))
+ flags |= RADEON_SURF_NO_RENDER_TARGET;
+
+ /* RADV doesn't support stencil pitch adjustment. As a result there are some spec gaps that
+ * are not covered by CTS.
+ *
+ * For D+S images with pitch constraints due to rendertarget usage it can happen that
+ * sampling from mipmaps beyond the base level of the descriptor is broken as the pitch
+ * adjustment can't be applied to anything beyond the first level.
+ */
+ flags |= RADEON_SURF_NO_STENCIL_ADJUST;
+ }
if (radv_use_htile_for_image(device, image) &&
!(device->instance->debug_flags & RADV_DEBUG_NO_HIZ) &&