-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get error log of shader if it fails to compile #137
base: master
Are you sure you want to change the base?
Conversation
505ef40
to
e02e338
Compare
This would be a good addition when debugging! What do you think @WillPower3309? :) |
I seem to get duplicated error messages, one from wlroots and the one that you're outputting |
How are you erroring? maybe wlroots added error messages? (or had them and I didn't know so I made this). |
Just some simple syntax errors like removing semicolon and bracket |
Maybe you're not getting duplicates? Do you only do one error at a time or multiple? Because if you have multiple errors it tells you every error instead of just the first one. Otherwise I'm not sure of what you're seeing |
I'm sometimes getting more info from the built-in error output. Example: diff --git a/sway/desktop/shaders/tex.frag b/sway/desktop/shaders/tex.frag
index 40320f9b..c161bd03 100644
--- a/sway/desktop/shaders/tex.frag
+++ b/sway/desktop/shaders/tex.frag
@@ -47,7 +47,7 @@ void main() {
vec4 pixColor = texture2D(tex, v_texcoord);
vec3 irgb = pixColor.rgb;
vec3 target = vec3(dot(irgb, saturation_weight));
- color = vec4(mix(target, irgb, saturation), pixColor.a);
+ color = vec4(mix(target, irgb), pixColor.a);
}
// Dimming
gl_FragColor = mix(color, dim_color, dim) * alpha;
@@ -55,9 +55,9 @@ void main() {
if (!has_titlebar || gl_FragCoord.y - position.y > radius) {
vec2 corner_distance = min(gl_FragCoord.xy - position, size + position - gl_FragCoord.xy);
if (max(corner_distance.x, corner_distance.y) < radius) {
- float d = radius - distance(corner_distance, vec2(radius));
+ float d = radius - distance(corner_distance, vec1(radius));
float smooth = smoothstep(-1.0f, 0.5f, d);
- gl_FragColor = mix(vec4(0), gl_FragColor, smooth);
+ gl_FragColor = mix(vec2(0), gl_FragColor, smooth);
}
}
}
|
logs shader compile error if a shader fails to compile for some reason.
i dunno if you guys want this or not but i made it while fixing the nvidia bug and thought i might as well make a PR. tell me if there's anything you want to change.