Closed vdrn closed 10 months ago
Hi!
Thanks for reporting this, seems I never tested with more than 1 #include
.
This should be fixed in the latest release (v1.0.5).
Hey thanks for quick response.
I'm still getting the same error. I'm using a different #version
of glsl so it could be connected to that..
This triggers the error:
#version 130
#include "shader_flags.glsl"
varying vec2 uv;
uniform sampler2D Texture;
void main() {
lowp vec4 tex = texture2D(Texture, uv);
gl_FragData[0] = tex;
}
shader_flags.glsl
can contain anything (a bunch of #define
s or even be empty) and the crash will still happen.
Ah yes, I was able to reproduce your issue: if there's an empty file, the syntax tree will be empty (except for the root node). I removed a stray assert in 272fe483f03deae395577d230eb0415c333b97d4 and now it works for me.
Try v1.0.6 and see if it works for you as well!
Ok, now it works fine if included file is empty or it contains functions/structs.
But, if included file contains #define
s, it stops working. It does not crash or report error, just returns empty responses for all requests.
So, for example, the same above example with shader_flags.glsl
containing:
#define ENABLE_BLOOM 1
Ah, clearly I had that assert in there for a reason. There was a loop which only terminates under the assumption that every syntax node has at least one child.
Thank you for being so patient. Hopefully v1.0.7 does the trick! :crossed_fingers:
No problem, I'm glad to be of help. It's working perfectly now!
Alright! Thank you for your time! :)
Trying to hover anything will result in crash:
Crash does not happen and hover works fine if there are no
#include
directives in file. Using latest releasex86_64-linux-musl
on Ubuntu 20.04. Please let me know if you need more info.