mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 15:28:37 +00:00
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>
23 lines
888 B
GLSL
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();
|
|
}
|
|
}
|