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

Re: [Public WebGL] Null return values from create*

On Wed, Apr 4, 2012 at 8:13 PM, Glenn Maynard <glenn@zewt.org> wrote:
> On Wed, Apr 4, 2012 at 9:18 PM, Gregg Tavares (勤) <gman@google.com> 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.


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