rsx: Apply alpha test for all primitive types

Enables alpha test for point sprites, lines, etc as required by the GL spec.
This commit is contained in:
Antonino Di Guardo
2026-08-03 22:58:25 +00:00
committed by GitHub
parent 228d04195d
commit 4214dff35e
+15 -15
View File
@@ -2176,26 +2176,11 @@ namespace rsx
current_fragment_program.ctrl |= RSX_SHADER_CONTROL_ATTRIBUTE_INTERPOLATION;
}
if (m_ctx->register_state->alpha_test_enabled())
{
current_fragment_program.ctrl |= RSX_SHADER_CONTROL_ALPHA_TEST;
}
if (m_ctx->register_state->polygon_stipple_enabled())
{
current_fragment_program.ctrl |= RSX_SHADER_CONTROL_POLYGON_STIPPLE;
}
if (m_ctx->register_state->msaa_alpha_to_coverage_enabled())
{
const bool is_multiple_samples = m_ctx->register_state->surface_antialias() != rsx::surface_antialiasing::center_1_sample;
if (!backend_config.supports_hw_a2c || (!is_multiple_samples && !backend_config.supports_hw_a2c_1spp))
{
// Emulation required
current_fragment_program.ctrl |= RSX_SHADER_CONTROL_ALPHA_TO_COVERAGE;
}
}
current_fragment_program.ctrl |= get_fragment_program_export_config();
}
else if (m_ctx->register_state->point_sprite_enabled() &&
@@ -2205,6 +2190,21 @@ namespace rsx
current_fragment_program.texcoord_control_mask |= u32(m_ctx->register_state->point_sprite_control_mask()) << 16;
}
if (m_ctx->register_state->alpha_test_enabled())
{
current_fragment_program.ctrl |= RSX_SHADER_CONTROL_ALPHA_TEST;
}
if (m_ctx->register_state->msaa_alpha_to_coverage_enabled())
{
const bool is_multiple_samples = m_ctx->register_state->surface_antialias() != rsx::surface_antialiasing::center_1_sample;
if (!backend_config.supports_hw_a2c || (!is_multiple_samples && !backend_config.supports_hw_a2c_1spp))
{
// Emulation required
current_fragment_program.ctrl |= RSX_SHADER_CONTROL_ALPHA_TO_COVERAGE;
}
}
// Check if framebuffer is actually an XRGB format and not a WZYX format
switch (m_ctx->register_state->surface_color())
{