mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
zink: add better handling for CUBE_COMPATIBLE bit
this check was illegal because the usage bits weren't yet populated, so add another check after usage bits are determined to figure out if CUBE_COMPATIBLE can be applied additionally, checking sample counts was never needed since the spec prohibits CUBE_COMPATIBLE use with multisampling zink DEBUG: ERR: 'Validation Error: [ VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x991b3105 | vkGetPhysicalDeviceImageFormatProperties: value of usage must not be 0. The Vulkan spec states: usage must not be 0 (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask)' Fixes:71494c4874("zink: only mark resources as cube-compatible if supported") Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12580> (cherry picked from commit2de6beaa12)
This commit is contained in:
parent
5e05d43e13
commit
c0a49bc4c9
2 changed files with 15 additions and 18 deletions
|
|
@ -1057,7 +1057,7 @@
|
|||
"description": "zink: add better handling for CUBE_COMPATIBLE bit",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "71494c4874c6d8eba93309faeed01e1444eb49b5"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -400,8 +400,6 @@ create_ici(struct zink_screen *screen, VkImageCreateInfo *ici, const struct pipe
|
|||
|
||||
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:
|
||||
|
|
@ -437,21 +435,15 @@ create_ici(struct zink_screen *screen, VkImageCreateInfo *ici, const struct pipe
|
|||
ici->sharingMode = VK_SHARING_MODE_EXCLUSIVE;
|
||||
ici->initialLayout = 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;
|
||||
|
|
@ -494,6 +486,11 @@ create_ici(struct zink_screen *screen, VkImageCreateInfo *ici, const struct pipe
|
|||
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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue