case PIPE_TEXTURE_CUBE:
case PIPE_TEXTURE_CUBE_ARRAY:
- ici->flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
- FALLTHROUGH;
case PIPE_TEXTURE_2D:
case PIPE_TEXTURE_2D_ARRAY:
case PIPE_TEXTURE_RECT:
ici->sharingMode = VK_SHARING_MODE_EXCLUSIVE;
ici->initialLayout = dmabuf ? VK_IMAGE_LAYOUT_PREINITIALIZED : VK_IMAGE_LAYOUT_UNDEFINED;
- if (templ->target == PIPE_TEXTURE_CUBE ||
- templ->target == PIPE_TEXTURE_CUBE_ARRAY ||
- (templ->target == PIPE_TEXTURE_2D_ARRAY &&
- ici->extent.width == ici->extent.height &&
- ici->arrayLayers >= 6)) {
- VkImageFormatProperties props;
- if (vkGetPhysicalDeviceImageFormatProperties(screen->pdev, ici->format,
- ici->imageType, ici->tiling,
- ici->usage, ici->flags |
- VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT,
- &props) == VK_SUCCESS) {
- if (props.sampleCounts & ici->samples)
- ici->flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
- }
- }
+ /* sampleCounts will be set to VK_SAMPLE_COUNT_1_BIT if at least one of the following conditions is true:
+ * - flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
+ *
+ * 44.1.1. Supported Sample Counts
+ */
+ bool want_cube = ici->samples == 1 &&
+ (templ->target == PIPE_TEXTURE_CUBE ||
+ templ->target == PIPE_TEXTURE_CUBE_ARRAY ||
+ (templ->target == PIPE_TEXTURE_2D_ARRAY && ici->extent.width == ici->extent.height && ici->arrayLayers >= 6));
if (templ->target == PIPE_TEXTURE_CUBE)
ici->arrayLayers *= 6;
if (ici->tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT)
tried[ici->tiling] = true;
}
+ if (want_cube) {
+ ici->flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
+ if (get_image_usage(screen, ici, templ, bind, modifiers_count, modifiers, &mod) != ici->usage)
+ ici->flags &= ~VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
+ }
*success = true;
return mod;