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

Re: [Public WebGL] Discrepancy between Chromium and Minefield



Yep, we don't yet implement set() -- I'm working on it currently, and it should show up in the next few days.  For now, replacing it with a simple loop copy will get you unstuck.

    - Vlad

----- alan@mechnicality.com wrote:

> Hi
> 
> I'm using the latest builds of Minefield (updated and rebuilt this
> morning) and Chromium (6.0.437.3 dev) running on Linux Ubuntu 10.04
> (AMD64). I'm hitting a problem with Float32Array in Minefield. The
> code is actually generated using GWT, but I've extracted the relevant
> part of the code into a small html file (attached below).
> 
> The code works fine on Chrome, but when I try it in Minefield barfs at
> the line containing fa.set(jan) where jan is an array of floats.
> 
> The error is:
> Error: fa.set is not a function
> Source File:
> file:///home/me/mechnicality/workspace.mechweb/WebGL2/util/floatarray.html
> Line: 14
> 
> 
> The expected(??) result generated by Chrome is:
> Create Float32Array
> 
> 
> 5, 1, 1, 1.100000023841858, 2.5, 3
> 
> 
> 
> What am I doing wrong? As far as I can see the code complies with the
> latest TypedArray spec. Are there planned changes to Firefox which
> will correct this?
> 
> And yes, I'm aware that the current code has to all intents and
> purposes a pointless array copy, but that's not my current main issue!
> 
> Thanks
> 
> Alan
> 
> 
> 
> 
> <!doctype html>
> <html>
> <head>
> <script type="text/javascript">
> var $wnd = parent;
> 
> // CREATED BY GWT
> function create_6(vertices){
> var f, f$array, f$index, f$max, jan, ab, fa;
> jan = [];
> for (f$array = vertices , f$index = 0 , f$max = f$array.length;
> f$index < f$max; ++f$index) {
> f = f$array[f$index];
> jan[jan.length] = f;
> }
> return ab = new $wnd.ArrayBuffer(jan.length * 4) , fa = new
> Float32Array(ab) , fa.set(jan) , fa;
> }
> 
> // END OF GWT SECTION
> 
> 
> function testFloat32Array() {
> 
> var ptags = document.getElementsByTagName("p");
> if (ptags == null)
> alert('"ptags" is null');
> else {
> var pt = ptags[0];
> var str="";
> pt.innerText = 'prior to create';
> 
> var f32a = create_6([1.0, 1.0, 1.1, 2.5, 3.0]);
> pt.innerText = 'post create';
> try {
> if (f32a != null) {
> 
> str="not null";
> str = f32a.length;
> 
> for (var i =0; i < f32a.length; i++) {
> str += ", " + f32a[i];
> }
> 
> } else {
> str="f32a was null";
> }
> pt.innerText = str;
> } catch(ex) {
> alert(ex);
> } finally {
> pt.innerText = pt.innerText + " !";
> }
> 
> }
> }
> 
> </script>
> </head>
> <body onload="testFloat32Array()">
> 
> <h3 >Create Float32Array</h3>
> <p id="msg">here</p>
> </body>
> </html>
-----------------------------------------------------------
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: