Created attachment 124298 [details] Point-to-cube geometry shader with toggleable GS instancing Overview: If GLSL 4.00 GS instancing is enabled via the `layout(invocations = x) in;` layout specifier (where x > 1), the GS no longer reads valid data from the vertex shader. Steps to Reproduce: You will need a GPU which currently supports GLSL 4.00. This is currently restricted to gen8+. 1) Find a geometry shader you can change. 2) Ensure the #version directive is 400 or higher - if not, bump it up to 400. 3) Add this line near the top of it: layout(invocations = 2) in; 4) Observe that the geometry is now garbage or apparently missing (degenerate / culled primitives). Attached is a geometry shader with toggleable GS instancing. It requires GL_POINTS as input. vec3 v_vtx[], v_col[] are vertex and colour attribute data respectively. mat4 Mproj, Mcam are projection and modelview matrices respectively. vec3 campos is the position of the camera in the world. Expected Results: For the given shader, input points should be expanded to cubes of their respective colours. Actual Results: A single black cube appears at (0, 0, 0). In some frames you may see intermittent garbage - this is noticeable at ~3000FPS with vsync disabled. The uniform data is being read correctly, but the VS input data is completely wrong. Additional Information: Build Date: 2016-06-03 ~15:30 +1200 Git Revision: d10ae20b9678f1a5b8a81716c68e612662665277 GPU: Intel HD 530 (Skylake GT2) OS: Void Linux This bug may be relevant (#93859) - the output is SIMD8: https://bugs.freedesktop.org/show_bug.cgi?id=93859
Could you please provide also an application and the vertex/fragment shaders which helped you to reproduce this issue? It would be very helpful and could expedite the issue solving.
Created attachment 140004 [details] Results on Mesa 18.2.0 (Intel)
Created attachment 140005 [details] Results on Mesa 12.1.0-devel (git-d10ae20)
Created attachment 140006 [details] Results on Mesa 17.2.8 (Radeon)
Created attachment 140007 [details] The shader_test to reproduce the issue
I managed to reproduce this issue using geometry-point-to-cube-using-instancing.shader_test on Mesa 12.1.0 from revision d10ae20b9678f1a5b8a81716c68e612662665277. Note: To reproduce this issue you should press 'space' key (actually any key except 'escape') once or more times on the shader_runner screen and after that single black cube should appear in the center of the screen: But I could not reproduce this issue on Mesa 13.1.0 and Mesa 18.2.0. So I think that this issue was fixed at least in Mesa 13.1.0 or in earlier version.
Should be covered by new piglit test. Closing. commit ad2158276164e40f52e8a8656256c1e03ac304f3 Author: Andrii Simiklit <asimiklit.work@gmail.com> Date: Tue Jun 5 16:33:00 2018 +0300 arb_gpu_shader5: Add a test for instanced GS inputs. None of our other tests for instanced geometry shaders transfered the vertices to the geometry shader from the vertex shader via gl_Position. This used to be broken with the i965 driver's in Mesa 12.1.0 on revision d10ae20b9678f1a5b8a81716c68e612662665277. Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96354
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.