[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] max instruction slots?



The problem is that this information isn't of much use to you.  Sure,
you could maybe query the maximum length of a shader in machine code
instructions - but you have absolutely no idea how many instructions the
compiler will generate from any given piece of GLSL source code.   It
can (and will) be radically different from one graphics card to another
- from one platform to another and from one driver rev to another.  It
might even change with different rendering context setups.

Also, shaders are a bit more complicated than that "under the hood" -
some GPU's require the drivers to split apart the code that runs before
you look up any textures and the code that runs after you looked them
up.   That could maybe lead to a situation where you run out of
post-texture instructions while having plenty of pre-texture
instructions left.

It's basically too complicated to query usefully.  In the end, all you
can really do is say "Here is my shader - does it fit?".  Then provide a
couple or three shaders of different complexities that - hopefully -
will span the range from low-end hardware to high end with varying
degrees of visual quality.

My Barfight game has two sets of fragment shaders - one which has all of
the bells and whistles and the other which doesn't support dynamic
shadows or normal mapping.   If the first one doesn't compile - I try
the second one - and if that doesn't compile, it's "so-long and thanks
for all the fish"!

  -- Steve

On 02/07/2011 05:20 PM, Kelley, Michael wrote:
> Is there any way to query directly or indirectly the maximum number of arithmetic instruction slots?  As far as I can tell there isn't any way to query for this information.  We have code that on certain graphics hardware fails to compile a shader with the error message "Compiled shader code uses too many arithmetic instructions slots".
>
>
>
> The information contained in this communication may be CONFIDENTIAL and is intended only for the use of the recipient(s) named above. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please notify the sender and delete/destroy the original message and any copy of it from your computer or paper files.
>
> -----------------------------------------------------------
> You are currently subscribed to public_webgl@khronos.org.
> To unsubscribe, send an email to majordomo@khronos.org with
> the following command in the body of your email:
> unsubscribe public_webgl
> -----------------------------------------------------------
>
>   

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------