Hello Guest

Latest nightly, string and primitive values.

  • 2 Replies
  • 4928 Views
Latest nightly, string and primitive values.
« on: April 06, 2010, 11:42:03 »
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!

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: Latest nightly, string and primitive values.
« Reply #1 on: April 06, 2010, 18:05:12 »
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.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: Latest nightly, string and primitive values.
« Reply #2 on: April 07, 2010, 12:07:35 »
OK, here are the methods supported as of the last commit:

Code: [Select]
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