Use #include in crt/ shaders.

This commit is contained in:
Hans-Kristian Arntzen 2016-03-25 17:34:21 +01:00
parent 1d33c8decb
commit 7ea771e71f
4 changed files with 10 additions and 22 deletions

6
crt/common.inc Normal file
View file

@ -0,0 +1,6 @@
layout(std140, set = 0, binding = 1) uniform UBO
{
mat4 MVP;
vec4 SourceSize;
} global;

View file

@ -1,12 +1,6 @@
#version 450 #version 450
layout(std140, set = 0, binding = 0) uniform UBO #include "common.inc"
{
mat4 MVP;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
} global;
#pragma stage vertex #pragma stage vertex
layout(location = 0) in vec4 Position; layout(location = 0) in vec4 Position;

View file

@ -1,12 +1,6 @@
#version 450 #version 450
layout(std140, set = 0, binding = 0) uniform UBO #include "common.inc"
{
mat4 MVP;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
} global;
#pragma stage vertex #pragma stage vertex
layout(location = 0) in vec4 Position; layout(location = 0) in vec4 Position;

View file

@ -1,12 +1,6 @@
#version 450 #version 450
layout(std140, set = 0, binding = 0) uniform UBO #include "common.inc"
{
mat4 MVP;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
} global;
#pragma stage vertex #pragma stage vertex
layout(location = 0) in vec4 Position; layout(location = 0) in vec4 Position;
@ -22,7 +16,7 @@ void main()
#pragma stage fragment #pragma stage fragment
layout(location = 0) in vec2 vTexCoord; layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor; 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 #define PI 3.1415926535