mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-03 20:27:08 +02:00
[vk, texture_cache] Remove Force Identity in Component Swizzle
This commit is contained in:
parent
3628654a98
commit
e33d2541d2
1 changed files with 4 additions and 9 deletions
|
|
@ -2139,11 +2139,6 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
||||||
.usage = ImageUsageFlags(format_info, format),
|
.usage = ImageUsageFlags(format_info, format),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Vulkan spec: STORAGE_IMAGE and INPUT_ATTACHMENT descriptors MUST use identity swizzle
|
|
||||||
// Using non-identity swizzle causes validation error and undefined behavior
|
|
||||||
const bool requires_identity_swizzle =
|
|
||||||
(image_view_usage.usage & (VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)) != 0;
|
|
||||||
|
|
||||||
const VkImageViewCreateInfo create_info{
|
const VkImageViewCreateInfo create_info{
|
||||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
||||||
.pNext = &image_view_usage,
|
.pNext = &image_view_usage,
|
||||||
|
|
@ -2152,10 +2147,10 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
||||||
.viewType = VkImageViewType{},
|
.viewType = VkImageViewType{},
|
||||||
.format = view_format,
|
.format = view_format,
|
||||||
.components{
|
.components{
|
||||||
.r = requires_identity_swizzle ? VK_COMPONENT_SWIZZLE_IDENTITY : ComponentSwizzle(swizzle[0]),
|
.r = ComponentSwizzle(swizzle[0]),
|
||||||
.g = requires_identity_swizzle ? VK_COMPONENT_SWIZZLE_IDENTITY : ComponentSwizzle(swizzle[1]),
|
.g = ComponentSwizzle(swizzle[1]),
|
||||||
.b = requires_identity_swizzle ? VK_COMPONENT_SWIZZLE_IDENTITY : ComponentSwizzle(swizzle[2]),
|
.b = ComponentSwizzle(swizzle[2]),
|
||||||
.a = requires_identity_swizzle ? VK_COMPONENT_SWIZZLE_IDENTITY : ComponentSwizzle(swizzle[3]),
|
.a = ComponentSwizzle(swizzle[3]),
|
||||||
},
|
},
|
||||||
.subresourceRange = MakeSubresourceRange(aspect_mask, info.range),
|
.subresourceRange = MakeSubresourceRange(aspect_mask, info.range),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue