[Public WebGL] Null return values from create*

Kenneth Russell [email protected]
Thu Apr 5 15:34:57 PDT 2012


On Thu, Apr 5, 2012 at 3:28 PM, Kenneth Russell <[email protected]> wrote:
> On Wed, Apr 4, 2012 at 8:13 PM, Glenn Maynard <[email protected]> wrote:
>> On Wed, Apr 4, 2012 at 9:18 PM, Gregg Tavares (勤) <[email protected]> wrote:
>>>
>>> Where are all the places one would return these invalid objects?
>>>
>>> createProgram,
>>> createShader,
>>> createTexture,
>>> createBuffer,
>>> createRenderbuffer
>>> createFramebuffer,
>>> getUniformLocation?
>>> getActiveAttrib
>>> getActiveUniform
>>>
>>> getUniformLocation seems a little weird in that passing it a uniform that
>>> does not exist returns NULL but passing it a uniform after context lost
>>> returns an invalid location? Or still NULL?
>>
>>
>> We're only really talking about functions that return WebGLObject
>> subclasses, since those are the ones that have an invalidated flag to use
>> instead of a null return value.  WebGLUniformLocation and WebGLActiveInfo
>> don't have an invalidated state, since it's not a WebGLObject.  I'd look at
>> these later, if we start looking at reducing other null return values.
>
> Gregg: after context loss, getUniformLocation is covered by the rules
> in http://www.khronos.org/registry/webgl/specs/latest/#5.14, which
> means that it would return null, not an invalid location.
>
>
>>> how about getParameter?
>>
>>
>> getParameter is hard, since there are a lot of possible arguments with
>> varying reasonable "placeholder" results.  I'd defer this, too.
>>
>> While I'm thinking about it: does getParameter() define that values like
>> MAX_VIEWPORT_DIMS and VIEWPORT always return a new object, as opposed to
>> returning the same object each time?
>
> They should. I've clarified getParameter, getUniform and
> getVertexAttrib in this area.

Boris, Glenn: related question: are the few queries that return
boolean[] OK, or do these need to be changed to return
sequence<boolean>?

-Ken

-----------------------------------------------------------
You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------





More information about the public_webgl mailing list