Results 1 to 3 of 3

Thread: Are uniform values saved when switching shaders?

  1. #1
    Junior Member
    Join Date
    May 2008

    Are uniform values saved when switching shaders?

    Lets say I have 2 shader programs, A & B, and do the following:

    1) Use program A
    2) Set uniforms for program A
    3) Render something
    4) Use program B
    5) Set uniforms for program B
    6) Render something else

    If I now want to render something with program A again, do I need to re-set all the uniforms it uses, or will the uniforms be restored automatically? The GL ES 2.0 spec doesn't mention it at all and the GL 2.0 spec only mentions that uniform values are stored as part of the program state (in section 2.15.5 - Required State).

  2. #2
    Senior Member
    Join Date
    May 2006

    Re: Are uniform values saved when switching shaders?

    Yes, uniform values are part of the program state. A uniform of a program will keep its value until you change it.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum |

  3. #3
    Junior Member
    Join Date
    Apr 2010

    Re: Are uniform values saved when switching shaders?

    Great, thanks a lot for that question!

Similar Threads

  1. Kernel output not being saved in host RAM
    By Gwenn in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 4
    Last Post: 01-30-2013, 03:45 AM
  2. glDrawPixels equivalent - how to load a saved buffer
    By hypertext in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 07-04-2010, 07:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean