2 * Copyright © 2016 Red Hat.
3 * Copyright © 2016 Bas Nieuwenhuizen
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 #include "radv_private.h"
27 #include "vk_format.h"
29 #include "r600d_common.h"
31 #include "util/u_half.h"
32 #include "util/format_srgb.h"
33 #include "util/format_r11g11b10f.h"
35 uint32_t radv_translate_buffer_dataformat(const struct vk_format_description
*desc
,
41 if (desc
->format
== VK_FORMAT_B10G11R11_UFLOAT_PACK32
)
42 return V_008F0C_BUF_DATA_FORMAT_10_11_11
;
44 if (first_non_void
< 0)
45 return V_008F0C_BUF_DATA_FORMAT_INVALID
;
46 type
= desc
->channel
[first_non_void
].type
;
48 if (type
== VK_FORMAT_TYPE_FIXED
)
49 return V_008F0C_BUF_DATA_FORMAT_INVALID
;
50 if (desc
->nr_channels
== 4 &&
51 desc
->channel
[0].size
== 10 &&
52 desc
->channel
[1].size
== 10 &&
53 desc
->channel
[2].size
== 10 &&
54 desc
->channel
[3].size
== 2)
55 return V_008F0C_BUF_DATA_FORMAT_2_10_10_10
;
57 /* See whether the components are of the same size. */
58 for (i
= 0; i
< desc
->nr_channels
; i
++) {
59 if (desc
->channel
[first_non_void
].size
!= desc
->channel
[i
].size
)
60 return V_008F0C_BUF_DATA_FORMAT_INVALID
;
63 switch (desc
->channel
[first_non_void
].size
) {
65 switch (desc
->nr_channels
) {
67 return V_008F0C_BUF_DATA_FORMAT_8
;
69 return V_008F0C_BUF_DATA_FORMAT_8_8
;
71 return V_008F0C_BUF_DATA_FORMAT_8_8_8_8
;
75 switch (desc
->nr_channels
) {
77 return V_008F0C_BUF_DATA_FORMAT_16
;
79 return V_008F0C_BUF_DATA_FORMAT_16_16
;
81 return V_008F0C_BUF_DATA_FORMAT_16_16_16_16
;
85 /* From the Southern Islands ISA documentation about MTBUF:
86 * 'Memory reads of data in memory that is 32 or 64 bits do not
87 * undergo any format conversion.'
89 if (type
!= VK_FORMAT_TYPE_FLOAT
&&
90 !desc
->channel
[first_non_void
].pure_integer
)
91 return V_008F0C_BUF_DATA_FORMAT_INVALID
;
93 switch (desc
->nr_channels
) {
95 return V_008F0C_BUF_DATA_FORMAT_32
;
97 return V_008F0C_BUF_DATA_FORMAT_32_32
;
99 return V_008F0C_BUF_DATA_FORMAT_32_32_32
;
101 return V_008F0C_BUF_DATA_FORMAT_32_32_32_32
;
106 return V_008F0C_BUF_DATA_FORMAT_INVALID
;
109 uint32_t radv_translate_buffer_numformat(const struct vk_format_description
*desc
,
112 if (desc
->format
== VK_FORMAT_B10G11R11_UFLOAT_PACK32
)
113 return V_008F0C_BUF_NUM_FORMAT_FLOAT
;
115 if (first_non_void
< 0)
118 switch (desc
->channel
[first_non_void
].type
) {
119 case VK_FORMAT_TYPE_SIGNED
:
120 if (desc
->channel
[first_non_void
].normalized
)
121 return V_008F0C_BUF_NUM_FORMAT_SNORM
;
122 else if (desc
->channel
[first_non_void
].pure_integer
)
123 return V_008F0C_BUF_NUM_FORMAT_SINT
;
125 return V_008F0C_BUF_NUM_FORMAT_SSCALED
;
127 case VK_FORMAT_TYPE_UNSIGNED
:
128 if (desc
->channel
[first_non_void
].normalized
)
129 return V_008F0C_BUF_NUM_FORMAT_UNORM
;
130 else if (desc
->channel
[first_non_void
].pure_integer
)
131 return V_008F0C_BUF_NUM_FORMAT_UINT
;
133 return V_008F0C_BUF_NUM_FORMAT_USCALED
;
135 case VK_FORMAT_TYPE_FLOAT
:
137 return V_008F0C_BUF_NUM_FORMAT_FLOAT
;
141 uint32_t radv_translate_tex_dataformat(VkFormat format
,
142 const struct vk_format_description
*desc
,
150 /* Colorspace (return non-RGB formats directly). */
151 switch (desc
->colorspace
) {
152 /* Depth stencil formats */
153 case VK_FORMAT_COLORSPACE_ZS
:
155 case VK_FORMAT_D16_UNORM
:
156 return V_008F14_IMG_DATA_FORMAT_16
;
157 case VK_FORMAT_D24_UNORM_S8_UINT
:
158 case VK_FORMAT_X8_D24_UNORM_PACK32
:
159 return V_008F14_IMG_DATA_FORMAT_8_24
;
160 case VK_FORMAT_S8_UINT
:
161 return V_008F14_IMG_DATA_FORMAT_8
;
162 case VK_FORMAT_D32_SFLOAT
:
163 return V_008F14_IMG_DATA_FORMAT_32
;
164 case VK_FORMAT_D32_SFLOAT_S8_UINT
:
165 return V_008F14_IMG_DATA_FORMAT_X24_8_32
;
170 case VK_FORMAT_COLORSPACE_YUV
:
171 goto out_unknown
; /* TODO */
173 case VK_FORMAT_COLORSPACE_SRGB
:
174 if (desc
->nr_channels
!= 4 && desc
->nr_channels
!= 1)
182 if (desc
->layout
== VK_FORMAT_LAYOUT_RGTC
) {
184 case VK_FORMAT_BC4_UNORM_BLOCK
:
185 case VK_FORMAT_BC4_SNORM_BLOCK
:
186 return V_008F14_IMG_DATA_FORMAT_BC4
;
187 case VK_FORMAT_BC5_UNORM_BLOCK
:
188 case VK_FORMAT_BC5_SNORM_BLOCK
:
189 return V_008F14_IMG_DATA_FORMAT_BC5
;
195 if (desc
->layout
== VK_FORMAT_LAYOUT_S3TC
) {
197 case VK_FORMAT_BC1_RGB_UNORM_BLOCK
:
198 case VK_FORMAT_BC1_RGB_SRGB_BLOCK
:
199 case VK_FORMAT_BC1_RGBA_UNORM_BLOCK
:
200 case VK_FORMAT_BC1_RGBA_SRGB_BLOCK
:
201 return V_008F14_IMG_DATA_FORMAT_BC1
;
202 case VK_FORMAT_BC2_UNORM_BLOCK
:
203 case VK_FORMAT_BC2_SRGB_BLOCK
:
204 return V_008F14_IMG_DATA_FORMAT_BC2
;
205 case VK_FORMAT_BC3_UNORM_BLOCK
:
206 case VK_FORMAT_BC3_SRGB_BLOCK
:
207 return V_008F14_IMG_DATA_FORMAT_BC3
;
213 if (desc
->layout
== VK_FORMAT_LAYOUT_BPTC
) {
215 case VK_FORMAT_BC6H_UFLOAT_BLOCK
:
216 case VK_FORMAT_BC6H_SFLOAT_BLOCK
:
217 return V_008F14_IMG_DATA_FORMAT_BC6
;
218 case VK_FORMAT_BC7_UNORM_BLOCK
:
219 case VK_FORMAT_BC7_SRGB_BLOCK
:
220 return V_008F14_IMG_DATA_FORMAT_BC7
;
226 if (format
== VK_FORMAT_E5B9G9R9_UFLOAT_PACK32
) {
227 return V_008F14_IMG_DATA_FORMAT_5_9_9_9
;
228 } else if (format
== VK_FORMAT_B10G11R11_UFLOAT_PACK32
) {
229 return V_008F14_IMG_DATA_FORMAT_10_11_11
;
232 /* R8G8Bx_SNORM - TODO CxV8U8 */
234 /* hw cannot support mixed formats (except depth/stencil, since only
236 if (desc
->is_mixed
&& desc
->colorspace
!= VK_FORMAT_COLORSPACE_ZS
)
239 /* See whether the components are of the same size. */
240 for (i
= 1; i
< desc
->nr_channels
; i
++) {
241 uniform
= uniform
&& desc
->channel
[0].size
== desc
->channel
[i
].size
;
244 /* Non-uniform formats. */
246 switch(desc
->nr_channels
) {
248 if (desc
->channel
[0].size
== 5 &&
249 desc
->channel
[1].size
== 6 &&
250 desc
->channel
[2].size
== 5) {
251 return V_008F14_IMG_DATA_FORMAT_5_6_5
;
255 if (desc
->channel
[0].size
== 5 &&
256 desc
->channel
[1].size
== 5 &&
257 desc
->channel
[2].size
== 5 &&
258 desc
->channel
[3].size
== 1) {
259 return V_008F14_IMG_DATA_FORMAT_1_5_5_5
;
261 if (desc
->channel
[0].size
== 1 &&
262 desc
->channel
[1].size
== 5 &&
263 desc
->channel
[2].size
== 5 &&
264 desc
->channel
[3].size
== 5) {
265 return V_008F14_IMG_DATA_FORMAT_5_5_5_1
;
267 if (desc
->channel
[0].size
== 10 &&
268 desc
->channel
[1].size
== 10 &&
269 desc
->channel
[2].size
== 10 &&
270 desc
->channel
[3].size
== 2) {
271 /* Closed VK driver does this also no 2/10/10/10 snorm */
272 if (desc
->channel
[0].type
== VK_FORMAT_TYPE_SIGNED
&&
273 desc
->channel
[0].normalized
)
275 return V_008F14_IMG_DATA_FORMAT_2_10_10_10
;
282 if (first_non_void
< 0 || first_non_void
> 3)
285 /* uniform formats */
286 switch (desc
->channel
[first_non_void
].size
) {
288 switch (desc
->nr_channels
) {
289 #if 0 /* Not supported for render targets */
291 return V_008F14_IMG_DATA_FORMAT_4_4
;
294 return V_008F14_IMG_DATA_FORMAT_4_4_4_4
;
298 switch (desc
->nr_channels
) {
300 return V_008F14_IMG_DATA_FORMAT_8
;
302 return V_008F14_IMG_DATA_FORMAT_8_8
;
304 return V_008F14_IMG_DATA_FORMAT_8_8_8_8
;
308 switch (desc
->nr_channels
) {
310 return V_008F14_IMG_DATA_FORMAT_16
;
312 return V_008F14_IMG_DATA_FORMAT_16_16
;
314 return V_008F14_IMG_DATA_FORMAT_16_16_16_16
;
318 switch (desc
->nr_channels
) {
320 return V_008F14_IMG_DATA_FORMAT_32
;
322 return V_008F14_IMG_DATA_FORMAT_32_32
;
323 #if 0 /* Not supported for render targets */
325 return V_008F14_IMG_DATA_FORMAT_32_32_32
;
328 return V_008F14_IMG_DATA_FORMAT_32_32_32_32
;
333 /* R600_ERR("Unable to handle texformat %d %s\n", format, vk_format_name(format)); */
337 uint32_t radv_translate_tex_numformat(VkFormat format
,
338 const struct vk_format_description
*desc
,
342 case VK_FORMAT_D24_UNORM_S8_UINT
:
343 return V_008F14_IMG_NUM_FORMAT_UNORM
;
345 if (first_non_void
< 0) {
346 if (vk_format_is_compressed(format
)) {
348 case VK_FORMAT_BC1_RGB_SRGB_BLOCK
:
349 case VK_FORMAT_BC1_RGBA_SRGB_BLOCK
:
350 case VK_FORMAT_BC2_SRGB_BLOCK
:
351 case VK_FORMAT_BC3_SRGB_BLOCK
:
352 case VK_FORMAT_BC7_SRGB_BLOCK
:
353 return V_008F14_IMG_NUM_FORMAT_SRGB
;
354 case VK_FORMAT_BC4_SNORM_BLOCK
:
355 case VK_FORMAT_BC5_SNORM_BLOCK
:
356 case VK_FORMAT_BC6H_SFLOAT_BLOCK
:
357 return V_008F14_IMG_NUM_FORMAT_SNORM
;
359 return V_008F14_IMG_NUM_FORMAT_UNORM
;
361 } else if (desc
->layout
== VK_FORMAT_LAYOUT_SUBSAMPLED
) {
362 return V_008F14_IMG_NUM_FORMAT_UNORM
;
364 return V_008F14_IMG_NUM_FORMAT_FLOAT
;
366 } else if (desc
->colorspace
== VK_FORMAT_COLORSPACE_SRGB
) {
367 return V_008F14_IMG_NUM_FORMAT_SRGB
;
369 switch (desc
->channel
[first_non_void
].type
) {
370 case VK_FORMAT_TYPE_FLOAT
:
371 return V_008F14_IMG_NUM_FORMAT_FLOAT
;
372 case VK_FORMAT_TYPE_SIGNED
:
373 if (desc
->channel
[first_non_void
].normalized
)
374 return V_008F14_IMG_NUM_FORMAT_SNORM
;
375 else if (desc
->channel
[first_non_void
].pure_integer
)
376 return V_008F14_IMG_NUM_FORMAT_SINT
;
378 return V_008F14_IMG_NUM_FORMAT_SSCALED
;
379 case VK_FORMAT_TYPE_UNSIGNED
:
380 if (desc
->channel
[first_non_void
].normalized
)
381 return V_008F14_IMG_NUM_FORMAT_UNORM
;
382 else if (desc
->channel
[first_non_void
].pure_integer
)
383 return V_008F14_IMG_NUM_FORMAT_UINT
;
385 return V_008F14_IMG_NUM_FORMAT_USCALED
;
387 return V_008F14_IMG_NUM_FORMAT_UNORM
;
393 uint32_t radv_translate_color_numformat(VkFormat format
,
394 const struct vk_format_description
*desc
,
398 if (first_non_void
== -1 || desc
->channel
[first_non_void
].type
== VK_FORMAT_TYPE_FLOAT
)
399 ntype
= V_028C70_NUMBER_FLOAT
;
401 ntype
= V_028C70_NUMBER_UNORM
;
402 if (desc
->colorspace
== VK_FORMAT_COLORSPACE_SRGB
)
403 ntype
= V_028C70_NUMBER_SRGB
;
404 else if (desc
->channel
[first_non_void
].type
== VK_FORMAT_TYPE_SIGNED
) {
405 if (desc
->channel
[first_non_void
].pure_integer
) {
406 ntype
= V_028C70_NUMBER_SINT
;
407 } else if (desc
->channel
[first_non_void
].normalized
) {
408 ntype
= V_028C70_NUMBER_SNORM
;
411 } else if (desc
->channel
[first_non_void
].type
== VK_FORMAT_TYPE_UNSIGNED
) {
412 if (desc
->channel
[first_non_void
].pure_integer
) {
413 ntype
= V_028C70_NUMBER_UINT
;
414 } else if (desc
->channel
[first_non_void
].normalized
) {
415 ntype
= V_028C70_NUMBER_UNORM
;
423 static bool radv_is_sampler_format_supported(VkFormat format
, bool *linear_sampling
)
425 const struct vk_format_description
*desc
= vk_format_description(format
);
427 if (!desc
|| format
== VK_FORMAT_UNDEFINED
)
429 num_format
= radv_translate_tex_numformat(format
, desc
,
430 vk_format_get_first_non_void_channel(format
));
432 if (num_format
== V_008F14_IMG_NUM_FORMAT_USCALED
||
433 num_format
== V_008F14_IMG_NUM_FORMAT_SSCALED
)
436 if (num_format
== V_008F14_IMG_NUM_FORMAT_UNORM
||
437 num_format
== V_008F14_IMG_NUM_FORMAT_SNORM
||
438 num_format
== V_008F14_IMG_NUM_FORMAT_FLOAT
||
439 num_format
== V_008F14_IMG_NUM_FORMAT_SRGB
)
440 *linear_sampling
= true;
442 *linear_sampling
= false;
443 return radv_translate_tex_dataformat(format
, vk_format_description(format
),
444 vk_format_get_first_non_void_channel(format
)) != ~0U;
448 static bool radv_is_storage_image_format_supported(struct radv_physical_device
*physical_device
,
451 const struct vk_format_description
*desc
= vk_format_description(format
);
452 unsigned data_format
, num_format
;
453 if (!desc
|| format
== VK_FORMAT_UNDEFINED
)
456 data_format
= radv_translate_tex_dataformat(format
, desc
,
457 vk_format_get_first_non_void_channel(format
));
458 num_format
= radv_translate_tex_numformat(format
, desc
,
459 vk_format_get_first_non_void_channel(format
));
461 if(data_format
== ~0 || num_format
== ~0)
464 /* Extracted from the GCN3 ISA document. */
466 case V_008F14_IMG_NUM_FORMAT_UNORM
:
467 case V_008F14_IMG_NUM_FORMAT_SNORM
:
468 case V_008F14_IMG_NUM_FORMAT_UINT
:
469 case V_008F14_IMG_NUM_FORMAT_SINT
:
470 case V_008F14_IMG_NUM_FORMAT_FLOAT
:
476 switch(data_format
) {
477 case V_008F14_IMG_DATA_FORMAT_8
:
478 case V_008F14_IMG_DATA_FORMAT_16
:
479 case V_008F14_IMG_DATA_FORMAT_8_8
:
480 case V_008F14_IMG_DATA_FORMAT_32
:
481 case V_008F14_IMG_DATA_FORMAT_16_16
:
482 case V_008F14_IMG_DATA_FORMAT_10_11_11
:
483 case V_008F14_IMG_DATA_FORMAT_11_11_10
:
484 case V_008F14_IMG_DATA_FORMAT_10_10_10_2
:
485 case V_008F14_IMG_DATA_FORMAT_2_10_10_10
:
486 case V_008F14_IMG_DATA_FORMAT_8_8_8_8
:
487 case V_008F14_IMG_DATA_FORMAT_32_32
:
488 case V_008F14_IMG_DATA_FORMAT_16_16_16_16
:
489 case V_008F14_IMG_DATA_FORMAT_32_32_32_32
:
490 case V_008F14_IMG_DATA_FORMAT_5_6_5
:
491 case V_008F14_IMG_DATA_FORMAT_1_5_5_5
:
492 case V_008F14_IMG_DATA_FORMAT_5_5_5_1
:
493 case V_008F14_IMG_DATA_FORMAT_4_4_4_4
:
494 /* TODO: FMASK formats. */
501 static bool radv_is_buffer_format_supported(VkFormat format
, bool *scaled
)
503 const struct vk_format_description
*desc
= vk_format_description(format
);
504 unsigned data_format
, num_format
;
505 if (!desc
|| format
== VK_FORMAT_UNDEFINED
)
508 data_format
= radv_translate_buffer_dataformat(desc
,
509 vk_format_get_first_non_void_channel(format
));
510 num_format
= radv_translate_buffer_numformat(desc
,
511 vk_format_get_first_non_void_channel(format
));
513 *scaled
= (num_format
== V_008F0C_BUF_NUM_FORMAT_SSCALED
) || (num_format
== V_008F0C_BUF_NUM_FORMAT_USCALED
);
514 return data_format
!= V_008F0C_BUF_DATA_FORMAT_INVALID
&&
518 bool radv_is_colorbuffer_format_supported(VkFormat format
, bool *blendable
)
520 const struct vk_format_description
*desc
= vk_format_description(format
);
521 uint32_t color_format
= radv_translate_colorformat(format
);
522 uint32_t color_swap
= radv_translate_colorswap(format
, false);
523 uint32_t color_num_format
= radv_translate_color_numformat(format
,
525 vk_format_get_first_non_void_channel(format
));
527 if (color_num_format
== V_028C70_NUMBER_UINT
|| color_num_format
== V_028C70_NUMBER_SINT
||
528 color_format
== V_028C70_COLOR_8_24
|| color_format
== V_028C70_COLOR_24_8
||
529 color_format
== V_028C70_COLOR_X24_8_32_FLOAT
) {
533 return color_format
!= V_028C70_COLOR_INVALID
&&
535 color_num_format
!= ~0;
538 static bool radv_is_zs_format_supported(VkFormat format
)
540 return radv_translate_dbformat(format
) != V_028040_Z_INVALID
|| format
== VK_FORMAT_S8_UINT
;
544 radv_physical_device_get_format_properties(struct radv_physical_device
*physical_device
,
546 VkFormatProperties
*out_properties
)
548 VkFormatFeatureFlags linear
= 0, tiled
= 0, buffer
= 0;
549 const struct vk_format_description
*desc
= vk_format_description(format
);
553 out_properties
->linearTilingFeatures
= linear
;
554 out_properties
->optimalTilingFeatures
= tiled
;
555 out_properties
->bufferFeatures
= buffer
;
559 if (radv_is_storage_image_format_supported(physical_device
, format
)) {
560 tiled
|= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
;
561 linear
|= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
;
564 if (radv_is_buffer_format_supported(format
, &scaled
)) {
565 buffer
|= VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT
;
567 buffer
|= VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT
|
568 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT
;
571 if (vk_format_is_depth_or_stencil(format
)) {
572 if (radv_is_zs_format_supported(format
)) {
573 tiled
|= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
;
574 tiled
|= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
;
575 tiled
|= VK_FORMAT_FEATURE_BLIT_SRC_BIT
|
576 VK_FORMAT_FEATURE_BLIT_DST_BIT
;
577 tiled
|= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR
|
578 VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR
;
581 bool linear_sampling
;
582 if (radv_is_sampler_format_supported(format
, &linear_sampling
)) {
583 linear
|= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
|
584 VK_FORMAT_FEATURE_BLIT_SRC_BIT
;
585 tiled
|= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
|
586 VK_FORMAT_FEATURE_BLIT_SRC_BIT
;
587 if (linear_sampling
) {
588 linear
|= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
;
589 tiled
|= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
;
592 if (radv_is_colorbuffer_format_supported(format
, &blendable
)) {
593 linear
|= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
| VK_FORMAT_FEATURE_BLIT_DST_BIT
;
594 tiled
|= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
| VK_FORMAT_FEATURE_BLIT_DST_BIT
;
596 linear
|= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
;
597 tiled
|= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
;
600 if (tiled
&& util_is_power_of_two(vk_format_get_blocksize(format
)) && !scaled
) {
601 tiled
|= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR
|
602 VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR
;
606 if (linear
&& util_is_power_of_two(vk_format_get_blocksize(format
)) && !scaled
) {
607 linear
|= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR
|
608 VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR
;
611 if (format
== VK_FORMAT_R32_UINT
|| format
== VK_FORMAT_R32_SINT
) {
612 buffer
|= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT
;
613 linear
|= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
;
614 tiled
|= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
;
617 out_properties
->linearTilingFeatures
= linear
;
618 out_properties
->optimalTilingFeatures
= tiled
;
619 out_properties
->bufferFeatures
= buffer
;
622 uint32_t radv_translate_colorformat(VkFormat format
)
624 const struct vk_format_description
*desc
= vk_format_description(format
);
626 #define HAS_SIZE(x,y,z,w) \
627 (desc->channel[0].size == (x) && desc->channel[1].size == (y) && \
628 desc->channel[2].size == (z) && desc->channel[3].size == (w))
630 if (format
== VK_FORMAT_B10G11R11_UFLOAT_PACK32
) /* isn't plain */
631 return V_028C70_COLOR_10_11_11
;
633 if (desc
->layout
!= VK_FORMAT_LAYOUT_PLAIN
)
634 return V_028C70_COLOR_INVALID
;
636 /* hw cannot support mixed formats (except depth/stencil, since
637 * stencil is not written to). */
638 if (desc
->is_mixed
&& desc
->colorspace
!= VK_FORMAT_COLORSPACE_ZS
)
639 return V_028C70_COLOR_INVALID
;
641 switch (desc
->nr_channels
) {
643 switch (desc
->channel
[0].size
) {
645 return V_028C70_COLOR_8
;
647 return V_028C70_COLOR_16
;
649 return V_028C70_COLOR_32
;
653 if (desc
->channel
[0].size
== desc
->channel
[1].size
) {
654 switch (desc
->channel
[0].size
) {
656 return V_028C70_COLOR_8_8
;
658 return V_028C70_COLOR_16_16
;
660 return V_028C70_COLOR_32_32
;
662 } else if (HAS_SIZE(8,24,0,0)) {
663 return V_028C70_COLOR_24_8
;
664 } else if (HAS_SIZE(24,8,0,0)) {
665 return V_028C70_COLOR_8_24
;
669 if (HAS_SIZE(5,6,5,0)) {
670 return V_028C70_COLOR_5_6_5
;
671 } else if (HAS_SIZE(32,8,24,0)) {
672 return V_028C70_COLOR_X24_8_32_FLOAT
;
676 if (desc
->channel
[0].size
== desc
->channel
[1].size
&&
677 desc
->channel
[0].size
== desc
->channel
[2].size
&&
678 desc
->channel
[0].size
== desc
->channel
[3].size
) {
679 switch (desc
->channel
[0].size
) {
681 return V_028C70_COLOR_4_4_4_4
;
683 return V_028C70_COLOR_8_8_8_8
;
685 return V_028C70_COLOR_16_16_16_16
;
687 return V_028C70_COLOR_32_32_32_32
;
689 } else if (HAS_SIZE(5,5,5,1)) {
690 return V_028C70_COLOR_1_5_5_5
;
691 } else if (HAS_SIZE(1,5,5,5)) {
692 return V_028C70_COLOR_5_5_5_1
;
693 } else if (HAS_SIZE(10,10,10,2)) {
694 return V_028C70_COLOR_2_10_10_10
;
698 return V_028C70_COLOR_INVALID
;
701 uint32_t radv_colorformat_endian_swap(uint32_t colorformat
)
703 if (0/*SI_BIG_ENDIAN*/) {
704 switch(colorformat
) {
706 case V_028C70_COLOR_8
:
707 return V_028C70_ENDIAN_NONE
;
709 /* 16-bit buffers. */
710 case V_028C70_COLOR_5_6_5
:
711 case V_028C70_COLOR_1_5_5_5
:
712 case V_028C70_COLOR_4_4_4_4
:
713 case V_028C70_COLOR_16
:
714 case V_028C70_COLOR_8_8
:
715 return V_028C70_ENDIAN_8IN16
;
717 /* 32-bit buffers. */
718 case V_028C70_COLOR_8_8_8_8
:
719 case V_028C70_COLOR_2_10_10_10
:
720 case V_028C70_COLOR_8_24
:
721 case V_028C70_COLOR_24_8
:
722 case V_028C70_COLOR_16_16
:
723 return V_028C70_ENDIAN_8IN32
;
725 /* 64-bit buffers. */
726 case V_028C70_COLOR_16_16_16_16
:
727 return V_028C70_ENDIAN_8IN16
;
729 case V_028C70_COLOR_32_32
:
730 return V_028C70_ENDIAN_8IN32
;
732 /* 128-bit buffers. */
733 case V_028C70_COLOR_32_32_32_32
:
734 return V_028C70_ENDIAN_8IN32
;
736 return V_028C70_ENDIAN_NONE
; /* Unsupported. */
739 return V_028C70_ENDIAN_NONE
;
743 uint32_t radv_translate_dbformat(VkFormat format
)
746 case VK_FORMAT_D16_UNORM
:
747 case VK_FORMAT_D16_UNORM_S8_UINT
:
748 return V_028040_Z_16
;
749 case VK_FORMAT_D32_SFLOAT
:
750 case VK_FORMAT_D32_SFLOAT_S8_UINT
:
751 return V_028040_Z_32_FLOAT
;
753 return V_028040_Z_INVALID
;
757 unsigned radv_translate_colorswap(VkFormat format
, bool do_endian_swap
)
759 const struct vk_format_description
*desc
= vk_format_description(format
);
761 #define HAS_SWIZZLE(chan,swz) (desc->swizzle[chan] == VK_SWIZZLE_##swz)
763 if (format
== VK_FORMAT_B10G11R11_UFLOAT_PACK32
)
764 return V_0280A0_SWAP_STD
;
766 if (desc
->layout
!= VK_FORMAT_LAYOUT_PLAIN
)
769 switch (desc
->nr_channels
) {
771 if (HAS_SWIZZLE(0,X
))
772 return V_0280A0_SWAP_STD
; /* X___ */
773 else if (HAS_SWIZZLE(3,X
))
774 return V_0280A0_SWAP_ALT_REV
; /* ___X */
777 if ((HAS_SWIZZLE(0,X
) && HAS_SWIZZLE(1,Y
)) ||
778 (HAS_SWIZZLE(0,X
) && HAS_SWIZZLE(1,NONE
)) ||
779 (HAS_SWIZZLE(0,NONE
) && HAS_SWIZZLE(1,Y
)))
780 return V_0280A0_SWAP_STD
; /* XY__ */
781 else if ((HAS_SWIZZLE(0,Y
) && HAS_SWIZZLE(1,X
)) ||
782 (HAS_SWIZZLE(0,Y
) && HAS_SWIZZLE(1,NONE
)) ||
783 (HAS_SWIZZLE(0,NONE
) && HAS_SWIZZLE(1,X
)))
785 return (do_endian_swap
? V_0280A0_SWAP_STD
: V_0280A0_SWAP_STD_REV
);
786 else if (HAS_SWIZZLE(0,X
) && HAS_SWIZZLE(3,Y
))
787 return V_0280A0_SWAP_ALT
; /* X__Y */
788 else if (HAS_SWIZZLE(0,Y
) && HAS_SWIZZLE(3,X
))
789 return V_0280A0_SWAP_ALT_REV
; /* Y__X */
792 if (HAS_SWIZZLE(0,X
))
793 return (do_endian_swap
? V_0280A0_SWAP_STD_REV
: V_0280A0_SWAP_STD
);
794 else if (HAS_SWIZZLE(0,Z
))
795 return V_0280A0_SWAP_STD_REV
; /* ZYX */
798 /* check the middle channels, the 1st and 4th channel can be NONE */
799 if (HAS_SWIZZLE(1,Y
) && HAS_SWIZZLE(2,Z
)) {
800 return V_0280A0_SWAP_STD
; /* XYZW */
801 } else if (HAS_SWIZZLE(1,Z
) && HAS_SWIZZLE(2,Y
)) {
802 return V_0280A0_SWAP_STD_REV
; /* WZYX */
803 } else if (HAS_SWIZZLE(1,Y
) && HAS_SWIZZLE(2,X
)) {
804 return V_0280A0_SWAP_ALT
; /* ZYXW */
805 } else if (HAS_SWIZZLE(1,Z
) && HAS_SWIZZLE(2,W
)) {
808 return V_0280A0_SWAP_ALT_REV
;
810 return (do_endian_swap
? V_0280A0_SWAP_ALT
: V_0280A0_SWAP_ALT_REV
);
817 bool radv_format_pack_clear_color(VkFormat format
,
818 uint32_t clear_vals
[2],
819 VkClearColorValue
*value
)
821 uint8_t r
= 0, g
= 0, b
= 0, a
= 0;
822 const struct vk_format_description
*desc
= vk_format_description(format
);
824 if (vk_format_get_component_bits(format
, VK_FORMAT_COLORSPACE_RGB
, 0) <= 8) {
825 if (desc
->colorspace
== VK_FORMAT_COLORSPACE_RGB
) {
826 r
= float_to_ubyte(value
->float32
[0]);
827 g
= float_to_ubyte(value
->float32
[1]);
828 b
= float_to_ubyte(value
->float32
[2]);
829 a
= float_to_ubyte(value
->float32
[3]);
830 } else if (desc
->colorspace
== VK_FORMAT_COLORSPACE_SRGB
) {
831 r
= util_format_linear_float_to_srgb_8unorm(value
->float32
[0]);
832 g
= util_format_linear_float_to_srgb_8unorm(value
->float32
[1]);
833 b
= util_format_linear_float_to_srgb_8unorm(value
->float32
[2]);
834 a
= float_to_ubyte(value
->float32
[3]);
838 case VK_FORMAT_R8_UNORM
:
839 case VK_FORMAT_R8_SRGB
:
843 case VK_FORMAT_R8G8_UNORM
:
844 case VK_FORMAT_R8G8_SRGB
:
845 clear_vals
[0] = r
| g
<< 8;
848 case VK_FORMAT_R8G8B8A8_SRGB
:
849 case VK_FORMAT_R8G8B8A8_UNORM
:
850 clear_vals
[0] = r
| g
<< 8 | b
<< 16 | a
<< 24;
853 case VK_FORMAT_B8G8R8A8_SRGB
:
854 case VK_FORMAT_B8G8R8A8_UNORM
:
855 clear_vals
[0] = b
| g
<< 8 | r
<< 16 | a
<< 24;
858 case VK_FORMAT_A8B8G8R8_UNORM_PACK32
:
859 case VK_FORMAT_A8B8G8R8_SRGB_PACK32
:
860 clear_vals
[0] = r
| g
<< 8 | b
<< 16 | a
<< 24;
863 case VK_FORMAT_R8_UINT
:
864 clear_vals
[0] = value
->uint32
[0] & 0xff;
867 case VK_FORMAT_R8_SINT
:
868 clear_vals
[0] = value
->int32
[0] & 0xff;
871 case VK_FORMAT_R16_UINT
:
872 clear_vals
[0] = value
->uint32
[0] & 0xffff;
875 case VK_FORMAT_R8G8_UINT
:
876 clear_vals
[0] = value
->uint32
[0] & 0xff;
877 clear_vals
[0] |= (value
->uint32
[1] & 0xff) << 8;
880 case VK_FORMAT_R8G8_SINT
:
881 clear_vals
[0] = value
->int32
[0] & 0xff;
882 clear_vals
[0] |= (value
->int32
[1] & 0xff) << 8;
885 case VK_FORMAT_R8G8B8A8_UINT
:
886 clear_vals
[0] = value
->uint32
[0] & 0xff;
887 clear_vals
[0] |= (value
->uint32
[1] & 0xff) << 8;
888 clear_vals
[0] |= (value
->uint32
[2] & 0xff) << 16;
889 clear_vals
[0] |= (value
->uint32
[3] & 0xff) << 24;
892 case VK_FORMAT_R8G8B8A8_SINT
:
893 clear_vals
[0] = value
->int32
[0] & 0xff;
894 clear_vals
[0] |= (value
->int32
[1] & 0xff) << 8;
895 clear_vals
[0] |= (value
->int32
[2] & 0xff) << 16;
896 clear_vals
[0] |= (value
->int32
[3] & 0xff) << 24;
899 case VK_FORMAT_A8B8G8R8_UINT_PACK32
:
900 clear_vals
[0] = value
->uint32
[0] & 0xff;
901 clear_vals
[0] |= (value
->uint32
[1] & 0xff) << 8;
902 clear_vals
[0] |= (value
->uint32
[2] & 0xff) << 16;
903 clear_vals
[0] |= (value
->uint32
[3] & 0xff) << 24;
906 case VK_FORMAT_R16G16_UINT
:
907 clear_vals
[0] = value
->uint32
[0] & 0xffff;
908 clear_vals
[0] |= (value
->uint32
[1] & 0xffff) << 16;
911 case VK_FORMAT_R16G16B16A16_UINT
:
912 clear_vals
[0] = value
->uint32
[0] & 0xffff;
913 clear_vals
[0] |= (value
->uint32
[1] & 0xffff) << 16;
914 clear_vals
[1] = value
->uint32
[2] & 0xffff;
915 clear_vals
[1] |= (value
->uint32
[3] & 0xffff) << 16;
917 case VK_FORMAT_R32_UINT
:
918 clear_vals
[0] = value
->uint32
[0];
921 case VK_FORMAT_R32G32_UINT
:
922 clear_vals
[0] = value
->uint32
[0];
923 clear_vals
[1] = value
->uint32
[1];
925 case VK_FORMAT_R32_SINT
:
926 clear_vals
[0] = value
->int32
[0];
929 case VK_FORMAT_R16_SFLOAT
:
930 clear_vals
[0] = util_float_to_half(value
->float32
[0]);
933 case VK_FORMAT_R16G16_SFLOAT
:
934 clear_vals
[0] = util_float_to_half(value
->float32
[0]);
935 clear_vals
[0] |= (uint32_t)util_float_to_half(value
->float32
[1]) << 16;
938 case VK_FORMAT_R16G16B16A16_SFLOAT
:
939 clear_vals
[0] = util_float_to_half(value
->float32
[0]);
940 clear_vals
[0] |= (uint32_t)util_float_to_half(value
->float32
[1]) << 16;
941 clear_vals
[1] = util_float_to_half(value
->float32
[2]);
942 clear_vals
[1] |= (uint32_t)util_float_to_half(value
->float32
[3]) << 16;
944 case VK_FORMAT_R16_UNORM
:
945 clear_vals
[0] = ((uint16_t)util_iround(CLAMP(value
->float32
[0], 0.0f
, 1.0f
) * 0xffff)) & 0xffff;
948 case VK_FORMAT_R16G16_UNORM
:
949 clear_vals
[0] = ((uint16_t)util_iround(CLAMP(value
->float32
[0], 0.0f
, 1.0f
) * 0xffff)) & 0xffff;
950 clear_vals
[0] |= ((uint16_t)util_iround(CLAMP(value
->float32
[1], 0.0f
, 1.0f
) * 0xffff)) << 16;
953 case VK_FORMAT_R16G16B16A16_UNORM
:
954 clear_vals
[0] = ((uint16_t)util_iround(CLAMP(value
->float32
[0], 0.0f
, 1.0f
) * 0xffff)) & 0xffff;
955 clear_vals
[0] |= ((uint16_t)util_iround(CLAMP(value
->float32
[1], 0.0f
, 1.0f
) * 0xffff)) << 16;
956 clear_vals
[1] = ((uint16_t)util_iround(CLAMP(value
->float32
[2], 0.0f
, 1.0f
) * 0xffff)) & 0xffff;
957 clear_vals
[1] |= ((uint16_t)util_iround(CLAMP(value
->float32
[3], 0.0f
, 1.0f
) * 0xffff)) << 16;
959 case VK_FORMAT_A2B10G10R10_UNORM_PACK32
:
960 clear_vals
[0] = ((uint16_t)util_iround(CLAMP(value
->float32
[0], 0.0f
, 1.0f
) * 0x3ff)) & 0x3ff;
961 clear_vals
[0] |= (((uint16_t)util_iround(CLAMP(value
->float32
[1], 0.0f
, 1.0f
) * 0x3ff)) & 0x3ff) << 10;
962 clear_vals
[0] |= (((uint16_t)util_iround(CLAMP(value
->float32
[2], 0.0f
, 1.0f
) * 0x3ff)) & 0x3ff) << 20;
963 clear_vals
[0] |= (((uint16_t)util_iround(CLAMP(value
->float32
[3], 0.0f
, 1.0f
) * 0x3)) & 0x3) << 30;
966 case VK_FORMAT_R32G32_SFLOAT
:
967 clear_vals
[0] = fui(value
->float32
[0]);
968 clear_vals
[1] = fui(value
->float32
[1]);
970 case VK_FORMAT_R32_SFLOAT
:
972 clear_vals
[0] = fui(value
->float32
[0]);
974 case VK_FORMAT_B10G11R11_UFLOAT_PACK32
:
975 clear_vals
[0] = float3_to_r11g11b10f(value
->float32
);
979 fprintf(stderr
, "failed to fast clear %d\n", format
);
985 void radv_GetPhysicalDeviceFormatProperties(
986 VkPhysicalDevice physicalDevice
,
988 VkFormatProperties
* pFormatProperties
)
990 RADV_FROM_HANDLE(radv_physical_device
, physical_device
, physicalDevice
);
992 radv_physical_device_get_format_properties(physical_device
,
997 void radv_GetPhysicalDeviceFormatProperties2KHR(
998 VkPhysicalDevice physicalDevice
,
1000 VkFormatProperties2KHR
* pFormatProperties
)
1002 RADV_FROM_HANDLE(radv_physical_device
, physical_device
, physicalDevice
);
1004 radv_physical_device_get_format_properties(physical_device
,
1006 &pFormatProperties
->formatProperties
);
1009 static VkResult
radv_get_image_format_properties(struct radv_physical_device
*physical_device
,
1010 const VkPhysicalDeviceImageFormatInfo2KHR
*info
,
1011 VkImageFormatProperties
*pImageFormatProperties
)
1014 VkFormatProperties format_props
;
1015 VkFormatFeatureFlags format_feature_flags
;
1016 VkExtent3D maxExtent
;
1017 uint32_t maxMipLevels
;
1018 uint32_t maxArraySize
;
1019 VkSampleCountFlags sampleCounts
= VK_SAMPLE_COUNT_1_BIT
;
1021 radv_physical_device_get_format_properties(physical_device
, info
->format
,
1023 if (info
->tiling
== VK_IMAGE_TILING_LINEAR
) {
1024 format_feature_flags
= format_props
.linearTilingFeatures
;
1025 } else if (info
->tiling
== VK_IMAGE_TILING_OPTIMAL
) {
1026 format_feature_flags
= format_props
.optimalTilingFeatures
;
1028 unreachable("bad VkImageTiling");
1031 if (format_feature_flags
== 0)
1034 switch (info
->type
) {
1036 unreachable("bad vkimage type\n");
1037 case VK_IMAGE_TYPE_1D
:
1038 maxExtent
.width
= 16384;
1039 maxExtent
.height
= 1;
1040 maxExtent
.depth
= 1;
1041 maxMipLevels
= 15; /* log2(maxWidth) + 1 */
1042 maxArraySize
= 2048;
1044 case VK_IMAGE_TYPE_2D
:
1045 maxExtent
.width
= 16384;
1046 maxExtent
.height
= 16384;
1047 maxExtent
.depth
= 1;
1048 maxMipLevels
= 15; /* log2(maxWidth) + 1 */
1049 maxArraySize
= 2048;
1051 case VK_IMAGE_TYPE_3D
:
1052 maxExtent
.width
= 2048;
1053 maxExtent
.height
= 2048;
1054 maxExtent
.depth
= 2048;
1055 maxMipLevels
= 12; /* log2(maxWidth) + 1 */
1060 if (info
->tiling
== VK_IMAGE_TILING_OPTIMAL
&&
1061 info
->type
== VK_IMAGE_TYPE_2D
&&
1062 (format_feature_flags
& (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
|
1063 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
)) &&
1064 !(info
->flags
& VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
) &&
1065 !(info
->usage
& VK_IMAGE_USAGE_STORAGE_BIT
)) {
1066 sampleCounts
|= VK_SAMPLE_COUNT_2_BIT
| VK_SAMPLE_COUNT_4_BIT
| VK_SAMPLE_COUNT_8_BIT
;
1069 if (info
->usage
& VK_IMAGE_USAGE_SAMPLED_BIT
) {
1070 if (!(format_feature_flags
& VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
)) {
1075 if (info
->usage
& VK_IMAGE_USAGE_STORAGE_BIT
) {
1076 if (!(format_feature_flags
& VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
)) {
1081 if (info
->usage
& VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
) {
1082 if (!(format_feature_flags
& VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
)) {
1087 if (info
->usage
& VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
) {
1088 if (!(format_feature_flags
& VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
)) {
1093 *pImageFormatProperties
= (VkImageFormatProperties
) {
1094 .maxExtent
= maxExtent
,
1095 .maxMipLevels
= maxMipLevels
,
1096 .maxArrayLayers
= maxArraySize
,
1097 .sampleCounts
= sampleCounts
,
1099 /* FINISHME: Accurately calculate
1100 * VkImageFormatProperties::maxResourceSize.
1102 .maxResourceSize
= UINT32_MAX
,
1107 *pImageFormatProperties
= (VkImageFormatProperties
) {
1108 .maxExtent
= { 0, 0, 0 },
1110 .maxArrayLayers
= 0,
1112 .maxResourceSize
= 0,
1115 return VK_ERROR_FORMAT_NOT_SUPPORTED
;
1118 VkResult
radv_GetPhysicalDeviceImageFormatProperties(
1119 VkPhysicalDevice physicalDevice
,
1122 VkImageTiling tiling
,
1123 VkImageUsageFlags usage
,
1124 VkImageCreateFlags createFlags
,
1125 VkImageFormatProperties
* pImageFormatProperties
)
1127 RADV_FROM_HANDLE(radv_physical_device
, physical_device
, physicalDevice
);
1129 const VkPhysicalDeviceImageFormatInfo2KHR info
= {
1130 .sType
= VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR
,
1136 .flags
= createFlags
,
1139 return radv_get_image_format_properties(physical_device
, &info
,
1140 pImageFormatProperties
);
1143 VkResult
radv_GetPhysicalDeviceImageFormatProperties2KHR(
1144 VkPhysicalDevice physicalDevice
,
1145 const VkPhysicalDeviceImageFormatInfo2KHR
*base_info
,
1146 VkImageFormatProperties2KHR
*base_props
)
1148 RADV_FROM_HANDLE(radv_physical_device
, physical_device
, physicalDevice
);
1149 return radv_get_image_format_properties(physical_device
, base_info
,
1150 &base_props
->imageFormatProperties
);
1153 void radv_GetPhysicalDeviceSparseImageFormatProperties(
1154 VkPhysicalDevice physicalDevice
,
1158 VkImageUsageFlags usage
,
1159 VkImageTiling tiling
,
1160 uint32_t* pNumProperties
,
1161 VkSparseImageFormatProperties
* pProperties
)
1163 /* Sparse images are not yet supported. */
1164 *pNumProperties
= 0;
1167 void radv_GetPhysicalDeviceSparseImageFormatProperties2KHR(
1168 VkPhysicalDevice physicalDevice
,
1169 const VkPhysicalDeviceSparseImageFormatInfo2KHR
* pFormatInfo
,
1170 uint32_t *pPropertyCount
,
1171 VkSparseImageFormatProperties2KHR
* pProperties
)
1173 /* Sparse images are not yet supported. */
1174 *pPropertyCount
= 0;