There is a bug in the Vulkan driver for Android devices with the 6xx series Adreno GPUs. I have not found a device yet with a 6xx series Adreno that it does not reproduce on.
Basically, the following fragment shader code miscompiles (SPIR-V compiled with glslang):
#version 450
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
layout(location = 0) in vec4 oColor0;
layout(location = 1) in highp vec2 oTexCoord0;
layout(location = 0) out vec4 fragColor0;
layout(set = 0, binding = 1) uniform sampler2D Sampler0;
void main() {
vec4 v = texture(Sampler0, oTexCoord0).aaaa * oColor0;
if (v.r < 0.2 && v.g < 0.2 && v.b < 0.2) discard;
fragColor0 = vec4(0.0, 1.0, 0.0, 1.0);
}
The Adreno driver turns this into something that does not discard the pixel, no matter the value sampled from the texture.
I have a very easy repro. Download the latest APK of PPSSPP from
https://buildbot.orphis.net/ppsspp/ (or just download from the Play Store). Launch the app, then go into Settings, Tools, Developer Tools, GPU Driver Test. Select the second tab, "Shader".
Now look next to "Adreno logic". If you see some filled bright green rectangles on a dark green rectangle, you have the driver bug. If you see the text "TEST OK", everything is fine.
This has been around for a long time, would be nice to see it fixed.
hrydgard, hi!
Yes, I can reproduce bug.
https://photos.app.goo.gl/UkwbZUCS3FhRnyWN9
hrydgard, hi!
Yes, I can reproduce bug.
https://photos.google.com/share/AF1QipN9OJocirUkebDkTl6Bh-QvyRuLwM2-kZhi...