Merge pull request #10488 from JosJuice/logic-ops-logic

PixelShaderGen: Check uid_data for use_shader_logic_op
This commit is contained in:
JMC47 2022-02-28 12:12:52 -05:00 committed by GitHub
commit 56a98532e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 26 deletions

View File

@ -944,9 +944,9 @@ ShaderCode GeneratePixelShaderCode(APIType api_type, const ShaderHostConfig& hos
(!DriverDetails::HasBug(DriverDetails::BUG_BROKEN_DUAL_SOURCE_BLENDING) ||
uid_data->useDstAlpha);
const bool use_shader_blend =
!use_dual_source && (uid_data->useDstAlpha && host_config.backend_shader_framebuffer_fetch);
const bool use_shader_logic_op =
!host_config.backend_logic_op && host_config.backend_shader_framebuffer_fetch;
!use_dual_source && uid_data->useDstAlpha && host_config.backend_shader_framebuffer_fetch;
const bool use_shader_logic_op = !host_config.backend_logic_op && uid_data->logic_op_enable &&
host_config.backend_shader_framebuffer_fetch;
if (api_type == APIType::OpenGL || api_type == APIType::Vulkan)
{
@ -1949,8 +1949,6 @@ static void WriteFog(ShaderCode& out, const pixel_shader_uid_data* uid_data)
static void WriteLogicOp(ShaderCode& out, const pixel_shader_uid_data* uid_data)
{
if (uid_data->logic_op_enable)
{
static constexpr std::array<const char*, 16> logic_op_mode{
"int4(0, 0, 0, 0)", // CLEAR
"prev & fb_value", // AND
@ -1972,7 +1970,6 @@ static void WriteLogicOp(ShaderCode& out, const pixel_shader_uid_data* uid_data)
out.Write("\tint4 fb_value = iround(initial_ocol0 * 255.0);\n");
out.Write("\tprev = {};\n", logic_op_mode[uid_data->logic_op_mode]);
}
}
static void WriteColor(ShaderCode& out, APIType api_type, const pixel_shader_uid_data* uid_data,