[Public WebGL] oes-texture-float conformance

Vladimir Vukicevic [email protected]
Tue May 10 11:38:24 PDT 2011

----- Original Message -----
> 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);
> };

The test is actually equivalent to this:

  var ext0 = gl.getExtension('foo');
  ext0.someProperty = 'foo';
  ext0 = null; // give up the reference to the actual extension object

  // force GC somehow: nothing has a reference to the extension object returned by gl.getExtension

  var ext1 = gl.getExtension('foo');
  //assert(ext0 == ext1); // you can't test this -- you already gave up ext0's reference!
  assert(ext1.someProperty == 'foo'); // this will likely fail -- but it will succeed without the 'ext0 = null' line.

implementation-wise, the internal native object has a JS wrapper that's created when it's returned back to JS.  When you set arbitrary properties on it, they are set on the wrapper itself.  This wrapper is the thing that gets discarded when a GC triggers.  The fact that a new wrapper gets created is only observable due to the additional properties -- otherwise there's no way to check equivalence (because you no longer have the first wrapper reference at all -- it was given up so it could get GC'd).

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