summaryrefslogtreecommitdiff
path: root/line2rect.hlgs
diff options
context:
space:
mode:
Diffstat (limited to 'line2rect.hlgs')
-rw-r--r--line2rect.hlgs62
1 files changed, 62 insertions, 0 deletions
diff --git a/line2rect.hlgs b/line2rect.hlgs
new file mode 100644
index 0000000..f5b3991
--- /dev/null
+++ b/line2rect.hlgs
@@ -0,0 +1,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();
+}