Browse Source

VUID FIX

pull/2798/head
Ribbit 5 months ago
committed by crueter
parent
commit
99a06beda4
  1. 22
      src/video_core/renderer_vulkan/vk_render_pass_cache.cpp

22
src/video_core/renderer_vulkan/vk_render_pass_cache.cpp

@ -43,19 +43,6 @@ using VideoCore::Surface::SurfaceType;
} }
} }
VkImageLayout AttachmentLayout(SurfaceType type) {
switch (type) {
case SurfaceType::ColorTexture:
return VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
case SurfaceType::Depth:
case SurfaceType::Stencil:
case SurfaceType::DepthStencil:
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
default:
return VK_IMAGE_LAYOUT_GENERAL;
}
}
VkAttachmentDescription AttachmentDescription(const Device& device, PixelFormat format, VkAttachmentDescription AttachmentDescription(const Device& device, PixelFormat format,
VkSampleCountFlagBits samples) { VkSampleCountFlagBits samples) {
using MaxwellToVK::SurfaceFormat; using MaxwellToVK::SurfaceFormat;
@ -63,7 +50,10 @@ using VideoCore::Surface::SurfaceType;
const SurfaceType surface_type = GetSurfaceType(format); const SurfaceType surface_type = GetSurfaceType(format);
const bool has_stencil = surface_type == SurfaceType::DepthStencil || const bool has_stencil = surface_type == SurfaceType::DepthStencil ||
surface_type == SurfaceType::Stencil; surface_type == SurfaceType::Stencil;
const VkImageLayout attachment_layout = AttachmentLayout(surface_type);
const VkImageLayout attachment_layout =
surface_type == SurfaceType::ColorTexture
? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
: VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
return { return {
.flags = {}, .flags = {},
@ -75,8 +65,8 @@ using VideoCore::Surface::SurfaceType;
: VK_ATTACHMENT_LOAD_OP_DONT_CARE, : VK_ATTACHMENT_LOAD_OP_DONT_CARE,
.stencilStoreOp = has_stencil ? VK_ATTACHMENT_STORE_OP_STORE .stencilStoreOp = has_stencil ? VK_ATTACHMENT_STORE_OP_STORE
: VK_ATTACHMENT_STORE_OP_DONT_CARE, : VK_ATTACHMENT_STORE_OP_DONT_CARE,
.initialLayout = attachment_layout,
.finalLayout = attachment_layout,
.initialLayout = VK_IMAGE_LAYOUT_GENERAL,
.finalLayout = VK_IMAGE_LAYOUT_GENERAL,
}; };
} }
} // Anonymous namespace } // Anonymous namespace

Loading…
Cancel
Save