Created attachment 139374 [details] app The value of gl_InstanceID variable is incorrect when shader has gl_DrawIDARB. Inserting additional dependency on gl_VertexID or gl_BaseInstanceARB variable restores gl_InstanceID value. Uncomment 17 line inside main_vertex.glsl file to fix gl_InstanceID: // position.x += gl_VertexID * 1e-6f; There is no such problem under Vulkan API. Mesa DRI Intel(R) Iris Pro Graphics 580 (Skylake GT4e) 4.5 (Core Profile) Mesa 18.0.0-rc4
I've tried your example app with current Mesa (b3b170ade9) and for me the end result visually is the same whether or not I comment out line that adds gl_VertexID usage. Could you comment on what is the expected result with/without the line and maybe also retry test with current Mesa?
I'm still on Ubuntu 16.04 and the latest available Mesa version is 18.0.5 (from x-swat). I have main_instance_draw.png without dependency on gl_VertexID. With artificial dependency rendering is correct (main_instance_draw_vertex.png). I will try to upgrade Mesa on 18.1.* branch in few days.
I have no reproduction on Mesa 18.1.3. So the bug is related to Mesa 18.0.* only.
Could this be related to https://bugs.freedesktop.org/show_bug.cgi?id=102678 ?
This bug cannot be reproduced on a supported version of mesa, closing.
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.