2022-04-07 16:58:16 -07:00
|
|
|
[input layout]
|
|
|
|
0 r32g32b32a32 float texcoord
|
2022-08-15 17:53:55 -07:00
|
|
|
0 r32g32 float position
|
2022-04-07 16:58:16 -07:00
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[vb 0]
|
2022-04-07 16:58:16 -07:00
|
|
|
0.0 1.0 0.0 1.0 -2.0 -2.0
|
|
|
|
0.0 1.0 0.0 1.0 -2.0 2.0
|
|
|
|
0.0 1.0 0.0 1.0 2.0 -2.0
|
|
|
|
0.0 1.0 0.0 1.0 2.0 2.0
|
|
|
|
|
|
|
|
[vertex shader]
|
|
|
|
|
2022-08-15 17:53:55 -07:00
|
|
|
struct in_vertex
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
float4 texcoord : texcoord;
|
|
|
|
float4 pos : position;
|
|
|
|
} m;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct out_vertex
|
2022-04-07 16:58:16 -07:00
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
float4 texcoord : texcoord;
|
|
|
|
float4 pos : sv_position;
|
|
|
|
} m;
|
|
|
|
};
|
|
|
|
|
2022-08-15 17:53:55 -07:00
|
|
|
void main(struct in_vertex i, out struct out_vertex o)
|
2022-04-07 16:58:16 -07:00
|
|
|
{
|
2022-08-15 17:53:55 -07:00
|
|
|
o.m.pos = i.m.pos;
|
|
|
|
o.m.texcoord = i.m.texcoord;
|
2022-04-07 16:58:16 -07:00
|
|
|
}
|
|
|
|
|
2020-10-03 14:24:24 -07:00
|
|
|
[pixel shader]
|
|
|
|
struct input
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2022-04-07 16:58:16 -07:00
|
|
|
float4 texcoord : texcoord;
|
2020-10-03 14:24:24 -07:00
|
|
|
} m;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct output
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
float4 color : sv_target;
|
|
|
|
} m;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct output main(struct input i)
|
|
|
|
{
|
|
|
|
struct output o;
|
2022-04-07 16:58:16 -07:00
|
|
|
o.m.color = i.m.texcoord;
|
2020-10-03 14:24:24 -07:00
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw triangle strip 4
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (0.0, 1.0, 0.0, 1.0)
|