diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/anv_extensions.py | 1 | ||||
-rw-r--r-- | src/intel/vulkan/anv_formats.c | 3 | ||||
-rw-r--r-- | src/intel/vulkan/anv_image.c | 11 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 3 |
4 files changed, 16 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index 8468a72ab8d..c31d2cf870e 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -142,6 +142,7 @@ EXTENSIONS = [ Extension('VK_EXT_queue_family_foreign', 1, 'ANDROID'), Extension('VK_EXT_sampler_filter_minmax', 1, 'device->info.gen >= 9'), Extension('VK_EXT_scalar_block_layout', 1, True), + Extension('VK_EXT_separate_stencil_usage', 1, True), Extension('VK_EXT_shader_stencil_export', 1, 'device->info.gen >= 9'), Extension('VK_EXT_shader_viewport_index_layer', 1, True), Extension('VK_EXT_transform_feedback', 1, True), diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c index d46da754ba3..3f18553023c 100644 --- a/src/intel/vulkan/anv_formats.c +++ b/src/intel/vulkan/anv_formats.c @@ -1012,6 +1012,9 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties2( case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: external_info = (const void *) s; break; + case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT: + /* Ignore but don't warn */ + break; default: anv_debug_ignored_stype(s->sType); break; diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index f405aa8067f..231b0faa60a 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -338,7 +338,7 @@ make_surface(const struct anv_device *dev, if (dev->info.gen <= 7 && aspect == VK_IMAGE_ASPECT_STENCIL_BIT && - (image->usage & VK_IMAGE_USAGE_SAMPLED_BIT)) { + (image->stencil_usage & VK_IMAGE_USAGE_SAMPLED_BIT)) { needs_shadow = true; } @@ -599,6 +599,15 @@ anv_image_create(VkDevice _device, image->drm_format_mod = isl_mod_info ? isl_mod_info->modifier : DRM_FORMAT_MOD_INVALID; + if (image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT) { + image->stencil_usage = pCreateInfo->usage; + const VkImageStencilUsageCreateInfoEXT *stencil_usage_info = + vk_find_struct_const(pCreateInfo->pNext, + IMAGE_STENCIL_USAGE_CREATE_INFO_EXT); + if (stencil_usage_info) + image->stencil_usage = stencil_usage_info->stencilUsage; + } + /* In case of external format, We don't know format yet, * so skip the rest for now. */ diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 0cd66e0eadb..9e59d79de7a 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -2978,7 +2978,8 @@ struct anv_image { uint32_t array_size; uint32_t samples; /**< VkImageCreateInfo::samples */ uint32_t n_planes; - VkImageUsageFlags usage; /**< Superset of VkImageCreateInfo::usage. */ + VkImageUsageFlags usage; /**< VkImageCreateInfo::usage. */ + VkImageUsageFlags stencil_usage; VkImageCreateFlags create_flags; /* Flags used when creating image. */ VkImageTiling tiling; /** VkImageCreateInfo::tiling */ |