-
Notifications
You must be signed in to change notification settings - Fork 30
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
Text replacement instead of ESSL macros #838
Comments
@emilwestergren Does this sound good enough or do you have a better idea? |
Sounds good, do we want a general OpenGLMap new(frag, vert, VectorList<ShaderFlag>) |
I have quite a lot of integers that would allow being both fast and flexible with any data type. |
I see, are you replacing the uploads of constants? |
Some of the uniform integers could be more efficient that way by rolling loops in compile time. The same blur shader could be compiled for each radius for unrolling. |
I agree but then again it sounds like a minor optimization. Should this be prioritized at the moment? |
It is not a priority right now but in the long run, this could increase our productivity when testing the contrast by having all settings on the same place. |
Can't you just use uniforms for that? |
Then a glitch in the phone's memory might accidentally turn on debug views and expose our algorithms. |
@emilwestergren Giving macros to shaders from the CPU is now required to flip images of different coordinate systems without affecting performance for the majority of shaders that never get an input image of non-standard scan order. Either we implement this feature and reserve a field for built in macros or let the header of each shader including version be generated from the abstraction layer. |
It seems like GLES do not even have a real pre-compiler since token pasting is not allowed and then I cannot mangle a name for an image's sampling transform. This is yet another feature that is needed then. |
Since coordinate systems moved from Kean, this is again not a priority. |
Having to change macros that are hardcoded in shader code makes it hard to separate settings from code. It would be cleaner to insert text replacements together with the shader code when creating a shader. We already have the
replaceAll
function as used inDateTime
. Giving the input argumentReplacement new("<DEBUG>", debugFlag toString())
into the shader's constructor would let each occurence of<DEBUG>
be replaced by the value ofdebugFlag
.The text was updated successfully, but these errors were encountered: