mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 03:18:55 +02:00
fix vuid 00336 and build errors
This commit is contained in:
parent
6f9d025ad2
commit
99cc9fc7af
2 changed files with 29 additions and 14 deletions
|
|
@ -2096,21 +2096,23 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
||||||
samples(ConvertSampleCount(image.info.num_samples)) {
|
samples(ConvertSampleCount(image.info.num_samples)) {
|
||||||
using Shader::TextureType;
|
using Shader::TextureType;
|
||||||
|
|
||||||
const VkImageAspectFlags aspect_mask = ImageViewAspectMask(info);
|
const VkImageAspectFlags view_aspect_mask = ImageViewAspectMask(info);
|
||||||
std::array<SwizzleSource, 4> swizzle{
|
this->aspect_mask = view_aspect_mask;
|
||||||
|
std::array<SwizzleSource, 4> view_swizzle{
|
||||||
SwizzleSource::R,
|
SwizzleSource::R,
|
||||||
SwizzleSource::G,
|
SwizzleSource::G,
|
||||||
SwizzleSource::B,
|
SwizzleSource::B,
|
||||||
SwizzleSource::A,
|
SwizzleSource::A,
|
||||||
};
|
};
|
||||||
if (!info.IsRenderTarget()) {
|
if (!info.IsRenderTarget()) {
|
||||||
swizzle = info.Swizzle();
|
view_swizzle = info.Swizzle();
|
||||||
TryTransformSwizzleIfNeeded(format, swizzle,
|
TryTransformSwizzleIfNeeded(format, view_swizzle,
|
||||||
!device->IsExt4444FormatsSupported());
|
!device->IsExt4444FormatsSupported());
|
||||||
if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) {
|
if ((view_aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) {
|
||||||
std::ranges::transform(swizzle, swizzle.begin(), ConvertGreenRed);
|
std::ranges::transform(view_swizzle, view_swizzle.begin(), ConvertGreenRed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this->swizzle = view_swizzle;
|
||||||
const auto format_info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
|
const auto format_info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
|
||||||
if (ImageUsageFlags(format_info, format) != image.UsageFlags()) {
|
if (ImageUsageFlags(format_info, format) != image.UsageFlags()) {
|
||||||
LOG_WARNING(Render_Vulkan,
|
LOG_WARNING(Render_Vulkan,
|
||||||
|
|
@ -2130,12 +2132,12 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
|
||||||
.viewType = VkImageViewType{},
|
.viewType = VkImageViewType{},
|
||||||
.format = format_info.format,
|
.format = format_info.format,
|
||||||
.components{
|
.components{
|
||||||
.r = ComponentSwizzle(swizzle[0]),
|
.r = ComponentSwizzle(view_swizzle[0]),
|
||||||
.g = ComponentSwizzle(swizzle[1]),
|
.g = ComponentSwizzle(view_swizzle[1]),
|
||||||
.b = ComponentSwizzle(swizzle[2]),
|
.b = ComponentSwizzle(view_swizzle[2]),
|
||||||
.a = ComponentSwizzle(swizzle[3]),
|
.a = ComponentSwizzle(view_swizzle[3]),
|
||||||
},
|
},
|
||||||
.subresourceRange = MakeSubresourceRange(aspect_mask, info.range),
|
.subresourceRange = MakeSubresourceRange(view_aspect_mask, info.range),
|
||||||
};
|
};
|
||||||
const auto create = [&](TextureType tex_type, std::optional<u32> num_layers) {
|
const auto create = [&](TextureType tex_type, std::optional<u32> num_layers) {
|
||||||
VkImageViewCreateInfo ci{create_info};
|
VkImageViewCreateInfo ci{create_info};
|
||||||
|
|
@ -2191,6 +2193,8 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageInfo&
|
||||||
|
|
||||||
ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::NullImageViewParams& params)
|
ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::NullImageViewParams& params)
|
||||||
: VideoCommon::ImageViewBase{params}, device{&runtime.device} {
|
: 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()) {
|
if (device->HasNullDescriptor()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -2247,7 +2251,13 @@ VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
||||||
Shader::ImageFormat image_format) {
|
Shader::ImageFormat image_format) {
|
||||||
if (image_handle) {
|
if (image_handle) {
|
||||||
if (image_format == Shader::ImageFormat::Typeless) {
|
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
|
const bool is_signed = image_format == Shader::ImageFormat::R8_SINT
|
||||||
|| image_format == Shader::ImageFormat::R16_SINT;
|
|| image_format == Shader::ImageFormat::R16_SINT;
|
||||||
|
|
@ -2266,7 +2276,7 @@ bool ImageView::IsRescaled() const noexcept {
|
||||||
return (*slot_images)[image_id].IsRescaled();
|
return (*slot_images)[image_id].IsRescaled();
|
||||||
}
|
}
|
||||||
|
|
||||||
vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags aspect_mask) {
|
vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags view_aspect_mask) {
|
||||||
return device->GetLogical().CreateImageView({
|
return device->GetLogical().CreateImageView({
|
||||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
||||||
.pNext = nullptr,
|
.pNext = nullptr,
|
||||||
|
|
@ -2280,7 +2290,7 @@ vk::ImageView ImageView::MakeView(VkFormat vk_format, VkImageAspectFlags aspect_
|
||||||
.b = VK_COMPONENT_SWIZZLE_IDENTITY,
|
.b = VK_COMPONENT_SWIZZLE_IDENTITY,
|
||||||
.a = VK_COMPONENT_SWIZZLE_IDENTITY,
|
.a = VK_COMPONENT_SWIZZLE_IDENTITY,
|
||||||
},
|
},
|
||||||
.subresourceRange = MakeSubresourceRange(aspect_mask, range),
|
.subresourceRange = MakeSubresourceRange(view_aspect_mask, range),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@
|
||||||
#include "video_core/vulkan_common/vulkan_memory_allocator.h"
|
#include "video_core/vulkan_common/vulkan_memory_allocator.h"
|
||||||
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
||||||
|
|
||||||
|
#include "video_core/textures/texture.h"
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
struct ResolutionScalingInfo;
|
struct ResolutionScalingInfo;
|
||||||
}
|
}
|
||||||
|
|
@ -379,6 +381,9 @@ private:
|
||||||
const SlotVector<Image>* slot_images = nullptr;
|
const SlotVector<Image>* slot_images = nullptr;
|
||||||
|
|
||||||
std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> image_views;
|
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;
|
std::optional<StorageViews> storage_views;
|
||||||
vk::ImageView depth_view;
|
vk::ImageView depth_view;
|
||||||
vk::ImageView stencil_view;
|
vk::ImageView stencil_view;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue