uint32_t *internal_type,
uint32_t *internal_bpp)
{
- const VkImageAspectFlags ds_aspects = VK_IMAGE_ASPECT_DEPTH_BIT |
- VK_IMAGE_ASPECT_STENCIL_BIT;
-
/* We can't store depth/stencil pixel formats to a raster format, so
- * so instead we load our depth/stencil aspects to a compatible color
- * format.
+ * instead we load our depth/stencil aspects to a compatible color format.
*/
- /* FIXME: pre-compute this at image creation time? */
- if (aspect_mask & ds_aspects) {
+ if (aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
+ *internal_bpp = V3D_INTERNAL_BPP_32;
switch (vk_format) {
case VK_FORMAT_D16_UNORM:
*internal_type = V3D_INTERNAL_TYPE_16UI;
- *internal_bpp = V3D_INTERNAL_BPP_32;
break;
case VK_FORMAT_D32_SFLOAT:
*internal_type = V3D_INTERNAL_TYPE_32F;
- *internal_bpp = V3D_INTERNAL_BPP_32;
break;
case VK_FORMAT_X8_D24_UNORM_PACK32:
case VK_FORMAT_D24_UNORM_S8_UINT:
* load command for more details.
*/
*internal_type = V3D_INTERNAL_TYPE_8UI;
- *internal_bpp = V3D_INTERNAL_BPP_32;
break;
default:
assert(!"unsupported format");