v3dv/formats: fix exposing FEATURE_UNIFORM/STORAGE_TEXEL_BUFFER_BIT

If the formats are not suitable as texture type, then they can't be
used as texel buffers.

Gets tests like the following one:
   dEQP-VK.image.load_store.without_format.buffer.r32g32b32_sfloat_minalign_uniform

to be properly skipped (instead of Crash on the simulator)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Alejandro Piñeiro
2020-08-02 02:23:16 +02:00
committed by Marge Bot
parent c68ed396b2
commit b7ca46762f
+5 -3
View File
@@ -475,9 +475,11 @@ buffer_format_features(VkFormat vk_format, const struct v3dv_format *v3dv_format
if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN &&
desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB &&
desc->is_array) {
flags |= VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT |
VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT |
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT;
flags |= VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT;
if (v3dv_format->tex_type != TEXTURE_DATA_FORMAT_NO) {
flags |= VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT |
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT;
}
} else if (vk_format == VK_FORMAT_A2B10G10R10_UNORM_PACK32) {
flags |= VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT |
VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT;