Bug 103332

Summary: glDrawArrays does not take the "first" argument into account
Product: Mesa Reporter: Laurent Renard <laurent.renard>
Component: Drivers/Gallium/swrAssignee: mesa-dev
Status: RESOLVED INVALID QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: laurent.renard
Version: 17.2   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Laurent Renard 2017-10-18 08:57:10 UTC
I am using the glMultiDrawArrays command to render some text with multiple triangle strip (2 triangles for each character).

With GALLIUM_DRIVER=swr only the first character is rendered.

I replace the glMuliDrawArrays command by a loop containing the glDrawArrays command with the correct "first" vertex argument but it does not changes the result.

If I then modifie the buffer in my loop to put the vertices I want to render at the beginning of the buffer and use glDrawArrays(GL_TRIANGLE_STRIP, 0, count) the rendering is OK.

If I switch to softpipe or llvmpipe the rendering is OK.

It is as if th draw arrays command were not taking the first parameter into account.

(I also tested the code on NVidia proprietary driver and everything works well and Intel HD Graphics+Windows too).

I am using JOGL since my app is in Java but I will try to provide a simpler example if possible.
Comment 1 Laurent Renard 2017-10-18 09:34:40 UTC
I have tested with modified version of the tutorial found here : http://www.opengl-tutorial.org/beginners-tutorials/tutorial-5-a-textured-cube/

Modifying the command 
// Draw the triangle !
glDrawArrays(GL_TRIANGLES, 0, 12*3); // 12*3 indices starting at 0 -> 12 triangles

By :
// Draw the triangle !
for (int c = 0 ; c < 12 ; c ++){
   glDrawArrays(GL_TRIANGLES, c * 3, 3); // 12*3 indices starting at 0 -> 12 triangles
}

does not show the issue.

I will try to go deeper and see where the issue is. (My code, JOGL or OpenSWR)
Comment 2 Bruce Cherniak 2017-10-18 16:03:24 UTC
Hello Laurent.  I will be happy to take a look at this with you.

It does seem like a bug in the SWR code.
Comment 3 Bruce Cherniak 2017-11-28 21:03:25 UTC
Hello Laurent,

Have you had any success a with testcase that illustrates the failure you are seeing?
Comment 4 Alok Hota 2018-05-31 16:29:00 UTC
No followup from submitter.

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.