Home

Awesome

GPU-my-list-of-bugs

what is it - list of bugs I found writing shaders, mostly shader bugs.

Scroll down to table with screenshots

Contact: Join discord server


Some information related to GPU-stuff can be found it my blog:


Debug:

To test in Vulkan (Windows/Linux) - you can use my shader launcher (it compatible with most of shadertoy shaders):
Vulkan Shadertoy Launcher - follow instructions there.

On Windows:

OpenGL:

chrome.exe --use-angle=gl --incognito

Vulkan:

chrome.exe --use-angle=vulkan --enable-features=Vulkan,DefaultANGLEVulkan,VulkanFromANGLE --incognito

Swiftshader: (do not use it super bugged and broken - there no way to know is it bug in swiftshader on in your code, it also crash) chrome.exe --use-gl=swiftshader-webgl --incognito

On Linux:

OpenGL:

/usr/bin/google-chrome-stable

To force Nvidia GPU over integrated (when display connected to integrated, and Nvidia is second):

export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
/usr/bin/google-chrome-stable

Vulkan:

/usr/bin/google-chrome-stable --use-angle=vulkan --enable-features=Vulkan,DefaultANGLEVulkan,VulkanFromANGLE --incognito

To force Nvidia for Vulkan - way too complicated - Chrome by default should use discrete when launch in Vulkan mode.
(Chrome may not work in Vulkan mode for some reason - especially on new(2023+) Nvidia GPUs)

OpenGL llvmpipe (CPU emulation): (very stable, useful)

Firefox in its own x11 server:
Xephyr -br -ac -noreset -screen 1280x720 :10&

And launch firefox there DISPLAY=:10 XDG_SESSION_TYPE=x11 firefox
(do not launch chrome this way, chrome will use swiftshader instead of llvmpipe)
To see llvmpipe used - DISPLAY=:10 glxinfo | grep OpenGL | grep string

Without x11 server:
LIBGL_ALWAYS_SOFTWARE=1 __GLX_VENDOR_LIBRARY_NAME=mesa VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.i686.json:/usr/share/vulkan/icd.d/lvp_icd.x86_64.json firefox

Vulkan llvmpipe (CPU emulation): (~stable)

In Linux install package something like libvulkan_lvp - Mesa vulkan driver for LVP (use package search in your Linux).
And select --gpu=0 in my vulkan-shadertoy-launcher launch line option.
GPU should be detected as:
Vulkan GPU - CPU: llvmpipe (LLVM 13.0.0, 256 bits)...


List of shader bugs:

Shadertoy links, click on Screenshot previews to see full image.

Screenshot, click to openBug link
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/wdVyWD.png" width="650" height="auto" />BUG ANGLE dFd broken on break - Angle bug
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/NslGR4.png" width="650" height="auto" />BUG Nvidia const to array (array index bug) - Nvidia OpenGL and Vulkan driver shader compiler bug, Other Nvidia OpenGL bugs in array
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/NtlyWn.png" width="650" height="auto" />BUG Vulkan AMD array indexing (array index bug) - AMD Vulkan driver bug, bugreport. And if you combine this code with Nvidia Vulkan array indexing bug - you can have shader that bugged on both Nvidia and AMD at same time (yeee super cool).
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/wdXGW8.png" width="650" height="auto" />BUG Rand/Hash pre-calculated - I think this is not expected, related to blog post Float precision on GPU, bugs/features
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/tlfBRB.png" width="650" height="auto" />BUG floatBitsToUint comp vs real - related to blog post Float precision on GPU, bugs/features
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/DdySWW.png" width="650" height="auto" />BUG floatBits uintBits - different version of same bug above - shader pre-compiler change behavior of pre-compiled values when used uintBitsToFloat.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/stK3WG.png" width="650" height="auto" />BUG Vulkan Nvidia sin hash - sin hash broken in Vulkan on Nvidia, when in OpenGL everything fine.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/7ddfzr.jpg" width="650" height="auto" />BUG sin not same on AMD/Nvidia - similar as "sin hash broken" above, but in not-noise shader, in fractal shader sin making different visual image.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/7ddfzr_mod2pi.jpg" width="650" height="auto" />BUG mod2pi does not fix sin/cos AMD/Nvidia - same shader as above, uncomment first two lines with define, obvious idea to fix sin inconsistensy just mod(x,2*PI) but it not just "not fix" it change pattern on Nvidia where it was working, on Nvidia pattern on left side with define will be different compare to no define.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/NtfyD2.png" width="650" height="auto" />BUG Nvidia OpenGL ruins float - Nvidia OpenGL GLSL compiler somehow ruins float, look code.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/WscyRM.png" width="650" height="auto" />Test shader - OS detector - Nvidia 4060 - framebuffers and youtube-panorama videos are broken in Chrome-Vulkan. Video, Chrome.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/l3fXzn.png" width="650" height="auto" />BUG Float loop iterations - Never use float as loop-iterator, this can be considered as "not a bug" and expected, but Nvidia have some special float-behavior in OpenGL, I think this is reason for this.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/MX2Xzh.png" width="650" height="auto" />BUG AMD textureGrad vs discard - Bug - it look like conflict of discard and textureGrad, bug works only in Linux on new mesa in AMD in OpenGL, found it in this shader.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/MfsBz8.jpg" width="650" height="auto" />BUG AMD performance dFd if ruin - When this specific shader run in 32-bit buffer - it get 1000x slowdown because use of fwidth/dFd and if condition after - idk it so weird, when it run in 8-bit buffer - its fine no slowdown, related to shader compiler I think. AMD

BUG Nvidia Vulkan driver no comp - Nvidia Vulkan driver compiler bug, happening in Chrome

BUG Angle 20x slowdown - DX11 FXC bug

BUG AMD branching optimization - I do not know is it AMD or ANGLE bug - bug works only in ANGLE, and I tested it only in AMD.

BUG Chrome or Nvidia compiling - Nvidia OpenGL compiler bug

BUG Vulkan AMD crash - old bug, fixed already

BUG Vulkan AMD loop bug - old bug, fixed already

BUG Vulkan Nvidia noise bug - fixed already, but very weird - basically all shaders that use fract and mod was bugged in Nvidia Vulkan for 5 years and no one noticed... Videos of this bug 1 2

BUG OpenGL Nvidia high GPU usage - Nvidia OpenGL compiler bug

BUG smoothstep( 1, 0 ,0) specs - smoothsep on GPU does not follow specs, when on CPU it does.

BUG Nvidia OpenGL compiler bug - Nvidia OpenGL compiler bug, fixed in 510+ driver.

Old GLES2 depth write bug on AMD - still broken, I think it another wontfix because no one care about OpenGL. (Note - by clicking this link you may trigger interesting web-bug, look below "Interesting amd forums bug" - just press enter in address text in webbrowser if you get 403)


Not a Bug, its expected behavior but it still weird

Screenshot, click to openBug link
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/4fffR7_ip.jpg" width="650" height="auto" />one of my shaders on iPhone - video webm link This my shader TV Scene, wall of TV run on iPhone - fad from Shadertoy discord shared this video.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/7tjGRW.png" width="650" height="auto" />BUG Nvidia OpenGL arrays wrong (array and matX indexing) - only Nvidia OpenGL. Can be considered as "not a bug" because UB line 29 ext_3[return_zero()] += -2147483648 as function argument, so in unknown what will be first += or passing as parameter.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/sllXW8.png" width="650" height="auto" />BUG 32-bit float precision - related to blog post Float precision on GPU, bugs/features
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/ftXXW4.png" width="650" height="auto" />BUG 32-bit float precision test - Look function colorAniso() in shader, for some reason this noise happens when camera look on plane(explained there). Also I use this shader to compare 32bit floats vs 64 bit floats. (more shaders to compare float vs double Shadertoy shader, list in comments )
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/NlXXWS.png" width="650" height="auto" />BUG GPU driver unroll prediction - using break in loop adds precision to operation, expected because shader compiler compile shader diferently for each case.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/ftXSWB.png" width="650" height="auto" />BUG GPU precision never 0 - related to blog post Float precision on GPU, bugs/features
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/fsc3RM.png" width="650" height="auto" />BUG Nvidia Vulkan UB behavior - weird UB behavior that result not same image depends on GPU, Vulkan only
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/nv_double_specs_crash.png" width="650" height="auto" />Using double in functions that does not support double may result crash after launching shader, on screenshot application crashed after rendering first frame in shader code exp(dvec2(sqrt(exp can only precess 16 and 32 bit floats by specs). Link to zip with exe to test bug_nv_double_specs_crash.zip
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/7lt3Rl.png" width="650" height="auto" />BUG normalize bugs - related to Cubemap GLSL shader debug functions - normalize does not return vector with length 1.0
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/NsBBDW.png" width="650" height="auto" />BUG float precision patterns - patterns of sin, sqrt diferent between GPUs (look screenshot), related to Float precision on GPU, bugs/features
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/ftXcW7.png" width="650" height="auto" />BUG linear interpolation test - float linear interpolation test on diferent GPU diferent result (look comments in code)
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/ftlcDS_2.png" width="650" height="auto" />BUG 32-bit float pattern 2 - behavior related to losing float precision on small and large numbers, read comment and look two screenshots on shadertoy page. When screen has square size then determinant and inverse return some small and large numbers that leads to precision loss and this pattern on screenshot.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/upl_demos/pathtracer/repetition_pattern.png" width="650" height="auto" />TEST noise repetition - patters of fract and sin hash and noise, by searching same values on image. histogram of noise
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/cdB3WG.png" width="650" height="auto" />BUG STL slowdown - Only Nvidia OpenGL slowdown, OpenGL Nvidia shader compiler for some reason dont like when arrray is argument. Related to Decompiling Nvidia shaders, and optimizing blog.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/dd23Dc.png" width="650" height="auto" />Optimized ML/Neural shader - Nvidia case when CONST buffer become too large and it destroy performance. Related to Decompiling Nvidia shaders, and optimizing blog.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/mdfSz8.png" width="650" height="auto" />BUG Nvidia float as argument bug - (OpenGL and Vulkan) Nvidia OpenGL GLSL compiler somehow generates wrong floats when const floats used as argument of function, look code. (look like this is not bug, its compiler inconsistency, read shader code comments) (the "bug" is - floor((900./37.)*1000.)/1000. is 24.323999 on CPU and 24.324001 on GPU)
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/dtXGW4_vk_nv.png" width="650" height="auto" />TEST - About fract-hash consistensy. Comparison for Rough Seas shader, discussion Hash without Sine. Look this two gif - OpenGL AMD (red) and Nvidia (green) and Vulklan AMD when iTime calculated on GPU as non-const and when it is const. On screenshot left - Vulkan Nvidia there appears lines I think because of sincos implementation on Nvidia. To test - #define iTime (8998.3+floor((900./37.)*1000.+float(min(iFrame,0)))/1000.) to Rough Seas shader code, to test iTime as const - remove +float(min(iFrame,0)).
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/mt33RH_2.png" width="650" height="auto" />BUG Cubemap rendering order on load - WebGL behavior depends on GPU and rendering API. Watch this youtube video.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/Dl3Szn_1.png" width="650" height="auto" />BUG float calc inconsistency - Bug is - I was debugging/making TAA and was comparing result of "my controlable camera" to "static camera" - and result were not equal when camera matrix and everything was equal, I tested every single value line by line, and in TAA I was worrying that I miss "pixel jittering" somewhere and result was pointing on it... to not spread confusstion - this is "not bug" I just forgot that GPU are inconsistant in float computations, and when two equal values come from different sources result of operations on them will be not equal to same float value that come from single source.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/dldXR4.png" width="650" height="auto" />BUG float calc inconsistency - Bug is - result of ro1 + rd - ro2 where ro1 and ro2 is equal - will not be equal to rd. Same as BUG GPU precision never 0.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/bug_nv_s_ub.png" width="650" height="auto" />Bug with Undefined Behavior in Nvidia GPUs, and since this is UB it can be considered as expected behavior. This is third version of similar UB behaviour bug I reported before(to Nvidia and Chrome in bugreports). Most strange for me(and why I think this is bug) - visual result generated by shader changed/reacting to outside activity (other apps that use GPU). Watch this video(Youtube) to see this bug behavior. Download exe/linux version bug_nv_ub_leaks_v3_1.zip with shader source.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/XcjyWz.jpg" width="650" height="auto" />4-th edition of bug above with uninitialized variables, but now it work on AMD GPU(only OpenGL only Linux), when before it was not. This youtube video show it working. Mentioned in this changelog (search s48).
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/sltGWj.jpg" width="650" height="auto" />BUG Mip inconsistent Vulkan/Ogl - When sampler2D have no mipmaps but has linear filter and shader has push_const - functions texture has some unpredictable result. (woks only in this specific shader(shader made from other large shader where I found this bug)). Bug does not work when shader does not have push_constants. Bug work on Shadertoy only in OpenGL mode chrome.exe --use-angle=gl and only when FBO has mipmaps. But in OpenGL this is "not a bug" or atleast it can be explained. Update 2023 - now this bug works in Webbgowser but mipmaps required Chrome. Youtube video of this bug. This shader also include second bug/behavior - on video 00:31 - but I think this is Shadertoy website behavior - alpha-value of mipmap change not same as rgb value when it supposed to be same.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/Xc23DW_1.jpg" width="650" height="auto" />BUG TEST Rough Seas fract hash - Just test shader for this blog post Hash Noise stability in GPU Shaders, blog mirror.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/4fSXDd.png" width="650" height="auto" />Related-example of fract-hash instability described in blog post Hash Noise stability in GPU Shaders, blog mirror. Shader link.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/4cdSR4.png" width="650" height="auto" />BUG WebGL wrong compile error - 1./0. generate uintBitsToFloat error in Firefox - for some reason.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/ff310.png" width="650" height="auto" />Firefox bugreport with details and code - float [1024] arr; - Firefox 130 does not allow const data >=1024 - incorrectly ignoring MAX_FRAGMENT_UNIFORM_COMPONENTS
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/McGGz1.png" width="650" height="auto" />Chrome 129 very weird bug - watch this video-clip - in Shadertoy buffer only - variable can not be named with outColor - it works in Firefox.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/4cyXRh_vs_XcyXRh.png" width="650" height="auto" />TEST bits 32 r/w block[8x2] and TEST bits r/w block[8x8x8] - Again about STL in Nvidia shader, read blog Decompiling Nvidia shaders or blog-mirror. Result OpenGL Nvidia 4060 block[8x8x8] - 20FPS on 1080p, block[8x2] - 60fps on 1080p. Vulkan - I get 60fps on both but with block[8x8x8] is 100% GPU usage when block[8x2] is 30% GPU usage.
<img src="https://danilw.github.io/GLSL-howto/vulkan_sh_launcher/images_bugs/4cKfzc.png" width="650" height="auto" />mat3x2(mat2x3) GLSL convertion order

Nvidia OpenGL can not compile this shader - arrays - for some reason Nvidia driver(555) compiler crash because of mi_o_y function - I fixed it by clamp array range, if remove clamp in arrays in mi_o_y function - bug will work.

BUG Vulkan uint32 128 bytes push constant (does not work from WebGL, need modification read Shadertoy comment) - (not a bug) - just reminder for myself: in Vulkan - Any member of a push constant block that is declared as an array must only be accessed with dynamically uniform indices. If you use array as push const then result will be this - screenshot 1, screenshot 2. Do not use array as push-constant in Vulkan. khronos.org/registry/vulkan/specs

BUG Vulkan not equal to OpenGL - UB behavior in OpenGL and Vulkan. I think it because CPU-side precompilation result UB diferently.

BUG cubemap rayDir to fragCoord - related to Cubemap GLSL shader debug functions

BUG tile rendering dFd test - not a bug, its expected behavior - dFd and texture functions return wrong result on edges when tile size not even. Related to tile rendering example and advanced tile render (look line 4 in Common)

AMD bindless seems bugged - links to bugreports 1 2 3. I was debugging/looking GL_ARB_bindless_texture in app Nu.Gaia originally and coult not see obvious reasons why it not work on AMD only. Khronos Bindless_Texture say - "Bindless textures are not safe. The API is given fewer opportunities to ensure sane behavior; it is up to the programmer to maintain integrity." - and there no tools to debug, renderdoc does not support bindless, only what working I found is apitrace and glintercept - but they also show everything same on amd/nvidia, so I have no idea why this is not working on amd. As you see on video - other apps that use bindless also bugged on amd, so I assumed, may be wrong - that "it is amd driver bug/behavior with bindless".

Chrome Vulkan: Fix line-loop draw arrays after elements - Google confirmed and fixed one Vulkan related bug in their browser.

Interesting amd forums bug, not related to graphics, just funny.


Angle experience - some of bug-related experience (unexpected behavior when your code is fine) - launching my GLSL card game in ANGLE fist time (video), Godot in ANGLE FBO size jump (video), till 2019 (pre 76 version) Chrome had broken instanced particles support.


Driver updates:

Summer 2021 AMD update their driver (Linux and Windows, close and opensource) with fixing all my bugs that I reported during 2020-2021. Vulkan only fixes, OpenGL still very broken there. (that makes my GLSL Auto Tetris and other my demos work in Vulkan on AMD GPUs)