Debian Codegraph @

tests/auto/buildtimeqsb/tess_domain.hlsl

raw
1 struct Input
2 {
3 float edges[3] : SV_TessFactor;
4 float inside : SV_InsideTessFactor;
5 };
6
7 struct PatchInput
8 {
9 float3 position : POSITION;
10 float3 color : COLOR;
11 };
12
13 struct PixelInput
14 {
15 float3 color : TEXCOORD0;
16 float4 position : SV_POSITION;
17 };
18
19 cbuffer buf : register(b0)
20 {
21 row_major float4x4 mvp : packoffset(c0);
22 float time : packoffset(c4);
23 float amplitude : packoffset(c4.y);
24 };
25
26 [domain("tri")]
27 PixelInput main(Input input, float3 uvwCoord : SV_DomainLocation, const OutputPatch<PatchInput, 3> patch)
28 {
29 PixelInput output;
30
31 float3 vertexPosition = uvwCoord.x * patch[0].position + uvwCoord.y * patch[1].position + uvwCoord.z * patch[2].position;
32 output.position = mul(float4(vertexPosition, 1.0f), mvp);
33 output.position.x += sin(time + vertexPosition.y) * amplitude;
34
35 output.color = uvwCoord.x * patch[0].color + uvwCoord.y * patch[1].color + uvwCoord.z * patch[2].color;
36
37 return output;
38 }