Update test output for preserve structured.

This commit is contained in:
Hans-Kristian Arntzen 2023-05-19 11:29:45 +02:00
parent 63ea1a521b
commit bf752edaa4
7 changed files with 58 additions and 4 deletions

View File

@ -9,7 +9,7 @@ static float4 out_var_SV_Target;
struct SPIRV_Cross_Output
{
float4 out_var_SV_Target : COLOR0;
float4 out_var_SV_Target : SV_Target0;
};
void frag_main()
@ -21,6 +21,6 @@ SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.out_var_SV_Target = float4(out_var_SV_Target);
stage_output.out_var_SV_Target = out_var_SV_Target;
return stage_output;
}

View File

@ -9,7 +9,7 @@ static float4 out_var_SV_Target;
struct SPIRV_Cross_Output
{
float4 out_var_SV_Target : COLOR0;
float4 out_var_SV_Target : SV_Target0;
};
void frag_main()
@ -21,6 +21,6 @@ SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.out_var_SV_Target = float4(out_var_SV_Target);
stage_output.out_var_SV_Target = out_var_SV_Target;
return stage_output;
}

View File

@ -0,0 +1,26 @@
struct Data
{
float4 Color;
};
StructuredBuffer<Data> Colors[2] : register(t0);
static float4 out_var_SV_Target;
struct SPIRV_Cross_Output
{
float4 out_var_SV_Target : SV_Target0;
};
void frag_main()
{
out_var_SV_Target = Colors[1][3u].Color;
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.out_var_SV_Target = out_var_SV_Target;
return stage_output;
}

View File

@ -0,0 +1,26 @@
struct Data
{
float4 Color;
};
StructuredBuffer<Data> Colors : register(t0);
static float4 out_var_SV_Target;
struct SPIRV_Cross_Output
{
float4 out_var_SV_Target : SV_Target0;
};
void frag_main()
{
out_var_SV_Target = Colors[3u].Color;
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.out_var_SV_Target = out_var_SV_Target;
return stage_output;
}

View File

@ -515,6 +515,8 @@ def cross_compile_hlsl(shader, spirv, opt, force_no_external_validation, iterati
hlsl_args.append('--hlsl-flatten-matrix-vertex-input-semantics')
if '.relax-nan.' in shader:
hlsl_args.append('--relax-nan-checks')
if '.structured.' in shader:
hlsl_args.append('--hlsl-preserve-structured-buffers')
subprocess.check_call(hlsl_args)