glsl-optimizer
glsl-optimizer copied to clipboard
context constants / limits
Why are all opengl context constants hardcoded? Would be nice to set them after construction of the glsl context.
Do you have a good idea how to expose that?
I think we should leave the very tiny API as it is, so options are limited.
- The easiest way would be via preprocessor defines, but that wouldn't be very flexible if anyone wants to deliver binaries for different machines.
- a function like
glslopt_setlimit(glslopt_ctx*, option, value)
- most values are integers, so it should be easy to access, but ugly IMHO, because it's not visible to the user and the context shouldn't change over execution time. - enhance
glslopt_initialize
, add some parameters or give it a structure containing the settings.
But i'm not happy with those solutions, you might want to come up with something better.
PS: The reason for this was mainly because of MaxDrawBuffers, which is 2 - far too low, even mesa updated it to 8, years ago, see config.h line 228.
#define MAX_DRAW_BUFFERS 8 You may want to change that too.
I had the same Issue with MAX_DRAW_BUFFERS , especialy if You using some kind of MRT rendering.