Bug 106450

Summary: glGetIntegerv return wrong value in some cases
Product: Mesa Reporter: xuelian.bai
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: ARM   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch for this bug

Description xuelian.bai 2018-05-09 07:33:25 UTC
I use this version: Mesa 18.1.0-rc2   c2768b8a51d74bee1d189726d1a07a7a195689f7

And I run mesa on Tizen4.0 RPI3, but this bug is not related with platform.

The problem is, glGetIntegerv(GL_VERTEX_ARRAY_SIZE/VERTEX_ARRAY_STRIDE/NORMAL_ARRAY_STRIDE/COLOR_ARRAY_STRIDE/TEXTURE_COORD_ARRAY_SIZE/TEXTURE_COORD_ARRAY_STRIDEPOINT_SIZE_ARRAY_STRIDE_OES) return wrong size.

The reason is,  in struct gl_array_attributes, the type of member Size is GLubyte, and member Stride is short, but, in get_hash_params.py, things are different, there are sentences like  "ARRAY_INT(VertexAttrib[VERT_ATTRIB_POS].Size)), ARRAY_INT(VertexAttrib[VERT_ATTRIB_POS].Stride)", so in function _mesa_GetIntegerv(), the type is wrong, the size will be wrong by wrong explicit conversion.

I have make a patch for tizen, https://review.tizen.org/gerrit/#/c/178290/
With this patch, related test cases could pass on Tizen4.0 RPI3.
Comment 1 Brian Paul 2018-05-09 14:25:39 UTC
Can you please attach the patch here, or post it to mesa-dev?  I can't access the URL you gave.

BTW, I've confirmed the bug here.
Comment 2 Brian Paul 2018-05-09 15:30:14 UTC
FYI: I've posted a piglit patch for a new test to check this.
Comment 3 xuelian.bai 2018-05-10 01:10:56 UTC
Created attachment 139455 [details] [review]
Patch for this bug

This is my patch, please check, thanks!
Comment 4 Brian Paul 2018-05-10 01:43:49 UTC
You're missing fixes for glGetFloat/Double/Booleanv().  And there are a few more arrays like GL_SECONDARY_COLOR, GL_FOG_COORD, GL_EDGE_FLAG, etc.

I've got a patch which covers all that which I'll post for review and cc you.
Comment 5 Brian Paul 2018-05-10 14:10:48 UTC
Fixed by d07466fe18522cde1acadfc597583f80b69c15b7

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.