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

Re: [Public WebGL] Problems with vertexAttrib4fv



Hi Gregg

Platform is Linux x86_64  Ubuntu 10.04 with ATI Radeon 5770 - I can send you the glxinfo off list if you'd like (its rather long to just paste here.)

Ati information gives the driver as: 8.723.1-100408a-098580C-ATI
3.2.9756 compatibility profile context.

The results aren't really conclusive, because almost all the combinations have some failures, whereas my results are pretty consistent - it works on the Nvidia/Win platform and not on L86_64/ATI platform

I'm just about to try everything out on my laptop (HP/Vista64/nvidia) but I have to update some things so it will take a while.

Thanks

Alan



On 08/11/2010 01:56 PM, Gregg Tavares (wrk) wrote:
Hi Alan,

Can you please tell me if these tests PASS for you?

Fails on FF 3.7a6pre and 4.0b4pre ()


Canvas.getContext
PASS context exists

Checking gl.vertexAttrib.
FAIL gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[0] should be 1. Was 0.
FAIL gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[1] should be 2. Was 0.
FAIL gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[2] should be 3. Was 0.
FAIL gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[3] should be 4. Was 0.
FAIL gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[0] should be 5. Was 0.
PASS gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[1] is 0
PASS gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[2] is 0
FAIL gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[3] should be 1. Was 0.

PASS successfullyParsed is true

However, on the latest Chromium build 6.0.492.0 (55767) it all works (but my app. doesn't)



************  FF 3.7a6pre and FF 4.0b4pre give the following:



Chromium 6.0.492.0 (55767)

Canvas.getContext
PASS [object WebGLRenderingContext] is non-null.

Checking gl.bindAttribLocation.
PASS bindAttribLocation should return INVALID_OPERATION if name starts with 'gl_'
PASS bindAttribLocation should return INVALID_OPERATION if name starts with 'gl_'
PASS program linked successfully
vPosition:3
vColor :2
PASS location of vPositon should be 3
PASS location of vColor should be 2
FAIL pixel at (20,15) is (0,0,0,255), should be (0,255,0,255)
PASS program linked successfully
vPosition:3
vColor :0
PASS location of vPositon should be 3
PASS location of vColor should be 0
PASS drawing is correct
FAIL gl.getError() should be 0. Was 1285.

PASS successfullyParsed is true





(note: On top of tree Chromium (6.0.491.0 (55567)) 3 of the tests in this last one don't pass at this time but those are not related to the issue you are seeing)
I found top of tree to be Chromium 6.0.492.0 (55767) ??? actually latest Win is 6.0.492.0 (following the links on the Khronos site as Ken suggested.)

********  This is what  I got on FF 3.7a6pre


Test of get calls against GL objects like getBufferParameter, etc.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

FAIL successfullyParsed should be true. Threw exception ReferenceError: successfullyParsed is not defined

******** This is what I got on FF 4.0b4pre

Test of get calls against GL objects like getBufferParameter, etc.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

PASS shaders.length is 2
PASS shaders[0] == standardVert && shaders[1] == standardFrag || shaders[1] == standardVert && shaders[0] == standardFrag is true
PASS gl.getError() is gl.NO_ERROR
FAIL gl.getAttachedShaders(null) should be undefined. Was null
PASS gl.getError() is gl.INVALID_VALUE
FAIL gl.getAttachedShaders(standardVert) should be undefined. Threw exception [Exception... "Could not convert _javascript_ argument arg 0 [nsICanvasRenderingContextWebGL.getAttachedShaders]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/resources/js-test-pre.js :: shouldBeUndefined :: line 256" data: no]
FAIL gl.getError() should be 1281. Was 0.
PASS gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 16
PASS gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE) is gl.DYNAMIC_DRAW
PASS getError was expected value: NO_ERROR :
PASS getError was expected value: NO_ERROR :
PASS getError was expected value: NO_ERROR :
PASS gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_COMPLETE
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.TEXTURE
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is texture
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL) is 0
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE) is 0
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.RENDERBUFFER
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is renderbuffer
PASS gl.getProgramParameter(standardProgram, gl.DELETE_STATUS) is false
PASS gl.getProgramParameter(standardProgram, gl.LINK_STATUS) is true
PASS typeof gl.getProgramParameter(standardProgram, gl.VALIDATE_STATUS) is "boolean"
PASS typeof gl.getProgramParameter(standardProgram, gl.INFO_LOG_LENGTH) is "number"
PASS gl.getProgramParameter(standardProgram, gl.ATTACHED_SHADERS) is 2
PASS gl.getProgramParameter(standardProgram, gl.ACTIVE_ATTRIBUTES) is 2
PASS gl.getProgramParameter(standardProgram, gl.ACTIVE_ATTRIBUTE_MAX_LENGTH) is non-zero.
PASS gl.getProgramParameter(standardProgram, gl.ACTIVE_UNIFORMS) is 1
PASS gl.getProgramParameter(standardProgram, gl.ACTIVE_UNIFORM_MAX_LENGTH) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH) is 2
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT) is 2
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) is non-zero.
PASS getError was expected value: NO_ERROR :
PASS getError was expected value: NO_ERROR :
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE) is non-zero.
FAIL gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_ALPHA_SIZE) should be non-zero. Was 0
PASS gl.getShaderParameter(standardVert, gl.SHADER_TYPE) is gl.VERTEX_SHADER
PASS gl.getShaderParameter(standardVert, gl.DELETE_STATUS) is false
PASS gl.getShaderParameter(standardVert, gl.COMPILE_STATUS) is true
PASS typeof gl.getShaderParameter(standardVert, gl.INFO_LOG_LENGTH) is "number"
PASS gl.getShaderParameter(standardVert, gl.SHADER_SOURCE_LENGTH) is non-zero.
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER) is gl.NEAREST
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER) is gl.NEAREST
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S) is gl.CLAMP_TO_EDGE
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T) is gl.CLAMP_TO_EDGE
PASS gl.getProgramParameter(boolProgram, gl.LINK_STATUS) is true
PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(boolProgram, bvalLoc) is true
PASS gl.getUniform(boolProgram, bval2Loc) is [1, 0]
PASS gl.getUniform(boolProgram, bval3Loc) is [1, 0, 1]
PASS gl.getUniform(boolProgram, bval4Loc) is [1, 0, 1, 0]
PASS gl.getProgramParameter(intProgram, gl.LINK_STATUS) is true
PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(intProgram, ivalLoc) is 1
PASS gl.getUniform(intProgram, ival2Loc) is [2, 3]
PASS gl.getUniform(intProgram, ival3Loc) is [4, 5, 6]
PASS gl.getUniform(intProgram, ival4Loc) is [7, 8, 9, 10]
PASS gl.getProgramParameter(floatProgram, gl.LINK_STATUS) is true
PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(floatProgram, fvalLoc) is 11
PASS gl.getUniform(floatProgram, fval2Loc) is [12, 13]
PASS gl.getUniform(floatProgram, fval3Loc) is [14, 15, 16]
PASS gl.getUniform(floatProgram, fval4Loc) is [17, 18, 19, 20]
PASS gl.getProgramParameter(matProgram, gl.LINK_STATUS) is true
PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(matProgram, mval2Loc) is [1, 2, 3, 4]
PASS gl.getUniform(matProgram, mval3Loc) is [5, 6, 7, 8, 9, 10, 11, 12, 13]
PASS gl.getUniform(matProgram, mval4Loc) is [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
FAIL gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be [object WebGLBuffer] (of type object). Was 3 (of type number).
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED) is true
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_SIZE) is 4
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) is 0
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE) is gl.FLOAT
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED) is false
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) is 36
FAIL gl.getVertexAttribOffset(1, gl.VERTEX_ATTRIB_ARRAY_POINTER) should be 12. Threw exception [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsICanvasRenderingContextWebGL.getVertexAttribOffset]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/resources/js-test-pre.js :: shouldBe :: line 151" data: no]
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED) is false
PASS gl.getVertexAttrib(1, gl.CURRENT_VERTEX_ATTRIB) is [5, 6, 7, 8]
PASS getError was expected value: NO_ERROR :
FAIL gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be null. Threw exception [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsICanvasRenderingContextWebGL.getFramebufferAttachmentParameter]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/resources/js-test-pre.js :: shouldBe :: line 151" data: no]
FAIL gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be null. Threw exception [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsICanvasRenderingContextWebGL.getFramebufferAttachmentParameter]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/resources/js-test-pre.js :: shouldBe :: line 151" data: no]
FAIL gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) should be null (of type object). Was 3 (of type number).
PASS getError was expected value: NO_ERROR :
PASS successfullyParsed is true

TEST COMPLETE


**************** And this is the Chromium

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

PASS shaders.length is 2
PASS shaders[0] == standardVert && shaders[1] == standardFrag || shaders[1] == standardVert && shaders[0] == standardFrag is true
PASS gl.getError() is gl.NO_ERROR
PASS gl.getAttachedShaders(null) is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS gl.getAttachedShaders(standardVert) is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 16
PASS gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE) is gl.DYNAMIC_DRAW
PASS getError was expected value: NO_ERROR :
PASS getError was expected value: NO_ERROR :
PASS getError was expected value: NO_ERROR :
PASS gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_COMPLETE
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.TEXTURE
FAIL gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be [object WebGLTexture]. Was null.
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL) is 0
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE) is 0
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.RENDERBUFFER
FAIL gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) should be [object WebGLRenderbuffer]. Was null.
PASS gl.getProgramParameter(standardProgram, gl.DELETE_STATUS) is false
PASS gl.getProgramParameter(standardProgram, gl.LINK_STATUS) is true
PASS typeof gl.getProgramParameter(standardProgram, gl.VALIDATE_STATUS) is "boolean"
PASS typeof gl.getProgramParameter(standardProgram, gl.INFO_LOG_LENGTH) is "number"
PASS gl.getProgramParameter(standardProgram, gl.ATTACHED_SHADERS) is 2
PASS gl.getProgramParameter(standardProgram, gl.ACTIVE_ATTRIBUTES) is 2
PASS gl.getProgramParameter(standardProgram, gl.ACTIVE_ATTRIBUTE_MAX_LENGTH) is non-zero.
PASS gl.getProgramParameter(standardProgram, gl.ACTIVE_UNIFORMS) is 1
PASS gl.getProgramParameter(standardProgram, gl.ACTIVE_UNIFORM_MAX_LENGTH) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH) is 2
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT) is 2
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) is non-zero.
PASS getError was expected value: NO_ERROR :
PASS getError was expected value: NO_ERROR :
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_ALPHA_SIZE) is non-zero.
PASS gl.getShaderParameter(standardVert, gl.SHADER_TYPE) is gl.VERTEX_SHADER
PASS gl.getShaderParameter(standardVert, gl.DELETE_STATUS) is false
PASS gl.getShaderParameter(standardVert, gl.COMPILE_STATUS) is true
PASS typeof gl.getShaderParameter(standardVert, gl.INFO_LOG_LENGTH) is "number"
PASS gl.getShaderParameter(standardVert, gl.SHADER_SOURCE_LENGTH) is non-zero.
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER) is gl.NEAREST
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER) is gl.NEAREST
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S) is gl.CLAMP_TO_EDGE
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T) is gl.CLAMP_TO_EDGE
PASS gl.getProgramParameter(boolProgram, gl.LINK_STATUS) is true
PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(boolProgram, bvalLoc) is true
PASS gl.getUniform(boolProgram, bval2Loc) is [1, 0]
PASS gl.getUniform(boolProgram, bval3Loc) is [1, 0, 1]
PASS gl.getUniform(boolProgram, bval4Loc) is [1, 0, 1, 0]
PASS gl.getProgramParameter(intProgram, gl.LINK_STATUS) is true
PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(intProgram, ivalLoc) is 1
PASS gl.getUniform(intProgram, ival2Loc) is [2, 3]
PASS gl.getUniform(intProgram, ival3Loc) is [4, 5, 6]
PASS gl.getUniform(intProgram, ival4Loc) is [7, 8, 9, 10]
PASS gl.getProgramParameter(floatProgram, gl.LINK_STATUS) is true
PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(floatProgram, fvalLoc) is 11
PASS gl.getUniform(floatProgram, fval2Loc) is [12, 13]
PASS gl.getUniform(floatProgram, fval3Loc) is [14, 15, 16]
PASS gl.getUniform(floatProgram, fval4Loc) is [17, 18, 19, 20]
PASS gl.getProgramParameter(matProgram, gl.LINK_STATUS) is true
PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(matProgram, mval2Loc) is [1, 2, 3, 4]
PASS gl.getUniform(matProgram, mval3Loc) is [5, 6, 7, 8, 9, 10, 11, 12, 13]
PASS gl.getUniform(matProgram, mval4Loc) is [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) is buffer
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED) is true
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_SIZE) is 4
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) is 0
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE) is gl.FLOAT
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED) is false
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE) is 36
FAIL gl.getVertexAttribOffset(1, gl.VERTEX_ATTRIB_ARRAY_POINTER) should be 12. Was 0.
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED) is false
PASS gl.getVertexAttrib(1, gl.CURRENT_VERTEX_ATTRIB) is [5, 6, 7, 8]
PASS getError was expected value: NO_ERROR :
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is null
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is null
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) is null
PASS getError was expected value: NO_ERROR :
PASS successfullyParsed is true

TEST COMPLETE




If the rest of those tests don't pass for you then I can hopefully use them to track down the issue. Otherwise if they do pass for you if you could make a small sample and send it to me I'll be happy to try to track down the issue.


On Wed, Aug 11, 2010 at 1:04 PM, Alan Chaney <alan@mechnicality.com> wrote:
Thanks Vlad,

Well, that would explain things. Looks like application writers will have to beware of this one. I'll modify my code as I outlined below and see if that fixes it on the Linux/ATI box. With my Khronos member hat on it looks like there will have to be work by some of the driver manufacturers if they want to claim that their drivers are WebGL compliant.

Regards

Alan



On 8/11/2010 12:54 PM, Vladimir Vukicevic wrote:
Oh right, I keep forgetting attrib indices are (have to be) just numbers.  I can't remember where we had this discussion, but I /think/ we decided that this was a driver bug (requiring attrib index 0 to be an enabled array).  At least, we didn't add any spec language requiring it, and I see that we don't do any explicit checks for it -- and that there are conformance tests that require a constant vertex attrib 0 to not fail (gl-bind-attrib-location-test.html).

    - Vlad

----- Original Message -----
 
Hi Vlad

On 8/11/2010 11:21 AM, Vladimir Vukicevic wrote:
   
Hmm, would be interesting to know what attrib location
getAttribLocation is returning, though of course, you can't know
that :/

     
Well, when I print it out, the attrib index is a number . I'm using
the
pattern of compiling and linking the shaders and then using the
locations thus derived. I've checked, and it seems that on the linux
box
the attribute index for a_color is 0, but for the windows box the
a_color index is 2.

This is easily explained in that presumably the graphics driver
determines the index during the linking process, and the drivers are
ATI
and Nvidia respectively.

Of course, I could always set the attribute indices before linking,
and
for example make '0' correspond to 'a_position' which is pretty much
always likely to be bound to an array. I notice that the Nvidia driver
appears to have made a_position the 0th index

The actual shader code is:

attribute vec3 a_position;
attribute vec3 a_normal;
attribute vec4 a_color;
attribute vec3 a_texcoord;

and this is the order that the nvidia driver appears to use.

   
I wonder if this is something to do with attribute 0 needing to be
an enabled array? Is a_color the first attribute definition in your
shader? Though I thought we had error checks for 0 not being an
enabled array.

     
I don't understand your comment about attribute 0 needing to be an
enabled array. It seems from reading the spec that vertex attributes
are
handled slightly differently in WebGL than ES 2, but basically what
I'm
doing is to use disableVertexAttribArray to tell webgl that it isn't
bound to an array.

The only specific reference I can find is:

6.2 Enabled Vertex Attributes and Range Checking

and the way that's written implies to me that if you call
enableVertexAttribArray(n) then you need to make sure that n is bound
with a vertex attribute array pointer statement. But I'm specifically
calling disableVertexAttribArray because it isn't.

My feeling at this point is that I'll rewrite the code to set the
attrib
locations prior to linking. If I do that, the logical thing is to call
disableVertexAttribArray as I create them and assign specific default
values (ie make them 'constant attributes') and then when I'm setting
up
a vertexatttrib array specifically enable the ones that I'm using. The
nature of my application is such that different objects can use
different combinations of attributes. I assume that if I enable them,
draw them (drawArrays/drawElements) and then disable them that the GL
state machine will handle that properly. Alternatively, I suppose I
can
track which ones are enabled/disabled and just make sure that as the
scenegraph is traversed then the attributes are enabled/disabled
according to the needs of the specific scene element.

I'll report back but it probably won't be today because I have to do
some other things this afternoon.


Thanks

Alan


   
     - Vlad

----- Original Message -----

     
On Wed, Aug 11, 2010 at 10:05 AM, alan@mechnicality.com
<alan@mechnicality.com>  wrote:

       
Hi

I'm seeing a problem with vertexAttrib4fv which manifests on Linux
x86_64/ATI Radeon 5770 but not on my WinXP32/GForce 8800 GTX

The pseudo code is something like:


    if (! colorVertexAttributeData) {

         int colorIndex = getAttribLocation(shader, "a_color")
         if (colorIndex != -1) {
                 disableVertexAttribArray(colorIndex)
                 vertexAttrib4fv(colorIndex, defaultColor)
         }
   }


where my shader has:

attribute vec3 a_color;

in the attribute definitions.

The purpose behind the code is for the cases where the data
doesn't
have a
color attribute channel (using Max speak) so that it is displayed
with a
default color, so I use a constant vertex attribute.

This works fine in the win setup, but on the linux box Chrome
6.0.472.25 dev
ignores the color and Firefox (3.7 ->  4.0 beta 2) just produces a
black
image. By "ignore the color" I've set a default value of
vec4(0.2,0.2,0.2,1.0) in the shader so I can see if anything is
happening.
In chrome, the objects are this color rather than the color
provided
in the
vertexAttrib statement.

         
I don't have a really useful suggestion except to please try the
top
of tree Chromium build rather than the dev channel build. WebGL is
still under rapid development. See the WebGL wiki for download
instructions.

If you can boil this down into a small test case please post it.

-Ken


       
It seems to me that the likely candidates are either the graphics
driver or
some issue with WebGL and X86_64 linux.

When there is a color attribute channel in the vertex attray then
the
vertexAttribPointer correctly finds and displays the color on all
platforms.

Regards

Alan






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



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

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

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