[vk] Fix regression on PR 321 (#394)
Reviewed-on: #394 Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: MaranBr <maranbr@outlook.com> Co-committed-by: MaranBr <maranbr@outlook.com>
This commit is contained in:
parent
3fbfd64722
commit
ad6045d9a4
1 changed files with 9 additions and 23 deletions
|
@ -2160,34 +2160,20 @@ VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
||||||
if (!image_handle) {
|
if (!image_handle) {
|
||||||
return VK_NULL_HANDLE;
|
return VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
if (image_format == Shader::ImageFormat::Typeless) {
|
||||||
|
return Handle(texture_type);
|
||||||
|
}
|
||||||
|
const bool is_signed{image_format == Shader::ImageFormat::R8_SINT ||
|
||||||
|
image_format == Shader::ImageFormat::R16_SINT};
|
||||||
if (!storage_views) {
|
if (!storage_views) {
|
||||||
storage_views = std::make_unique<StorageViews>();
|
storage_views = std::make_unique<StorageViews>();
|
||||||
}
|
}
|
||||||
|
auto& views{is_signed ? storage_views->signeds : storage_views->unsigneds};
|
||||||
// Storage images MUST use identity component mapping.
|
auto& view{views[static_cast<size_t>(texture_type)]};
|
||||||
// Typeless: use the underlying image's native format.
|
if (view) {
|
||||||
if (image_format == Shader::ImageFormat::Typeless) {
|
|
||||||
auto& view = storage_views->unsigneds[static_cast<size_t>(texture_type)];
|
|
||||||
if (view) {
|
|
||||||
return *view;
|
|
||||||
}
|
|
||||||
const auto fmt_info =
|
|
||||||
MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, /*is_image=*/true, format);
|
|
||||||
const VkFormat vk_format = fmt_info.format;
|
|
||||||
// Storage images are color-aspect only
|
|
||||||
view = MakeView(vk_format, VK_IMAGE_ASPECT_COLOR_BIT); // identity components inside
|
|
||||||
return *view;
|
return *view;
|
||||||
}
|
}
|
||||||
const bool is_signed = (image_format == Shader::ImageFormat::R8_SINT ||image_format == Shader::ImageFormat::R16_SINT);
|
view = MakeView(Format(image_format), VK_IMAGE_ASPECT_COLOR_BIT);
|
||||||
auto& views = is_signed ? storage_views->signeds : storage_views->unsigneds;
|
|
||||||
auto& view = views[static_cast<size_t>(texture_type)];
|
|
||||||
if (view) {
|
|
||||||
return *view;
|
|
||||||
}
|
|
||||||
|
|
||||||
const VkFormat vk_format = Format(image_format);
|
|
||||||
view = MakeView(vk_format, VK_IMAGE_ASPECT_COLOR_BIT);// identity components inside
|
|
||||||
return *view;
|
return *view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue