<div dir="ltr"><div>Much better. Thanks!<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 12, 2016 at 5:00 PM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:llandwerlin@gmail.com" target="_blank">llandwerlin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">We let the user believe we support some transfer formats which we don't.<br>
This can lead to crashes when actually trying to use those formats for<br>
example on dEQP-VK.api.copy_and_blit.<wbr>image_to_image.* tests.<br>
<br>
Let all formats we can render to or sample from as meta implements transfers<br>
using attachments.<br>
<br>
Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
---<br>
</span> src/intel/vulkan/anv_formats.c | 22 ++++++----------------<br>
1 file changed, 6 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>formats.c b/src/intel/vulkan/anv_<wbr>formats.c<br>
index b26e48a..b06e29b 100644<br>
--- a/src/intel/vulkan/anv_<wbr>formats.c<br>
+++ b/src/intel/vulkan/anv_<wbr>formats.c<br>
@@ -507,25 +507,15 @@ VkResult anv_<wbr>GetPhysicalDeviceImageFormatPr<wbr>operties(<br>
sampleCounts = isl_device_get_sample_counts(&<wbr>physical_device->isl_dev);<br>
}<br>
<br>
- if (usage & VK_IMAGE_USAGE_TRANSFER_SRC_<wbr>BIT) {<br>
- /* Meta implements transfers by sampling from the source image. */<br>
<span class="">- if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_<wbr>IMAGE_BIT)) {<br>
</span>- goto unsupported;<br>
- }<br>
- }<br>
-<br>
-#if 0<br>
- if (usage & VK_IMAGE_USAGE_TRANSFER_DST_<wbr>BIT) {<br>
<span class="">- if (anv_format_for_vk_format(<wbr>format)->has_stencil) {<br>
- /* Not yet implemented because copying to a W-tiled surface is crazy<br>
- * hard.<br>
- */<br>
- anv_finishme("support VK_IMAGE_USAGE_TRANSFER_DST_<wbr>BIT for "<br>
- "stencil format");<br>
</span>+ if (usage & (VK_IMAGE_USAGE_TRANSFER_SRC_<wbr>BIT |<br>
+ VK_IMAGE_USAGE_TRANSFER_DST_<wbr>BIT)) {<br>
+ /* Accept transfers on anything we can sample from or renderer to. */<br>
<span class="im HOEnZb">+ if (!(format_feature_flags & (VK_FORMAT_FEATURE_COLOR_<wbr>ATTACHMENT_BIT |<br>
+ VK_FORMAT_FEATURE_DEPTH_<wbr>STENCIL_ATTACHMENT_BIT |<br>
+ VK_FORMAT_FEATURE_SAMPLED_<wbr>IMAGE_BIT))) {<br>
</span><div class="HOEnZb"><div class="h5"> goto unsupported;<br>
}<br>
}<br>
-#endif<br>
<br>
if (usage & VK_IMAGE_USAGE_SAMPLED_BIT) {<br>
if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_<wbr>IMAGE_BIT)) {<br>
--<br>
2.8.1<br>
<br>
</div></div></blockquote></div><br></div>