Forums - gl_VertexID part 2: The Dark Knight Returns.

2 posts / 0 new
Last post
gl_VertexID part 2: The Dark Knight Returns.
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Sun, 2014-11-09 01:28

Seems you can only placate me for so long before I come back with another bug to throw on your doorstep.

I was building a test application for some open source video drivers since it is in the process of implementing gl_VertexID, and I decided to run my test application on the proprietary Qualcomm drivers provided in the Nexus 5 Android 5.0 preview release.

My test application draws 255 "quads" as as a triangle strip and it uses the gl_VertexID to determine the outputted colour of each "quad." This should generate us a nice gradient from one colour to another. The vertex shader is taking the gl_VertexID shifting it right by two since we only need the colour to increment every 4 vertices, I then take this value and divide it by the number of quads(255) as a floating operation in order to get the colour stepping in the range of 0.0 to 1.0.

This is a fairly simple example I've generated, but it looks like we've got issues past the first four vertices (gl_VertexID 0-3). Seemingly what I can only tell is that there is a temporary attribute pointer being generated to cover my last use case which was only four vertices, and it breaks in this case because it goes past that amount and I can only tell that the gl_VertexID that my shader is getting is far higher than anything it should be and is getting the result clamped to 1.0(Could be (unsigned int)-1?).

Good news is that the test worked great for the open source driver for testing, and also checking it on other devices it works fine.

As before I have a source tree demonstrating the bug, along with a signed release APK for demonstrating the issue. http://gdurl.com/hfwZ

I also have a picture of what it is supposed to look like, versus what it does look like. https://twitter.com/sonicadvance1/status/531363436983099392

  • Up0
  • Down0
peteb
Profile picture
Join Date: 22 Mar 13
Location: San Diego
Posts: 5
Posted: Tue, 2014-11-11 18:01

Hi Ryan,

Thanks for reporting this issue.  I have compiled your sample against the official Android 5 release, and ran it on device with a current version of the driver.  I'm happy to say that this issue has been resolved.  Here is an image of the application running on an MDP.

Cheers,

Pete

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.