summaryrefslogtreecommitdiff
path: root/geometry.template
blob: f5b39914d3c3f3af50f3bd7f630a0398abff2843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* Automatically generated file; do not edit */

// This geometry shader takes a list of lines as input, and
// generates a (4 point) triangle strip representing a rectangle
// for each.

struct vertex {
    float2 tile_pos :TEXCOORD0;
    float2 clip_pos :TEXCOORD1;
    float2 out_pos  :TEXCOORD2;
    float4 pos      :SV_POSITION;
};

[maxvertexcount(4)]
void main(line vertex input[2], inout TriangleStream<vertex> output)
{
    vertex v;
    v.pos.z = 0;
    v.pos.w = 1;

    v.pos.x      = input[0].pos.x;
    v.tile_pos.x = input[0].tile_pos.x;
    v.clip_pos.x = input[0].clip_pos.x;
    v.out_pos.x  = input[0].out_pos.x;
    v.pos.y      = input[1].pos.y;
    v.tile_pos.y = input[1].tile_pos.y;
    v.clip_pos.y = input[1].clip_pos.y;
    v.out_pos.y  = input[1].out_pos.y;
    output.Append(v);

    v.pos.x      = input[0].pos.x;
    v.tile_pos.x = input[0].tile_pos.x;
    v.clip_pos.x = input[0].clip_pos.x;
    v.out_pos.x  = input[0].out_pos.x;
    v.pos.y      = input[0].pos.y;
    v.tile_pos.y = input[0].tile_pos.y;
    v.clip_pos.y = input[0].clip_pos.y;
    v.out_pos.y  = input[0].out_pos.y;
    output.Append(v);

    v.pos.x      = input[1].pos.x;
    v.tile_pos.x = input[1].tile_pos.x;
    v.clip_pos.x = input[1].clip_pos.x;
    v.out_pos.x  = input[1].out_pos.x;
    v.pos.y      = input[1].pos.y;
    v.tile_pos.y = input[1].tile_pos.y;
    v.clip_pos.y = input[1].clip_pos.y;
    v.out_pos.y  = input[1].out_pos.y;
    output.Append(v);

    v.pos.x      = input[1].pos.x;
    v.tile_pos.x = input[1].tile_pos.x;
    v.clip_pos.x = input[1].clip_pos.x;
    v.out_pos.x  = input[1].out_pos.x;
    v.pos.y      = input[0].pos.y;
    v.tile_pos.y = input[0].tile_pos.y;
    v.clip_pos.y = input[0].clip_pos.y;
    v.out_pos.y  = input[0].out_pos.y;
    output.Append(v);

    output.RestartStrip();
}