diff options
author | Jason Ekstrand <[email protected]> | 2019-06-19 15:18:06 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-06-19 22:21:46 +0000 |
commit | ef323d02d8711febdccaeafc7596c9ffdf7a3dda (patch) | |
tree | a1573a71b609a1930f75cd3abb7f17adc16e5817 /src/intel/vulkan/anv_image.c | |
parent | 215f9f83f53c5a374c32424378c640ce8181e542 (diff) |
anv/image: Set different usage flags for shadow surfaces
For the block BLOCK_TEXEL_VIEW_COMPATIBLE case, this didn't matter
because the flags were already more-or-less what we wanted. However,
for gen7 stencil shadow images, it still had ISL_SURF_USAGE_STENCIL_BIT
so we were getting W-tiled which isn't what we want for the shadow. By
passing just ISL_SURF_USAGE_TEXTURE_BIT (and CUBE if we care), we now
get something that's actually texturable.
Fixes: f3ea0cf828 "anv: Add stencil texturing support for gen7"
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r-- | src/intel/vulkan/anv_image.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 231b0faa60a..dcb570238ba 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -328,18 +328,23 @@ make_surface(const struct anv_device *dev, * just use RENDER_SURFACE_STATE::X/Y Offset. */ bool needs_shadow = false; + isl_surf_usage_flags_t shadow_usage = 0; if (dev->info.gen <= 8 && (image->create_flags & VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT) && image->tiling == VK_IMAGE_TILING_OPTIMAL) { assert(isl_format_is_compressed(plane_format.isl_format)); tiling_flags = ISL_TILING_LINEAR_BIT; needs_shadow = true; + shadow_usage = ISL_SURF_USAGE_TEXTURE_BIT | + (usage & ISL_SURF_USAGE_CUBE_BIT); } if (dev->info.gen <= 7 && aspect == VK_IMAGE_ASPECT_STENCIL_BIT && (image->stencil_usage & VK_IMAGE_USAGE_SAMPLED_BIT)) { needs_shadow = true; + shadow_usage = ISL_SURF_USAGE_TEXTURE_BIT | + (usage & ISL_SURF_USAGE_CUBE_BIT); } ok = isl_surf_init(&dev->isl_dev, &anv_surf->isl, @@ -381,7 +386,7 @@ make_surface(const struct anv_device *dev, .samples = image->samples, .min_alignment_B = 0, .row_pitch_B = stride, - .usage = usage, + .usage = shadow_usage, .tiling_flags = ISL_TILING_ANY_MASK); /* isl_surf_init() will fail only if provided invalid input. Invalid input |