Revert "fix compiler rr"

This commit is contained in:
CamilleLaVey 2026-04-25 18:17:32 -04:00
parent d3636df5eb
commit 9d75f52d6a
2 changed files with 16 additions and 12 deletions

View file

@ -1324,7 +1324,8 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const TSCEntry& config) {
} }
} }
Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM_RT> color_buffers, ImageView* depth_buffer, const VideoCommon::RenderTargets& key) { Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM_RT> color_buffers,
ImageView* depth_buffer, const VideoCommon::RenderTargets& key) {
framebuffer.Create(); framebuffer.Create();
GLuint handle = framebuffer.handle; GLuint handle = framebuffer.handle;

View file

@ -2370,7 +2370,7 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
// Some games have samplers with garbage. Sanitize them here. // Some games have samplers with garbage. Sanitize them here.
const f32 max_anisotropy = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f); const f32 max_anisotropy = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
const auto create_sampler = [&](const f32 anisotropy, bool sampler_compare_enable) { const auto create_sampler = [&](const f32 anisotropy, bool compare_enable) {
return device.GetLogical().CreateSampler(VkSamplerCreateInfo{ return device.GetLogical().CreateSampler(VkSamplerCreateInfo{
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
.pNext = pnext, .pNext = pnext,
@ -2384,11 +2384,12 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
.mipLodBias = tsc.LodBias(), .mipLodBias = tsc.LodBias(),
.anisotropyEnable = static_cast<VkBool32>(anisotropy > 1.0f ? VK_TRUE : VK_FALSE), .anisotropyEnable = static_cast<VkBool32>(anisotropy > 1.0f ? VK_TRUE : VK_FALSE),
.maxAnisotropy = anisotropy, .maxAnisotropy = anisotropy,
.compareEnable = sampler_compare_enable ? VK_TRUE : VK_FALSE, .compareEnable = compare_enable ? VK_TRUE : VK_FALSE,
.compareOp = MaxwellToVK::Sampler::DepthCompareFunction(tsc.depth_compare_func), .compareOp = MaxwellToVK::Sampler::DepthCompareFunction(tsc.depth_compare_func),
.minLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.0f : tsc.MinLod(), .minLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.0f : tsc.MinLod(),
.maxLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.25f : tsc.MaxLod(), .maxLod = tsc.mipmap_filter == TextureMipmapFilter::None ? 0.25f : tsc.MaxLod(),
.borderColor = has_custom_border_colors ? VK_BORDER_COLOR_FLOAT_CUSTOM_EXT : ConvertBorderColor(color), .borderColor = has_custom_border_colors ? VK_BORDER_COLOR_FLOAT_CUSTOM_EXT
: ConvertBorderColor(color),
.unnormalizedCoordinates = VK_FALSE, .unnormalizedCoordinates = VK_FALSE,
}); });
}; };
@ -2398,32 +2399,34 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
sampler = create_sampler(max_anisotropy, compare_enable); sampler = create_sampler(max_anisotropy, compare_enable);
if (compare_enable) { if (compare_enable) {
sampler_no_compare = create_sampler(max_anisotropy, false); sampler_no_compare = create_sampler(max_anisotropy, false);
} } else {
const f32 max_anisotropy_default = static_cast<f32>(1U << tsc.max_anisotropy); const f32 max_anisotropy_default = static_cast<f32>(1U << tsc.max_anisotropy);
if (max_anisotropy > max_anisotropy_default) { if (max_anisotropy > max_anisotropy_default) {
sampler_default_anisotropy = create_sampler(max_anisotropy_default, compare_enable); sampler_default_anisotropy = create_sampler(max_anisotropy_default, compare_enable);
if (compare_enable) { if (compare_enable) {
sampler_no_compare_default_anisotropy = create_sampler(max_anisotropy_default, false); sampler_no_compare_default_anisotropy = create_sampler(max_anisotropy_default, false);
} } else {
} }
} }
Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM_RT> color_buffers, ImageView* depth_buffer, const VideoCommon::RenderTargets& key) Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM_RT> color_buffers,
ImageView* depth_buffer, const VideoCommon::RenderTargets& key)
: render_area{VkExtent2D{ : render_area{VkExtent2D{
.width = key.size.width, .width = key.size.width,
.height = key.size.height, .height = key.size.height,
}} }} {
{
CreateFramebuffer(runtime, color_buffers, depth_buffer, key.is_rescaled); CreateFramebuffer(runtime, color_buffers, depth_buffer, key.is_rescaled);
if (runtime.device.HasDebuggingToolAttached()) { if (runtime.device.HasDebuggingToolAttached()) {
framebuffer.SetObjectNameEXT(VideoCommon::Name(key).c_str()); framebuffer.SetObjectNameEXT(VideoCommon::Name(key).c_str());
} }
} }
Framebuffer::Framebuffer(TextureCacheRuntime& runtime, ImageView* color_buffer, ImageView* depth_buffer, VkExtent2D extent, bool is_rescaled_) Framebuffer::Framebuffer(TextureCacheRuntime& runtime, ImageView* color_buffer,
: render_area{extent} ImageView* depth_buffer, VkExtent2D extent, bool is_rescaled_)
{ : render_area{extent} {
std::array<ImageView*, NUM_RT> color_buffers{color_buffer}; std::array<ImageView*, NUM_RT> color_buffers{color_buffer};
CreateFramebuffer(runtime, color_buffers, depth_buffer, is_rescaled_); CreateFramebuffer(runtime, color_buffers, depth_buffer, is_rescaled_);
} }