Files
mandy/runtime/test/glsl/gs_double.geom
TheHoracio 2a015677b3 Runtime: geometry shaders in graphics PSOs (VS + GS + PS)
CreateGraphicsPipelineState refused any desc.GS, although all 195 geometry
shaders translate (triangles in, a triangle strip out; docs/design.md
"Geometry shaders"). The stage table now holds VS, GS and PS; a GS needs the
geometryShader feature (enabled on the standalone and test devices where
the GPU has it, E_NOTIMPL otherwise), and the PSO's topology type must be
TRIANGLE, the GS's input (E_INVALIDARG otherwise). The push-constant range
names the geometry stage only where the device has it. Hull, domain and
stream output stay refused.

d3d12_geometry_test (in ctest): a GS that emits each triangle twice, against
a pipeline without one, and a line topology refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:05:49 +01:00

23 lines
888 B
GLSL

#version 460
// A geometry shader with the interface of a translated one (docs/design.md, "Geometry shaders": triangles in, a
// triangle strip out, inputs and outputs at the signature's locations), for d3d12_geometry_test. It emits every
// input triangle twice: as it is, and moved right by one in clip space, so a quad drawn in the top-left quadrant
// also covers the top-right one. The colour at location 0 (vs_draw.vert's output) passes through.
layout(triangles) in;
layout(triangle_strip, max_vertices = 6) out;
layout(location = 0) in vec4 in_color[];
layout(location = 0) out vec4 out_color;
void main() {
for (int copy = 0; copy < 2; ++copy) {
for (int i = 0; i < 3; ++i) {
gl_Position = gl_in[i].gl_Position + vec4(float(copy), 0.0, 0.0, 0.0);
out_color = in_color[i];
EmitVertex();
}
EndPrimitive();
}
}