Results 1 to 6 of 6

Thread: Shader Issues

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    6

    Shader Issues

    I am trying to come up with a platform independant way of handling shaders, and really struggling.

    You may or may not be able to compile on the target device.

    You may or may not be able to use binary shaders

    You may or may not be able to use the OES extensions.

    If you can compile on the device, then on some machines it may take up to 90 seconds to compile a shader.

    If you can use binary shaders, then you may have to use an external sdk to do the actual compilation

    So it's a mess.

    I tried to work out how many different binary formats there are, I have found ten, but I have no way to work out if this is definitive.

    At the moment it looks to me that OpenGLES 1.0 is a platform independant API, and due to shader issues OpenGLES 2.0 is not.

    I am really struggling to come up with a solution to this issue.

    Has anyone got...

    1) A definitive list of binary formats
    2) A platform independant way of doing shaders
    3) A device list with details of supported API's

    Without some way of handling shaders. Why would you expend the effort to develop games when the real market size is some small percentage of the total OpenGLES market?

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: Shader Issues

    I have never come across a machine where it took more than a small fraction of a second to compile a single shader. If it's taking 90 seconds then you have something truly outrageous going on somewhere.

    That said, if you have a large number of shaders to compile, then the time can get kinda large. In such situations, I cache the shaders in a local file. So the shader is compiled locally the first time the program runs (typically during installation) - and the binary loaded thereafter. That way you only have to worry about the binary for the one specific format that this computer supports.

    If subsequently there are errors - then it might be that the user updated their graphics card or something - and you'll have to re-compile shaders. You can use the various glGetString stuff to figure out when this has happened.

    At any rate - the trick is to do it on the users' own machine - then you only have to consider a single format.

  3. #3
    Junior Member
    Join Date
    Jul 2011
    Posts
    6

    Re: Shader Issues

    Unfortunately that's not an option.

    A lot of the platforms I am looking at don't support source code compilation, they only support binary shaders. So you have to use a SDK to precompile them.

    I originally thought as you do, but expierience has proved me wrong.

    By the way it was the nokia n900 that was taking 90 seconds for a single compile

  4. #4
    Junior Member
    Join Date
    Jul 2011
    Posts
    6

    Re: Shader Issues

    Guys the more I look at this, the more it concerns me.

    Unless a change is made in the OpenGLes 2.0 specification, I have to say it is unfit for purpose.

    You simply cannot call it platform independant if this issue is not dealt with.

    Either devices HAVE to support source code compilation, or we have to come up with a way of dealing with multiple binary shader formats. Like a change to the link phase that converts the compiled binary format into real gpu shader code for the platform.

    Simply ignoring the issue will reduce the number of adopters, especially now we have XNA on windows mobile.

  5. #5
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: Shader Issues

    Quote Originally Posted by Stainless
    A lot of the platforms I am looking at don't support source code compilation, they only support binary shaders.
    I'm curious, what platforms are these?

    The vast majority of OpenGL ES 2.0 implementations support compiling shaders from source, especially those that represent a viable market for games.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  6. #6
    Junior Member
    Join Date
    Jul 2011
    Posts
    6

    Re: Shader Issues

    I'm having the guys in the office put together a list of all the devices we have to support and there shader capabilities.

    Once they have done that, I will publish it here.

Similar Threads

  1. Sort out the shader issues
    By Stainless in forum Suggestions for future OpenGL ES releases
    Replies: 6
    Last Post: 03-02-2012, 07:02 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
  •