summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_formats.c
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2016-08-13 01:00:57 +0100
committerJason Ekstrand <jason.ekstrand@intel.com>2016-08-22 10:41:30 -0700
commit475ce61d1aa0fb06202511b4ea8ad9bd1fab64d0 (patch)
treed94b701376350a1e76b1e8a745cf7b0bfa9f3c73 /src/intel/vulkan/anv_formats.c
parent0328b20050ef4dba45ae7b03f00dc9112f5ee1ee (diff)
downloadexternal_mesa3d-475ce61d1aa0fb06202511b4ea8ad9bd1fab64d0.zip
external_mesa3d-475ce61d1aa0fb06202511b4ea8ad9bd1fab64d0.tar.gz
external_mesa3d-475ce61d1aa0fb06202511b4ea8ad9bd1fab64d0.tar.bz2
anv: GetDeviceImageFormatProperties: fix TRANSFER formats
We let the user believe we support some transfer formats which we don't. This can lead to crashes when actually trying to use those formats for example on dEQP-VK.api.copy_and_blit.image_to_image.* tests. Let all formats we can render to or sample from as meta implements transfers using attachments. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/intel/vulkan/anv_formats.c')
-rw-r--r--src/intel/vulkan/anv_formats.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index b26e48a..b06e29b 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -507,25 +507,15 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
sampleCounts = isl_device_get_sample_counts(&physical_device->isl_dev);
}
- if (usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
- /* Meta implements transfers by sampling from the source image. */
- if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) {
- goto unsupported;
- }
- }
-
-#if 0
- if (usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
- if (anv_format_for_vk_format(format)->has_stencil) {
- /* Not yet implemented because copying to a W-tiled surface is crazy
- * hard.
- */
- anv_finishme("support VK_IMAGE_USAGE_TRANSFER_DST_BIT for "
- "stencil format");
+ if (usage & (VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT)) {
+ /* Accept transfers on anything we can sample from or renderer to. */
+ if (!(format_feature_flags & (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
+ VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT |
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT))) {
goto unsupported;
}
}
-#endif
if (usage & VK_IMAGE_USAGE_SAMPLED_BIT) {
if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) {