From fd12124bf72ea3dd201b1d06f6b26252dc0afaab Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Mon, 6 Mar 2017 14:04:01 +0100 Subject: [PATCH] Add tests for legacy I/O flattening. --- .../legacy/fragment/io-blocks.legacy.frag | 12 ++++++++++++ .../shaders/legacy/vert/io-block.legacy.vert | 13 +++++++++++++ shaders/legacy/fragment/io-blocks.legacy.frag | 16 ++++++++++++++++ shaders/legacy/vert/io-block.legacy.vert | 17 +++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 reference/shaders/legacy/fragment/io-blocks.legacy.frag create mode 100644 reference/shaders/legacy/vert/io-block.legacy.vert create mode 100644 shaders/legacy/fragment/io-blocks.legacy.frag create mode 100644 shaders/legacy/vert/io-block.legacy.vert diff --git a/reference/shaders/legacy/fragment/io-blocks.legacy.frag b/reference/shaders/legacy/fragment/io-blocks.legacy.frag new file mode 100644 index 00000000..abcf750a --- /dev/null +++ b/reference/shaders/legacy/fragment/io-blocks.legacy.frag @@ -0,0 +1,12 @@ +#version 100 +precision mediump float; +precision highp int; + +varying vec4 VertexOut_color; +varying highp vec3 VertexOut_normal; + +void main() +{ + gl_FragData[0] = VertexOut_color + VertexOut_normal.xyzz; +} + diff --git a/reference/shaders/legacy/vert/io-block.legacy.vert b/reference/shaders/legacy/vert/io-block.legacy.vert new file mode 100644 index 00000000..b6312369 --- /dev/null +++ b/reference/shaders/legacy/vert/io-block.legacy.vert @@ -0,0 +1,13 @@ +#version 100 + +attribute vec4 Position; +varying vec4 VertexOut_color; +varying vec3 VertexOut_normal; + +void main() +{ + gl_Position = Position; + VertexOut_color = vec4(1.0); + VertexOut_normal = vec3(0.5); +} + diff --git a/shaders/legacy/fragment/io-blocks.legacy.frag b/shaders/legacy/fragment/io-blocks.legacy.frag new file mode 100644 index 00000000..0a151dc2 --- /dev/null +++ b/shaders/legacy/fragment/io-blocks.legacy.frag @@ -0,0 +1,16 @@ +#version 310 es +#extension GL_EXT_shader_io_blocks : require +precision mediump float; + +layout(location = 1) in VertexOut +{ + vec4 color; + highp vec3 normal; +} vin; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = vin.color + vin.normal.xyzz; +} diff --git a/shaders/legacy/vert/io-block.legacy.vert b/shaders/legacy/vert/io-block.legacy.vert new file mode 100644 index 00000000..4fbc9347 --- /dev/null +++ b/shaders/legacy/vert/io-block.legacy.vert @@ -0,0 +1,17 @@ +#version 310 es +#extension GL_EXT_shader_io_blocks : require + +layout(location = 0) out VertexOut +{ + vec4 color; + vec3 normal; +} vout; + +layout(location = 0) in vec4 Position; + +void main() +{ + gl_Position = Position; + vout.color = vec4(1.0); + vout.normal = vec3(0.5); +}