Skip to content

Commit

Permalink
Fix edge case in bilinear sampling when Q is 0.
Browse files Browse the repository at this point in the history
Fixes map rendering in The OneeChambara 2.
  • Loading branch information
jpd002 committed Apr 17, 2024
1 parent 57f8a13 commit 07c1898
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Source/gs/GSH_Vulkan/GSH_VulkanDrawDesktop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,9 @@ Framework::Vulkan::CShaderModule CDrawDesktop::CreateFragmentShader(const PIPELI
auto textureColorD = CFloat4Lvalue(b.CreateVariableFloat("textureColorD"));

textureLinearPos = (textureSt * ToFloat(texSize)) + NewFloat2(b, -0.5f, -0.5f);
textureLinearAb = Fract(textureLinearPos);
//Check if ST is infinite due to being divided by a Q equal to zero.
//Happens in map rendering for Simple 2000 Series Vol. 90 - The OneeChambara 2.
textureLinearAb = Mix(Fract(textureLinearPos), NewFloat2(b, 0, 0), IsInf(textureSt));

textureIuv0 = ToInt(textureLinearPos);
textureIuv1 = textureIuv0 + NewInt2(b, 1, 1);
Expand Down
2 changes: 1 addition & 1 deletion deps/Framework

0 comments on commit 07c1898

Please sign in to comment.