mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	settings: remove global override for smash on amdvlk
This commit is contained in:
		@@ -435,8 +435,6 @@ struct Values {
 | 
			
		||||
        linkage, false, "disable_shader_loop_safety_checks", Category::RendererDebug};
 | 
			
		||||
    Setting<bool> enable_renderdoc_hotkey{linkage, false, "renderdoc_hotkey",
 | 
			
		||||
                                          Category::RendererDebug};
 | 
			
		||||
    // TODO: remove this once AMDVLK supports VK_EXT_depth_bias_control
 | 
			
		||||
    bool renderer_amdvlk_depth_bias_workaround{};
 | 
			
		||||
    Setting<bool> disable_buffer_reorder{linkage, false, "disable_buffer_reorder",
 | 
			
		||||
                                         Category::RendererDebug};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -425,11 +425,6 @@ struct System::Impl {
 | 
			
		||||
            room_member->SendGameInfo(game_info);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Workarounds:
 | 
			
		||||
        // Activate this in Super Smash Brothers Ultimate, it only affects AMD cards using AMDVLK
 | 
			
		||||
        Settings::values.renderer_amdvlk_depth_bias_workaround =
 | 
			
		||||
            params.program_id == 0x1006A800016E000ULL;
 | 
			
		||||
 | 
			
		||||
        status = SystemResultStatus::Success;
 | 
			
		||||
        return status;
 | 
			
		||||
    }
 | 
			
		||||
@@ -489,9 +484,6 @@ struct System::Impl {
 | 
			
		||||
            room_member->SendGameInfo(game_info);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Workarounds
 | 
			
		||||
        Settings::values.renderer_amdvlk_depth_bias_workaround = false;
 | 
			
		||||
 | 
			
		||||
        LOG_DEBUG(Core, "Shutdown OK");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1054,39 +1054,16 @@ void RasterizerVulkan::UpdateDepthBias(Tegra::Engines::Maxwell3D::Regs& regs) {
 | 
			
		||||
                        regs.zeta.format == Tegra::DepthFormat::X8Z24_UNORM ||
 | 
			
		||||
                        regs.zeta.format == Tegra::DepthFormat::S8Z24_UNORM ||
 | 
			
		||||
                        regs.zeta.format == Tegra::DepthFormat::V8Z24_UNORM;
 | 
			
		||||
    bool force_unorm = ([&] {
 | 
			
		||||
        if (!is_d24 || device.SupportsD24DepthBuffer()) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        if (device.IsExtDepthBiasControlSupported()) {
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
    if (is_d24 && !device.SupportsD24DepthBuffer() && program_id == 0x1006A800016E000ULL) {
 | 
			
		||||
        // Only activate this in Super Smash Brothers Ultimate
 | 
			
		||||
        // Affects AMD cards using AMDVLK
 | 
			
		||||
        if (program_id != 0x1006A800016E000ULL) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        // the base formulas can be obtained from here:
 | 
			
		||||
        //   https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-output-merger-stage-depth-bias
 | 
			
		||||
        const double rescale_factor =
 | 
			
		||||
            static_cast<double>(1ULL << (32 - 24)) / (static_cast<double>(0x1.ep+127));
 | 
			
		||||
        units = static_cast<float>(static_cast<double>(units) * rescale_factor);
 | 
			
		||||
        return false;
 | 
			
		||||
    })();
 | 
			
		||||
    }
 | 
			
		||||
    scheduler.Record([constant = units, clamp = regs.depth_bias_clamp,
 | 
			
		||||
                      factor = regs.slope_scale_depth_bias, force_unorm,
 | 
			
		||||
                      precise = device.HasExactDepthBiasControl()](vk::CommandBuffer cmdbuf) {
 | 
			
		||||
        if (force_unorm) {
 | 
			
		||||
            VkDepthBiasRepresentationInfoEXT info{
 | 
			
		||||
                .sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT,
 | 
			
		||||
                .pNext = nullptr,
 | 
			
		||||
                .depthBiasRepresentation =
 | 
			
		||||
                    VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORCE_UNORM_EXT,
 | 
			
		||||
                .depthBiasExact = precise ? VK_TRUE : VK_FALSE,
 | 
			
		||||
            };
 | 
			
		||||
            cmdbuf.SetDepthBias(constant, clamp, factor, &info);
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
                      factor = regs.slope_scale_depth_bias](vk::CommandBuffer cmdbuf) {
 | 
			
		||||
        cmdbuf.SetDepthBias(constant, clamp, factor);
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user