Closed pdesaulniers closed 5 years ago
Ok, thanks for this report.
A short first assessment of this: I need to add a different optional, more robust way of passing in certain large data (the LUT uniform float lut[2 * LUT_SIZE]
) into the GLSL shader.
The trace above is probably the problem described here: https://stackoverflow.com/questions/53313978/uniform-registers-requirement-on-nvidia-with-a-sampler-in-vertex-shader
Workarounds are UBOs or textures: https://stackoverflow.com/questions/20647207/glsl-replace-large-uniform-int-array-with-buffer-or-texture
AFAIK love2d doesn't support UBOs at this time (I might be wrong, need to research). So I should look into passing in lut
as a texture (which might be slow due to a binary search done on it).
Further analysis: the effect described in https://stackoverflow.com/questions/53313978/uniform-registers-requirement-on-nvidia-with-a-sampler-in-vertex-shader matches the bug described here. Tove also uses values from a uniform array as coordinates/parameters to ensuing texture()
calls.
Since we're in the context of LÖVE (restricted GLSL features), options are limited. For now, I reduced the uniform buffer sizes and applied the workaround described under https://sergeyext.github.io/sergeyext/nvidia_abnormal_gpr_requirement.html, namely putting the uniform sampler2D
declaration before the uniform array declarations (see https://github.com/poke1024/tove2d/commit/c847fc35c5e0558bd3bcfc2a986e11b082a42676#diff-2b285b33a182216545ae00750b327cad). Maybe that makes a difference?
OK, it runs now: I guess we can close this issue in favor of https://github.com/poke1024/tove2d/issues/1 .
Now, I'm getting the following error:
(insert lots of internal assembly text here)
I'm using a GeForce GTX 860M with the proprietary drivers on Linux.