I've been working with two different PCs on a Vulkan program, recently implementing a Geometry Shader. On PC #2, the shader works fine, but on PC #1, it runs into some unexplainable glitch.
I did some testing and found the glitch is occurs whenever EndPrimitive is called.
For reference, the following (incorrect) code produces image 1, the (desired) image.
#version 430
#extension GL_EXT_scalar_block_layout: enable
layout (triangles) in;
layout (triangle_strip, max_vertices = 256) out;
layout(location = 0) in vec4 fragColor[];
layout(location = 1) in vec2 fragTexCoord[];
layout(location = 2) flat in int texIndex[];
layout(location = 3) in ivec2 texRepeat[];
layout(location = 0) out vec4 fragColorOut;
layout(location = 1) out vec2 fragTexCoordOut;
layout(location = 2) flat out int texIndexOut;
void drawVertex(int i) {
fragColorOut = vec4(fragColor[i].x,fragColor[i].y,fragColor[i].z,fragColor[i].a);
fragTexCoordOut = fragTexCoord[i];
texIndexOut = texIndex[i];
EmitVertex();
}
void main() {
gl_Position = gl_in[0].gl_Position;
drawVertex(0);
gl_Position = gl_in[1].gl_Position;
drawVertex(1);
gl_Position = gl_in[2].gl_Position;
drawVertex(2);
return;
}
However, whenever I add EndPrimitive() right before the return statement I end up with the second deformed image. This only occurs on 1 out of 2 of my Computers, and I'm inclined to believe it might be a driver bug. So far the only validation errors on PC #1, are the benign invalid manifest file messages. Would appreciate some feedback on this issue.