_I make this bugreport just to make you know, about status of Vulkan drivers in Nvidia_
this original bugreport to Khronos forum link
Bug confirmed on Nvidia 7XX, 9XX, 1XXX cards
Godot version:
Godot 4.0
OS/device including version:
Linux and Windows, Nvidia Only
Issue description:
the bug works on Linux and Windows, all drivers start from 2019(I did not test older)
imgur video link, how bug look like in Godot 4.0
Correct shader result this shader shadertoy link (fixed, link work now)
Bug is - just launch this shader, or any shader that uses fract(or mod) and floor
Godot 4.0 result:

Steps to reproduce:
shader code:
shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx,unshaded;
void vertex() {
}
vec4 mainImage( in vec2 fragCoord , vec2 iResolution)
{
vec2 st = fragCoord.xy/iResolution.xy;
float ratio = iResolution.x/iResolution.y;
st.x *= ratio;
float time = 1.+max(0.,min(0.,st.x));
vec3 color = vec3(0.0);
float rows = 30.0;
vec2 ipos = floor(st*rows);
vec2 fpos = fract(st*rows);
float pct = 1.0;
vec2 v=mod(fpos,vec2(9.));
pct *=v.x*v.y;
//BUG
if ((ipos.y > 0.0)||(ipos.x < fract(time))) {
color = vec3(pct);
}
//FIX
/*
if (ipos.y > 0.0) {
color = vec3(pct);
}
if (ipos.x < fract(time)) {
color = vec3(pct);
}
*/
return vec4(1.-color , 1.0);
}
void fragment() {
vec4 c=vec4(0.);
c=mainImage(UV*512., vec2(512.));
ALBEDO = c.rgb;
}
This shader works fine in OpenGL on the same hardware. (in Godot3 or webbrowser)
Minimal reproduction project:
Godot 4.0 project with this shader
shader_test.zip
Does the fix solve the issue?
If yes, then the issue is with logical operator ||?
Does the fix solve the issue?
fix solve only this shader
If yes, then the issue is with logical operator
||?
I have found this bug when sorting lots(hundreds) my shaders, and like "lots" of them got noise or other similar sort of bugs
all "snow-like shaders" that generate noise layers(from texture or shader random) broken, and lots of other shaders broken
I can list(show source) some of the bugged shaders, that have a real use, if you want
I did not dig too much to see "source of bug"(I do not want to spend weeks on that doing free job(I have enough of debugging, it cost way too much time for me, im not a free beta tester for corporations))
even if its only "or" operator bug... this is just impossible rewrite all shaders removing all or operator when even simple shaders use 10-20 if operators with or
also, this bug triggered only when all variables "local", if you make any variable as varying(even final color), original time is push-const and push-const is count as local, but if send this time as varying or uniform bug gone
change fract to vec2(ivec2(<VAL>*1000.)%1000)/1000.; also fix bug
change float time to:
varying float timex;
void vertex() {
timex=1.+max(0.,min(0.,UV.x));
}
and time=timex; in mainImage also fix bug
or change structure of this logic(with the same result) - bug gone... so it can be variables or floor/mod/fract operator bug(removing those operators or rewriting them also fix bug)
so for me this bug is global and ruin lots of my own shaders, randomly, fixing this bug "by hands" I do not see realistic
I have post bugreport to Nvidia forum and Khronos forum, I do not know if they gonna fix it
fixed in 456.71 Windows driver version
Most helpful comment
fixed in 456.71 Windows driver version