Add some tests for no stage inputs or outputs in HLSL.
This commit is contained in:
parent
62df60ea3d
commit
e89b789af3
8
reference/shaders-hlsl/frag/no-return.frag
Normal file
8
reference/shaders-hlsl/frag/no-return.frag
Normal file
@ -0,0 +1,8 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
17
reference/shaders-hlsl/frag/no-return2.frag
Normal file
17
reference/shaders-hlsl/frag/no-return2.frag
Normal file
@ -0,0 +1,17 @@
|
||||
static float4 vColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 v = vColor;
|
||||
}
|
||||
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vColor = stage_input.vColor;
|
||||
frag_main();
|
||||
}
|
18
reference/shaders-hlsl/vert/no-input.vert
Normal file
18
reference/shaders-hlsl/vert/no-input.vert
Normal file
@ -0,0 +1,18 @@
|
||||
static float4 gl_Position;
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = float4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
5
shaders-hlsl/frag/no-return.frag
Normal file
5
shaders-hlsl/frag/no-return.frag
Normal file
@ -0,0 +1,5 @@
|
||||
#version 310 es
|
||||
|
||||
void main()
|
||||
{
|
||||
}
|
9
shaders-hlsl/frag/no-return2.frag
Normal file
9
shaders-hlsl/frag/no-return2.frag
Normal file
@ -0,0 +1,9 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
|
||||
layout(location = 0) in vec4 vColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 v = vColor;
|
||||
}
|
6
shaders-hlsl/vert/no-input.vert
Normal file
6
shaders-hlsl/vert/no-input.vert
Normal file
@ -0,0 +1,6 @@
|
||||
#version 310 es
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(1.0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user