mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix for stereo with textureProj (emulated projection).
This commit is contained in:
parent
7d5bb79257
commit
931c869ca9
1 changed files with 4 additions and 1 deletions
|
@ -663,7 +663,10 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, const ShaderLangu
|
|||
// Used for stereo rendering.
|
||||
const char *arrayIndex = useStereo ? "float(gl_ViewIndex)" : "0.0";
|
||||
if (doTextureProjection) {
|
||||
WRITE(p, " vec4 t = %sProj(tex, vec4(%s, %s));\n", compat.texture, texcoord, arrayIndex);
|
||||
// There's no textureProj for array textures, so we need to emulate it.
|
||||
// Should be fine on any Vulkan-compatible hardware.
|
||||
WRITE(p, " vec2 uv_proj = (%s.xy) / (%s.z);\n", texcoord, texcoord);
|
||||
WRITE(p, " vec4 t = %s(tex, vec3(uv_proj, %s));\n", compat.texture, texcoord, arrayIndex);
|
||||
} else {
|
||||
WRITE(p, " vec4 t = %s(tex, vec3(%s.xy, %s));\n", compat.texture, texcoord, arrayIndex);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue