mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
77 lines
1.8 KiB
Plaintext
77 lines
1.8 KiB
Plaintext
[require]
|
|
shader model >= 4.0
|
|
geometry-shader
|
|
|
|
[vertex shader]
|
|
struct vs_data
|
|
{
|
|
float4 pos : SV_Position;
|
|
float4 color : COLOR;
|
|
};
|
|
|
|
void main(out struct vs_data vs_output)
|
|
{
|
|
vs_output.pos = float4(0.0, 0.0, 1.0, 1.0);
|
|
vs_output.color = float4(0.0, 0.0, 1.0, 1.0);
|
|
}
|
|
|
|
[geometry shader]
|
|
struct gs_data
|
|
{
|
|
float4 pos : SV_Position;
|
|
float4 color : COLOR;
|
|
};
|
|
|
|
struct gs_out
|
|
{
|
|
float4 pos : SV_Position;
|
|
float4 color : COLOR;
|
|
uint prim_id : SV_PrimitiveId;
|
|
};
|
|
|
|
[maxvertexcount(4)]
|
|
void main(point struct gs_data vin[1], in uint prim_id : SV_PrimitiveId, inout TriangleStream<gs_out> vout)
|
|
{
|
|
float offset = 0.2 * vin[0].pos.w;
|
|
gs_out v;
|
|
|
|
v.color = vin[0].color;
|
|
/* This only confirms that prim_id is zero. */
|
|
v.color.x = prim_id * 0.25f;
|
|
|
|
v.pos = float4(vin[0].pos.x - offset, vin[0].pos.y - offset, vin[0].pos.z, 1.0);
|
|
v.prim_id = 0;
|
|
vout.Append(v);
|
|
v.pos = float4(vin[0].pos.x - offset, vin[0].pos.y + offset, vin[0].pos.z, 1.0);
|
|
v.prim_id = 1;
|
|
vout.Append(v);
|
|
v.pos = float4(vin[0].pos.x + offset, vin[0].pos.y - offset, vin[0].pos.z, 1.0);
|
|
vout.Append(v);
|
|
v.pos = float4(vin[0].pos.x + offset, vin[0].pos.y + offset, vin[0].pos.z, 1.0);
|
|
vout.Append(v);
|
|
}
|
|
|
|
[pixel shader]
|
|
struct ps_data
|
|
{
|
|
float4 pos : SV_Position;
|
|
float4 color : COLOR;
|
|
uint prim_id : SV_PrimitiveId;
|
|
};
|
|
|
|
float4 main(struct ps_data ps_input) : SV_Target
|
|
{
|
|
float4 color = ps_input.color;
|
|
color.y = ps_input.prim_id * 0.25f;
|
|
return color;
|
|
}
|
|
|
|
[test]
|
|
todo(glsl) draw point list 1
|
|
probe rtv 0 (320, 190) f32(0.0, 0.0, 0.0, 0.0)
|
|
probe rtv 0 (255, 240) f32(0.0, 0.0, 0.0, 0.0)
|
|
probe rtv 0 (319, 241) f32(0.0, 0.0, 1.0, 1.0)
|
|
probe rtv 0 (321, 239) f32(0.0, 0.25, 1.0, 1.0)
|
|
probe rtv 0 (385, 240) f32(0.0, 0.0, 0.0, 0.0)
|
|
probe rtv 0 (320, 290) f32(0.0, 0.0, 0.0, 0.0)
|