From 447545311b44e33f07bb2db45fcb4f0f225eae4b Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Tue, 7 Mar 2017 16:29:35 +0100 Subject: [PATCH] Add test for input I/O blocks in fragment. --- reference/shaders-hlsl/frag/io-block.frag | 28 +++++++++++++++++++++++ shaders-hlsl/frag/io-block.frag | 16 +++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 reference/shaders-hlsl/frag/io-block.frag create mode 100644 shaders-hlsl/frag/io-block.frag diff --git a/reference/shaders-hlsl/frag/io-block.frag b/reference/shaders-hlsl/frag/io-block.frag new file mode 100644 index 00000000..52c1f518 --- /dev/null +++ b/reference/shaders-hlsl/frag/io-block.frag @@ -0,0 +1,28 @@ +static float4 FragColor; + +struct VertexOut +{ + float4 a : TEXCOORD1; + float4 b : TEXCOORD2; +}; + +static VertexOut _12; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = _12.a + _12.b; +} + +SPIRV_Cross_Output main(in VertexOut stage_input_12) +{ + _12 = stage_input_12; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/shaders-hlsl/frag/io-block.frag b/shaders-hlsl/frag/io-block.frag new file mode 100644 index 00000000..1e3e3d77 --- /dev/null +++ b/shaders-hlsl/frag/io-block.frag @@ -0,0 +1,16 @@ +#version 310 es +#extension GL_EXT_shader_io_blocks : require +precision mediump float; + +layout(location = 1) in VertexOut +{ + vec4 a; + vec4 b; +}; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = a + b; +}