Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: Shader Programs and DC's

  1. #1
    Intern Newbie
    Join Date
    Mar 2005
    Posts
    41

    Shader Programs and DC's

    Hi,

    Can the same shader program be used in more than one DC at the same time?

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,345

    Re: Shader Programs and DC's

    Should be no problem.

  3. #3
    Advanced Member Frequent Contributor yooyo's Avatar
    Join Date
    Apr 2003
    Location
    Belgrade, Serbia
    Posts
    872

    Re: Shader Programs and DC's

    Well, Im not sure... For example you can install two graphics card, AGP & PCI (geforce/ati + matrox g450). This is two different DC and when you create GLRC on both DC, I'm quite sure that you cant share objects between this two RC's.

    yooyo

  4. #4
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,345

    Re: Shader Programs and DC's

    DC/RC, same **** different name. No, you're quite right. Mixed it up. You can share program objects between GL contexts, but you can obviously not share contexts between implementations on different GPUs, nor can you share between two processes.

  5. #5
    Intern Newbie
    Join Date
    Mar 2005
    Posts
    41

    Re: Shader Programs and DC's

    Thanks everybody for your posts...

    My situation here, is that I have multiple windows in the same application. I need to change the palettes in all of them at the same time by replacing the 1D textures. I do not need different shading code to do this. I created only one shader program and tried to use it in the displaying function of all the windows. The shader didn't work except for one window. When I created multiple copies of the same shader programs and assigned one program to every window, it worked fine. I am new to shading, can there be anything that I did wrong or is there an obvious reason for that thet I don't know?

  6. #6
    Intern Contributor
    Join Date
    Nov 2003
    Location
    Russia / Saint-Petersburg
    Posts
    50

    Re: Shader Programs and DC's

    Check out for wglShareLists()

  7. #7
    Advanced Member Frequent Contributor yooyo's Avatar
    Join Date
    Apr 2003
    Location
    Belgrade, Serbia
    Posts
    872

    Re: Shader Programs and DC's

    Instead creating rendering context (RC) for all windows you can create one RC for all. Just override OnPaint event and do wglMakeCurrent at beggining and SwapBuffers at end of this func. Remember to call SetPixelFormat with same PixelFormat for all windows.

    No object sharing, but you must track GL state changes.

    yooyo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •