Hey Love2D Team. I LOVE Love2D, first of all, and want to convey my gratitude to those who design and maintain it!
My issue has to do with errors thrown upon Love2D discovering unused shader uniforms. It occurs in cases where either the uniform is defined (and updated from the main program) and not used anywhere in the shader body, but also when it IS used in the shader body, only not contributing to the final output. The uniform data must contribute to the output or else Love2D throws the error. I've repeatedly found this to be frustrating as it is common to explore various ideas while writing shaders, sometimes requiring temporary commenting-out of variables, lines of code, etc. Is there a reason the shader system has been designed this way? Could this behavior be removed for future releases? Or perhaps made into an option configurable in conf.lua?
Chris
Inconvenience: Errors upon unused shader uniforms
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Inconvenience: Errors upon unused shader uniforms
It's not a matter of what LÖVE does. Is a matter of how shader programs are specified. Unused uniforms means a shader is invalid with regard to that specification.
What exactly do you think should happen when you try to use an invalid shader?
You can catch errors using pcall if you need a certain behavior when an error occurs, no matter the context.
What exactly do you think should happen when you try to use an invalid shader?
You can catch errors using pcall if you need a certain behavior when an error occurs, no matter the context.
Re: Inconvenience: Errors upon unused shader uniforms
I've pushed to stop that being an error, see viewtopic.php?p=207865#p207865
At least there is Shader:hasUniform now.
At least there is Shader:hasUniform now.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Inconvenience: Errors upon unused shader uniforms
The graphics driver does this optimisation, without love being able to affect it, so the uniforms are gone either way. So now the option is to either ignore all uniform errors, or error for all of them, and love chooses the safest option.
Re: Inconvenience: Errors upon unused shader uniforms
Safest in what sense? Such an error can remain undetected (if the developer's graphics driver does not optimize away the uniform) until the game is released, and crash on the players' computers. Which was my point all the time.
It's a bit like saying that the safest way to release a program is with assertions enabled.
Who is online
Users browsing this forum: Google [Bot] and 12 guests