mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 03:18:55 +02:00
[vulkan] fix vuid 00336
Another attempt, previous was PR321 which broke some games like kirby star allies
This commit is contained in:
parent
72b3f3a8a5
commit
445e0bfd36
2 changed files with 16 additions and 1 deletions
|
|
@ -2179,6 +2179,7 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
|||
using Shader::TextureType;
|
||||
|
||||
const VkImageAspectFlags aspect_mask = ImageViewAspectMask(info);
|
||||
this->aspect_mask = aspect_mask;
|
||||
std::array<SwizzleSource, 4> swizzle{
|
||||
SwizzleSource::R,
|
||||
SwizzleSource::G,
|
||||
|
|
@ -2193,6 +2194,7 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
|||
std::ranges::transform(swizzle, swizzle.begin(), ConvertGreenRed);
|
||||
}
|
||||
}
|
||||
this->swizzle = swizzle;
|
||||
const auto format_info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
|
||||
if (ImageUsageFlags(format_info, format) != image.UsageFlags()) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
|
|
@ -2273,6 +2275,8 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageInfo&
|
|||
|
||||
ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::NullImageViewParams& params)
|
||||
: VideoCommon::ImageViewBase{params}, device{&runtime.device} {
|
||||
swizzle = {SwizzleSource::R, SwizzleSource::G, SwizzleSource::B, SwizzleSource::A};
|
||||
aspect_mask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
if (device->HasNullDescriptor()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -2329,7 +2333,13 @@ VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
|||
Shader::ImageFormat image_format) {
|
||||
if (image_handle) {
|
||||
if (image_format == Shader::ImageFormat::Typeless) {
|
||||
return Handle(texture_type);
|
||||
auto& view = identity_views[static_cast<size_t>(texture_type)];
|
||||
if (!view) {
|
||||
const auto format_info =
|
||||
MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
|
||||
view = MakeView(format_info.format, aspect_mask);
|
||||
}
|
||||
return *view;
|
||||
}
|
||||
const bool is_signed = image_format == Shader::ImageFormat::R8_SINT
|
||||
|| image_format == Shader::ImageFormat::R16_SINT;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
#include "video_core/vulkan_common/vulkan_memory_allocator.h"
|
||||
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
||||
|
||||
#include "video_core/textures/texture.h"
|
||||
|
||||
namespace Settings {
|
||||
struct ResolutionScalingInfo;
|
||||
}
|
||||
|
|
@ -379,6 +381,9 @@ private:
|
|||
const SlotVector<Image>* slot_images = nullptr;
|
||||
|
||||
std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> image_views;
|
||||
std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> identity_views;
|
||||
std::array<Tegra::Texture::SwizzleSource, 4> swizzle;
|
||||
VkImageAspectFlags aspect_mask;
|
||||
std::optional<StorageViews> storage_views;
|
||||
vk::ImageView depth_view;
|
||||
vk::ImageView stencil_view;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue