mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[hlsl-out] Enable interface snapshot testing
This commit is contained in:
committed by
Dzmitry Malyshau
parent
2812acf8cd
commit
d5776879de
51
tests/out/hlsl/interface.hlsl
Normal file
51
tests/out/hlsl/interface.hlsl
Normal file
@@ -0,0 +1,51 @@
|
||||
struct VertexOutput {
|
||||
float4 position : SV_Position;
|
||||
float varying : LOC1;
|
||||
};
|
||||
|
||||
struct FragmentOutput {
|
||||
float depth : SV_Depth;
|
||||
uint sample_mask : SV_Coverage;
|
||||
float color : SV_Target0;
|
||||
};
|
||||
|
||||
struct VertexInput_vertex {
|
||||
uint vertex_index1 : SV_VertexID;
|
||||
uint instance_index1 : SV_InstanceID;
|
||||
uint color1 : LOC10;
|
||||
};
|
||||
|
||||
struct FragmentInput_fragment {
|
||||
VertexOutput in2;
|
||||
bool front_facing1 : SV_IsFrontFace;
|
||||
uint sample_index1 : SV_SampleIndex;
|
||||
uint sample_mask1 : SV_Coverage;
|
||||
};
|
||||
|
||||
struct ComputeInput_compute {
|
||||
uint3 global_id1 : SV_DispatchThreadID;
|
||||
uint3 local_id1 : SV_GroupThreadID;
|
||||
uint local_index1 : SV_GroupIndex;
|
||||
uint3 wg_id1 : SV_GroupID;
|
||||
};
|
||||
|
||||
VertexOutput vertex(VertexInput_vertex vertexinput_vertex)
|
||||
{
|
||||
uint tmp = ((vertexinput_vertex.vertex_index1 + vertexinput_vertex.instance_index1) + vertexinput_vertex.color1);
|
||||
const VertexOutput vertexoutput1 = { float4(1.0.xxxx), float(tmp) };
|
||||
return vertexoutput1;
|
||||
}
|
||||
|
||||
FragmentOutput fragment(FragmentInput_fragment fragmentinput_fragment)
|
||||
{
|
||||
uint mask = (fragmentinput_fragment.sample_mask1 & (1u << fragmentinput_fragment.sample_index1));
|
||||
float color2 = (fragmentinput_fragment.front_facing1 ? 0.0 : 1.0);
|
||||
const FragmentOutput fragmentoutput1 = { fragmentinput_fragment.in2.varying, mask, color2 };
|
||||
return fragmentoutput1;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute(ComputeInput_compute computeinput_compute)
|
||||
{
|
||||
return;
|
||||
}
|
||||
6
tests/out/hlsl/interface.hlsl.config
Normal file
6
tests/out/hlsl/interface.hlsl.config
Normal file
@@ -0,0 +1,6 @@
|
||||
vertex=vs_5_0
|
||||
vertex_name=vertex
|
||||
fragment=ps_5_0
|
||||
fragment_name=fragment
|
||||
compute=cs_5_0
|
||||
compute_name=compute
|
||||
@@ -374,7 +374,10 @@ fn convert_wgsl() {
|
||||
Targets::SPIRV | Targets::METAL | Targets::GLSL | Targets::HLSL | Targets::WGSL,
|
||||
),
|
||||
//TODO: GLSL https://github.com/gfx-rs/naga/issues/874
|
||||
("interface", Targets::SPIRV | Targets::METAL | Targets::WGSL),
|
||||
(
|
||||
"interface",
|
||||
Targets::SPIRV | Targets::METAL | Targets::HLSL | Targets::WGSL,
|
||||
),
|
||||
(
|
||||
"globals",
|
||||
Targets::SPIRV | Targets::METAL | Targets::GLSL | Targets::WGSL,
|
||||
|
||||
Reference in New Issue
Block a user