video_core: Avoid setting alpha tev with Dot3_RGBA8 color op (#6907)

* Further reduces unnecessary shader regenerations
This commit is contained in:
GPUCode 2023-08-27 01:48:45 +03:00 committed by GitHub
parent f2e0748a22
commit 61cf550d0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View file

@ -99,6 +99,11 @@ PicaFSConfig PicaFSConfig::BuildFromRegs(const Pica::Regs& regs, bool use_normal
state.tev_stages[i].modifiers_raw = tev_stage.modifiers_raw; state.tev_stages[i].modifiers_raw = tev_stage.modifiers_raw;
state.tev_stages[i].ops_raw = tev_stage.ops_raw; state.tev_stages[i].ops_raw = tev_stage.ops_raw;
state.tev_stages[i].scales_raw = tev_stage.scales_raw; state.tev_stages[i].scales_raw = tev_stage.scales_raw;
if (tev_stage.color_op == TevStageConfig::Operation::Dot3_RGBA) {
state.tev_stages[i].sources_raw &= 0xFFF;
state.tev_stages[i].modifiers_raw &= 0xFFF;
state.tev_stages[i].ops_raw &= 0xF;
}
} }
state.fog_mode = regs.texturing.fog_mode; state.fog_mode = regs.texturing.fog_mode;
@ -226,8 +231,9 @@ PicaFSConfig PicaFSConfig::BuildFromRegs(const Pica::Regs& regs, bool use_normal
state.shadow_rendering = regs.framebuffer.output_merger.fragment_operation_mode == state.shadow_rendering = regs.framebuffer.output_merger.fragment_operation_mode ==
FramebufferRegs::FragmentOperationMode::Shadow; FramebufferRegs::FragmentOperationMode::Shadow;
if (state.shadow_rendering) {
state.shadow_texture_orthographic = regs.texturing.shadow.orthographic != 0; state.shadow_texture_orthographic = regs.texturing.shadow.orthographic != 0;
}
state.use_custom_normal_map = use_normal; state.use_custom_normal_map = use_normal;

View file

@ -102,6 +102,11 @@ PicaFSConfig::PicaFSConfig(const Pica::Regs& regs, const Instance& instance) {
state.tev_stages[i].modifiers_raw = tev_stage.modifiers_raw; state.tev_stages[i].modifiers_raw = tev_stage.modifiers_raw;
state.tev_stages[i].ops_raw = tev_stage.ops_raw; state.tev_stages[i].ops_raw = tev_stage.ops_raw;
state.tev_stages[i].scales_raw = tev_stage.scales_raw; state.tev_stages[i].scales_raw = tev_stage.scales_raw;
if (tev_stage.color_op == TevStageConfig::Operation::Dot3_RGBA) {
state.tev_stages[i].sources_raw &= 0xFFF;
state.tev_stages[i].modifiers_raw &= 0xFFF;
state.tev_stages[i].ops_raw &= 0xF;
}
} }
state.fog_mode.Assign(regs.texturing.fog_mode); state.fog_mode.Assign(regs.texturing.fog_mode);
@ -230,9 +235,10 @@ PicaFSConfig::PicaFSConfig(const Pica::Regs& regs, const Instance& instance) {
state.shadow_rendering.Assign(regs.framebuffer.output_merger.fragment_operation_mode == state.shadow_rendering.Assign(regs.framebuffer.output_merger.fragment_operation_mode ==
FramebufferRegs::FragmentOperationMode::Shadow); FramebufferRegs::FragmentOperationMode::Shadow);
if (state.shadow_rendering) {
state.shadow_texture_orthographic.Assign(regs.texturing.shadow.orthographic != 0); state.shadow_texture_orthographic.Assign(regs.texturing.shadow.orthographic != 0);
} }
}
void PicaShaderConfigCommon::Init(const Pica::RasterizerRegs& rasterizer, void PicaShaderConfigCommon::Init(const Pica::RasterizerRegs& rasterizer,
const Pica::ShaderRegs& regs, Pica::Shader::ShaderSetup& setup) { const Pica::ShaderRegs& regs, Pica::Shader::ShaderSetup& setup) {