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

Re: [Public WebGL] Spec change request.



On 12/06/2010 04:17 PM, Chris Marrin wrote:
> On Dec 4, 2010, at 7:34 PM, Steve Baker wrote:
>
>   
>> When I benchmark my rendering code - I find that an unreasonable
>> percentage of the time is spent doing this:
>>
>>    if ( someUniformLocation != null )                               
>> <==== THIS!
>>      gl.uniformXXX ( someUniformLocation, XXX ) ;
>>
>> ...in situations where a uniform variable might not exist in the shader
>> in some rendering passes but does exist in others (eg, when the shadow
>> and depth rendering passes don't need to see textures and such).
>>
>> Losing the 'if' test would speed things up significantly.
>>
>> It would be a performance win if all of the various uniform setter
>> functions would legally accept a 'null' location (and do nothing)
>> without flagging an error in that circumstance.   An 'if' in C++ (which
>> you're probably doing anyway in order to do error detection) is much
>> faster than doing one in JavaScript - and I don't see any downsides.
>>
>> Any chance of a spec change?
>>     
> What happens today if you get rid of the if? Coredump? Failed rendering? Nothing bad?
>   
It used to generate an error - but not any more...evidently the spec
changed in exactly the way I was requesting...I just hadn't noticed the
change.  I removed the 'if' and everything works exactly the same...and
I get back a little performance...and every little helps!

  -- Steve

-----------------------------------------------------------
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: