Hello.
Though I have been using OpenGL for some time now, I have posted in under ‘Basic Coding’ because I feel if this isn’t a driver bug, then I might be missing something very simple.
I have been experimenting with geometry shaders recently to allow me to take some work more work off the CPU.
In my current minial example I have this setup:
Vertex Shader
#version 330 core
uniform mat4 gfxPV;
in mat4 gfxTransform;
flat out int instID;
out mat4 vertTransform;
void main()
{
instID = gl_InstanceID;
vertTransform = gfxTransform;
}
Geometry Shader
#version 330 core
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
flat in int instID[];
in mat4 vertTransform[];
uniform mat4 gfxPV;
out vec2 uv;
void main()
{
... // Construct a square for each input point
}
I was facing issues and decided to debug it using RenderDoc, only to find this as a result:
If you notice in the vertex shader output section, for some reason the instID
value is overwriting the first column of the vertTransform
matrix.
I have been unable to fix this despite a days worth of trying, and by extension I am beginning to suspect that this may in fact be a driver bug. In the case that this is a bug with the driver, I am using OpenGL 4.6 (Core Profile) Mesa 20.2.3
.
Thanks in advance for any help and info given!