[Public WebGL] oes-texture-float conformance

Ben Vanik [email protected]
Tue May 10 11:34:42 PDT 2011


Exactly. Imagine all the awesome creative things that happen in JS DOM
land now because of this behavior.

Also, I don't see how this is different than the behavior of calls
like getParameter:
var tex0 = gl.getParameter(gl.TEXTURE_BINDING_2D);
var tex1 = gl.getParameter(gl.TEXTURE_BINDING_2D);
assert(tex0 == tex1);
Without this being true I couldn't do useful things like:
tex.width = width; tex.height = height;
Or cache the uniform locations on the program object. Etc etc.

I think it's pretty simple - if you can modify the
WebGLRenderingContext and have those changes persist across getContext
calls, you should be able to modify the extensions and have those
changes persist across getExtension calls. Anything else is just bad
design.

And here's a more useful example of why you'd want this stuff:

var ext = gl.getExtension('foo');
var origMethod = ext.method;
ext.method = function() {
  console.log('hi!');
  origMethod.call(ext);
};
ext.helper = function() {
  console.log('useful!');
};
// ...
ext.method(); // <-- yay
ext.helper();

// ... someplace else, in another library/etc
var ext = gl.getExtension('foo');
ext.method(); // <-- no longer augmented!
ext.helper(); // <-- death!


On Tue, May 10, 2011 at 11:26 AM, James Robinson <[email protected]> wrote:
> On Tue, May 10, 2011 at 11:20 AM, Benoit Jacob <[email protected]> wrote:
>>
>> ----- Original Message -----
>> > function renderFrame(gl) {
>> > var ext0 = gl.getExtension('foo');
>> > var ext1 = gl.getExtension('foo');
>> > assert(ext0 == ext1);
>> > };
>> > Having ext0 != ext1 would be odd. Again, 'get' means get, and no one
>> > should have to know that 'getExtension' really means
>> > 'createExtension'.
>>
>> Noone is arguing against that, the test is rather:
>>
>> function renderFrame(gl) {
>>  var ext0 = gl.getExtension('foo');
>>  ext0.someNewProperty = 'bar';
>>  var ext1 = gl.getExtension('foo');
>>  assert(ext0 == ext1);
>> };
>
> Isn't that testing the same thing?  Every call to context.getExtension(str)
> with the same value for 'str' must return the same object, just as every
> call to document.getElementById(str) that returns the same DOM node must
> return the same script object (as far as script can observe, anyway).
> - James
>
>>
>> Benoit
>> -----------------------------------------------------------
>> 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
>> -----------------------------------------------------------
>>
>
>

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