Debian Codegraph @

tests/manual/rhi/geometryshader/test_geom.hlsl

raw
1 struct VertexOutput
2 {
3 float4 position : SV_Position;
4 };
5
6 struct PixelInput
7 {
8 float4 position : SV_POSITION;
9 };
10
11 cbuffer buf : register(b0)
12 {
13 float radius : packoffset(c0);
14 };
15
16 [maxvertexcount(7)]
17 void main(point VertexOutput input[1], inout LineStream<PixelInput> OutputStream)
18 {
19 PixelInput output;
20 for (int i = 0; i < 7; ++i) {
21 float theta = float(i) / 6.0f * 2.0 * 3.14159265;
22 output.position = input[0].position;
23 output.position.xy += radius * float2(cos(theta), sin(theta));
24 OutputStream.Append(output);
25 }
26 }