early-access version 2204

This commit is contained in:
pineappleEA
2021-11-17 02:40:33 +01:00
parent 0386e477a0
commit cdf43a0828
9 changed files with 80 additions and 19 deletions

View File

@@ -1366,6 +1366,8 @@ ImageView::ImageView(TextureCacheRuntime&, const VideoCommon::ImageInfo& info,
ImageView::ImageView(TextureCacheRuntime&, const VideoCommon::NullImageViewParams& params)
: VideoCommon::ImageViewBase{params} {}
ImageView::~ImageView() = default;
VkImageView ImageView::DepthView() {
if (depth_view) {
return *depth_view;
@@ -1448,13 +1450,7 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
LOG_WARNING(Render_Vulkan, "VK_EXT_sampler_filter_minmax is required");
}
// Some games have samplers with garbage. Sanitize them here.
const f32 setting_anisotropic =
static_cast<f32>(1U << Settings::values.max_anisotropy.GetValue());
const f32 game_anisotropic = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
const bool aument_anisotropic =
game_anisotropic > 1.0f || tsc.mipmap_filter == TextureMipmapFilter::Linear;
const f32 max_anisotropy =
aument_anisotropic ? std::max(game_anisotropic, setting_anisotropic) : game_anisotropic;
const f32 max_anisotropy = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
sampler = device.GetLogical().CreateSampler(VkSamplerCreateInfo{
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
@@ -1498,6 +1494,8 @@ Framebuffer::Framebuffer(TextureCacheRuntime& runtime, ImageView* color_buffer,
CreateFramebuffer(runtime, color_buffers, depth_buffer);
}
Framebuffer::~Framebuffer() = default;
void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime,
std::span<ImageView*, NUM_RT> color_buffers,
ImageView* depth_buffer) {

View File

@@ -162,6 +162,14 @@ public:
const VideoCommon::ImageViewInfo&, GPUVAddr);
explicit ImageView(TextureCacheRuntime&, const VideoCommon::NullImageViewParams&);
~ImageView();
ImageView(const ImageView&) = delete;
ImageView& operator=(const ImageView&) = delete;
ImageView(ImageView&&) = default;
ImageView& operator=(ImageView&&) = default;
[[nodiscard]] VkImageView DepthView();
[[nodiscard]] VkImageView StencilView();
@@ -235,6 +243,14 @@ public:
explicit Framebuffer(TextureCacheRuntime& runtime, ImageView* color_buffer,
ImageView* depth_buffer, VkExtent2D extent);
~Framebuffer();
Framebuffer(const Framebuffer&) = delete;
Framebuffer& operator=(const Framebuffer&) = delete;
Framebuffer(Framebuffer&&) = default;
Framebuffer& operator=(Framebuffer&&) = default;
void CreateFramebuffer(TextureCacheRuntime& runtime,
std::span<ImageView*, NUM_RT> color_buffers, ImageView* depth_buffer);