Hi
Is there a bit for shaders for glPushAttrib?
Tnx
Marco
Hi
Is there a bit for shaders for glPushAttrib?
Tnx
Marco
No.
Look in the extension specs you’re interested in on
http://oss.sgi.com/projects/ogl-sample/registry/
and search for the “New State” table column “Attribute”.
For example ARB_shader_objects has
Get Value Type Get Command Value Description Sec. Attribute
--------- ---- ------------------------- ------- ----------- ---- ---------
PROGRAM_OBJECT_ARB H GetHandle 0 Handle of current 2.14.2 -
which means the program object is not push-pop-able (there was an error in the 0.87 spec.)
Originally posted by Relic:
[b]No.
Look in the extension specs you’re interested in on
http://oss.sgi.com/projects/ogl-sample/registry/
and search for the “New State” table column “Attribute”.
For example ARB_shader_objects has
Get Value Type Get Command Value Description Sec. Attribute --------- ---- [/b]
I want to push only the uniforms. So is the gl_* stuff also not pushable?
Pushing the user defined uniforms in the shaders?
The thing to do is upload new ones and if you want a push/pop like behavior, write a software solution for dealing with states.
My post means you can’t build a hierarchy with Push-PopAttrib which includes the program object. You need to store the program object along with your hierarchy and “use” it.
But this is not new, all programmable pipeline extensions don’t have the shaders or programs associated with an attrib bit. The lower level extensions still have an enable bit though.
Uniforms are part of the shader program’s state. See ARB_shader_objects spec issue
9) Should uniform values be state per program object?
DISCUSSION: Should values loaded for uniforms be kept in a program
object, so that they are retained across program object switches? This
is application friendly. However, loading uniforms becomes a bit more of
a heavy weight operation because the OpenGL implementation now has to
store its values with the program object, and reload when the program
object is made current, even if the previous program object already had
the same uniform values loaded.
RESOLUTION: YES. We don't want to force an application to re-load its
uniforms every time a program object is used.
The built-in gl_* state variables are just referencing OpenGL’s current state. Those values are handled with specific bits in the bitfield for Push-PopAttrib.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.