From 7ea771e71febb95d91580b7fa0217c8e9d9a7345 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Fri, 25 Mar 2016 17:34:21 +0100 Subject: [PATCH] Use #include in crt/ shaders. --- crt/common.inc | 6 ++++++ crt/cubic.slang | 8 +------- crt/scanline.slang | 8 +------- crt/sinc.slang | 10 ++-------- 4 files changed, 10 insertions(+), 22 deletions(-) create mode 100644 crt/common.inc diff --git a/crt/common.inc b/crt/common.inc new file mode 100644 index 0000000..cdb99d2 --- /dev/null +++ b/crt/common.inc @@ -0,0 +1,6 @@ +layout(std140, set = 0, binding = 1) uniform UBO +{ + mat4 MVP; + vec4 SourceSize; +} global; + diff --git a/crt/cubic.slang b/crt/cubic.slang index 641ae1f..03a8b10 100644 --- a/crt/cubic.slang +++ b/crt/cubic.slang @@ -1,12 +1,6 @@ #version 450 -layout(std140, set = 0, binding = 0) uniform UBO -{ - mat4 MVP; - vec4 OutputSize; - vec4 OriginalSize; - vec4 SourceSize; -} global; +#include "common.inc" #pragma stage vertex layout(location = 0) in vec4 Position; diff --git a/crt/scanline.slang b/crt/scanline.slang index 061d8f1..9427ea8 100644 --- a/crt/scanline.slang +++ b/crt/scanline.slang @@ -1,12 +1,6 @@ #version 450 -layout(std140, set = 0, binding = 0) uniform UBO -{ - mat4 MVP; - vec4 OutputSize; - vec4 OriginalSize; - vec4 SourceSize; -} global; +#include "common.inc" #pragma stage vertex layout(location = 0) in vec4 Position; diff --git a/crt/sinc.slang b/crt/sinc.slang index 1269a24..97490e0 100644 --- a/crt/sinc.slang +++ b/crt/sinc.slang @@ -1,12 +1,6 @@ #version 450 -layout(std140, set = 0, binding = 0) uniform UBO -{ - mat4 MVP; - vec4 OutputSize; - vec4 OriginalSize; - vec4 SourceSize; -} global; +#include "common.inc" #pragma stage vertex layout(location = 0) in vec4 Position; @@ -22,7 +16,7 @@ void main() #pragma stage fragment layout(location = 0) in vec2 vTexCoord; layout(location = 0) out vec4 FragColor; -layout(set = 0, binding = 2) uniform sampler2D Source; +layout(set = 0, binding = 0) uniform sampler2D Source; #define PI 3.1415926535