video_core: Fix fragment_shader compilation failure due to different … (#4775)
video_core: Fix fragment_shader compilation failure due to different …
This commit is contained in:
commit
5727e1b43d
|
@ -317,7 +317,7 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un
|
||||||
// Only unit 0 respects the texturing type
|
// Only unit 0 respects the texturing type
|
||||||
switch (state.texture0_type) {
|
switch (state.texture0_type) {
|
||||||
case TexturingRegs::TextureConfig::Texture2D:
|
case TexturingRegs::TextureConfig::Texture2D:
|
||||||
return "textureLod(tex0, texcoord0, getLod(texcoord0 * textureSize(tex0, 0)))";
|
return "textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))))";
|
||||||
case TexturingRegs::TextureConfig::Projection2D:
|
case TexturingRegs::TextureConfig::Projection2D:
|
||||||
// TODO (wwylele): find the exact LOD formula for projection texture
|
// TODO (wwylele): find the exact LOD formula for projection texture
|
||||||
return "textureProj(tex0, vec3(texcoord0, texcoord0_w))";
|
return "textureProj(tex0, vec3(texcoord0, texcoord0_w))";
|
||||||
|
@ -336,12 +336,12 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un
|
||||||
return "texture(tex0, texcoord0)";
|
return "texture(tex0, texcoord0)";
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
return "textureLod(tex1, texcoord1, getLod(texcoord1 * textureSize(tex1, 0)))";
|
return "textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))))";
|
||||||
case 2:
|
case 2:
|
||||||
if (state.texture2_use_coord1)
|
if (state.texture2_use_coord1)
|
||||||
return "textureLod(tex2, texcoord1, getLod(texcoord1 * textureSize(tex2, 0)))";
|
return "textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0))))";
|
||||||
else
|
else
|
||||||
return "textureLod(tex2, texcoord2, getLod(texcoord2 * textureSize(tex2, 0)))";
|
return "textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))))";
|
||||||
case 3:
|
case 3:
|
||||||
if (state.proctex.enable) {
|
if (state.proctex.enable) {
|
||||||
return "ProcTex()";
|
return "ProcTex()";
|
||||||
|
|
Reference in New Issue