glsl-optimizer icon indicating copy to clipboard operation
glsl-optimizer copied to clipboard

context constants / limits

Open zacharias2k opened this issue 10 years ago • 3 comments

Why are all opengl context constants hardcoded? Would be nice to set them after construction of the glsl context.

zacharias2k avatar Sep 20 '13 17:09 zacharias2k

Do you have a good idea how to expose that?

aras-p avatar Sep 20 '13 18:09 aras-p

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.

zacharias2k avatar Sep 20 '13 20:09 zacharias2k

I had the same Issue with MAX_DRAW_BUFFERS , especialy if You using some kind of MRT rendering.

sagaceilo avatar Dec 21 '13 22:12 sagaceilo