Skip to content

Commit

Permalink
vk: don't depend on current clamping values when compiling shader
Browse files Browse the repository at this point in the history
Fog clamping values may change so the shader shouldn't depend on the
current value when compiling.
Fixes Red Dog Superior Firepower glitch.
Issue #1642
  • Loading branch information
flyinghead committed Sep 18, 2024
1 parent 079180f commit 915532f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/rend/vulkan/oit/oit_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void OITPipelineManager::CreatePipeline(u32 listType, bool autosort, const PolyP
OITShaderManager::FragmentShaderParams params = {};
params.alphaTest = listType == ListType_Punch_Through;
params.bumpmap = pp.tcw.PixelFmt == PixelBumpMap;
params.clamping = pp.tsp.ColorClamp && (pvrrc.fog_clamp_min.full != 0 || pvrrc.fog_clamp_max.full != 0xffffffff);
params.clamping = pp.tsp.ColorClamp;
params.insideClipTest = (pp.tileclip >> 28) == 3;
params.fog = config::Fog ? pp.tsp.FogCtrl : 2;
params.gouraud = pp.pcw.Gouraud;
Expand Down
2 changes: 1 addition & 1 deletion core/rend/vulkan/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ void PipelineManager::CreatePipeline(u32 listType, bool sortTriangles, const Pol
FragmentShaderParams params = {};
params.alphaTest = listType == ListType_Punch_Through;
params.bumpmap = pp.tcw.PixelFmt == PixelBumpMap;
params.clamping = pp.tsp.ColorClamp && (pvrrc.fog_clamp_min.full != 0 || pvrrc.fog_clamp_max.full != 0xffffffff);
params.clamping = pp.tsp.ColorClamp;
params.insideClipTest = (pp.tileclip >> 28) == 3;
params.fog = config::Fog ? pp.tsp.FogCtrl : 2;
params.gouraud = pp.pcw.Gouraud;
Expand Down

0 comments on commit 915532f

Please sign in to comment.