mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 03:18:55 +02:00
[vulkan] Adjusted image view usage flags to ensure compatibility with image format in TextureCache
This commit is contained in:
parent
6b87b0052a
commit
ce15cf7cd3
2 changed files with 6 additions and 2 deletions
|
|
@ -286,6 +286,7 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) {
|
|||
maxwell3d->regs.zpass_pixel_count_enable);
|
||||
|
||||
UpdateDynamicStates();
|
||||
scheduler.RequestRenderpass(texture_cache.GetFramebuffer());
|
||||
draw_func();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2112,7 +2112,10 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
|||
}
|
||||
}
|
||||
const auto format_info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
|
||||
if (ImageUsageFlags(format_info, format) != image.UsageFlags()) {
|
||||
const VkImageUsageFlags desired_view_usage = ImageUsageFlags(format_info, format);
|
||||
const VkImageUsageFlags image_usage = image.UsageFlags();
|
||||
const VkImageUsageFlags view_usage = desired_view_usage & image_usage;
|
||||
if (desired_view_usage != image_usage) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Image view format {} has different usage flags than image format {}", format,
|
||||
image.info.format);
|
||||
|
|
@ -2120,7 +2123,7 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
|||
const VkImageViewUsageCreateInfo image_view_usage{
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.usage = ImageUsageFlags(format_info, format),
|
||||
.usage = view_usage,
|
||||
};
|
||||
const VkImageViewCreateInfo create_info{
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue