rsx/vk: Rework MSAA implementation

This commit is contained in:
kd-11 2022-03-13 11:32:04 +03:00 committed by kd-11
parent 9c5ed01130
commit bc7ed8eaab
30 changed files with 285 additions and 123 deletions

View file

@ -1101,9 +1101,19 @@ bool FragmentProgramDecompiler::handle_tex_srb(u32 opcode)
ensure(func_id <= FUNCTION::TEXTURE_SAMPLE_MAX_BASE_ENUM && func_id >= FUNCTION::TEXTURE_SAMPLE_BASE);
// Clamp type to 3 types (1d, 2d, cube+3d) and offset into sampling redirection table
const auto type_offset = (std::min(static_cast<int>(type), 2) + 1) * static_cast<int>(FUNCTION::TEXTURE_SAMPLE_BASE_ENUM_COUNT);
func_id = static_cast<FUNCTION>(static_cast<int>(func_id) + type_offset);
if (!(m_prog.texture_state.multisampled_textures & ref_mask)) [[ likely ]]
{
// Clamp type to 3 types (1d, 2d, cube+3d) and offset into sampling redirection table
const auto type_offset = (std::min(static_cast<int>(type), 2) + 1) * static_cast<int>(FUNCTION::TEXTURE_SAMPLE_BASE_ENUM_COUNT);
func_id = static_cast<FUNCTION>(static_cast<int>(func_id) + type_offset);
}
else
{
// Map to multisample op
ensure(type <= rsx::texture_dimension_extended::texture_dimension_2d);
properties.multisampled_sampler_mask |= ref_mask;
func_id = static_cast<FUNCTION>(static_cast<int>(func_id) - static_cast<int>(FUNCTION::TEXTURE_SAMPLE_BASE) + static_cast<int>(FUNCTION::TEXTURE_SAMPLE2DMS));
}
if (dst.exp_tex)
{