Latest nightly, string and primitive values.

Started by EvilOne, April 06, 2010, 11:42:03

Previous topic - Next topic

EvilOne

I've seen in the latest nightly, that glGetActive[Uniform/Attrib]Type/Name were gone.

Would be nice to get them back, and supporting null as parameters - that would free us from any buffer annoyance.

Like:
String name = GL20.glGetActiveUniform(id, index, length, null, null); // Null support.
int type = GL20.glGetActiveUniformType(id, index);
int size = GL20.glGetActiveUniformSize(id, index);

Cheers, E1.
If you got a shiny new hammer, every problem looks like a nail!

spasi

Hmm, the Type/Size versions are still available, are you sure you used the latest nightly?

Anyway, I'll add a Name version, I'll remove the String glGetActiveUniformARB(int programObj, int index, int maxLength, IntBuffer size, IntBuffer type) version and keep the String glGetActiveUniformARB(int programObj, int index, int maxLength, IntBuffer sizeType) one.

Btw, I don't see why glGetActiveUniform/Attrib are so popular, I've never used them in my projects. I guess they could be useful when you load external or user-defined shaders, but that's not really a common scenario. Also, keep in mind that with the example you mentioned you'd be doing 3 driver calls per uniform.

spasi

OK, here are the methods supported as of the last commit:

void glGetActiveFoo(int program, int index, IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) // Original
String glGetActiveFoo(int program, int index, int maxLength, IntBuffer sizeType) // Returns the name as a string and puts size & type in the sizeType buffer
String glGetActiveFoo(int program, int index, int maxLength) // Returns the name only
int glGetActiveFooSize(int program, int index) // Returns the size only
int glGetActiveFooType(int program, int index) // Returns the type only


This applies to the following GL calls:

GL20.glGetActiveUniform
GL20.glGetActiveAttrib
ARBShaderObjects.glGetActiveUniformARB
ARBVertexShader.glGetActiveAttribARB
NVTransformFeedback.glGetActiveVaryingNV