diff --git a/libs/video/renderer/vulkan/shader/alias.vert b/libs/video/renderer/vulkan/shader/alias.vert index 7292bee8e..ccfa78756 100644 --- a/libs/video/renderer/vulkan/shader/alias.vert +++ b/libs/video/renderer/vulkan/shader/alias.vert @@ -1,11 +1,9 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (push_constant) uniform PushConstants { mat4 Model; diff --git a/libs/video/renderer/vulkan/shader/alias_depth.vert b/libs/video/renderer/vulkan/shader/alias_depth.vert index 2d580cd11..7f14e2ace 100644 --- a/libs/video/renderer/vulkan/shader/alias_depth.vert +++ b/libs/video/renderer/vulkan/shader/alias_depth.vert @@ -1,11 +1,9 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (push_constant) uniform PushConstants { mat4 Model; diff --git a/libs/video/renderer/vulkan/shader/bsp_depth.vert b/libs/video/renderer/vulkan/shader/bsp_depth.vert index 14f5e802e..a3ab262ba 100644 --- a/libs/video/renderer/vulkan/shader/bsp_depth.vert +++ b/libs/video/renderer/vulkan/shader/bsp_depth.vert @@ -3,12 +3,9 @@ #include "entity.h" -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (set = 1, binding = 0) buffer Entities { Entity entities[]; diff --git a/libs/video/renderer/vulkan/shader/bsp_gbuf.vert b/libs/video/renderer/vulkan/shader/bsp_gbuf.vert index 6cb8efb28..7b66575a4 100644 --- a/libs/video/renderer/vulkan/shader/bsp_gbuf.vert +++ b/libs/video/renderer/vulkan/shader/bsp_gbuf.vert @@ -3,12 +3,9 @@ #include "entity.h" -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (set = 1, binding = 0) buffer Entities { Entity entities[]; diff --git a/libs/video/renderer/vulkan/shader/glyph.vert b/libs/video/renderer/vulkan/shader/glyph.vert index 65cea66dc..864df9ebf 100644 --- a/libs/video/renderer/vulkan/shader/glyph.vert +++ b/libs/video/renderer/vulkan/shader/glyph.vert @@ -1,11 +1,9 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (set = 1, binding = 0) uniform textureBuffer glyph_data; // per instance data diff --git a/libs/video/renderer/vulkan/shader/iqm.vert b/libs/video/renderer/vulkan/shader/iqm.vert index 9b665c283..a40d0ba70 100644 --- a/libs/video/renderer/vulkan/shader/iqm.vert +++ b/libs/video/renderer/vulkan/shader/iqm.vert @@ -1,13 +1,11 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable layout (constant_id = 0) const bool IQMDepthOnly = false; -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (set = 2, binding = 0) buffer Bones { // NOTE these are transposed, so v * m diff --git a/libs/video/renderer/vulkan/shader/line.vert b/libs/video/renderer/vulkan/shader/line.vert index 754ba5cfb..25bf0b50c 100644 --- a/libs/video/renderer/vulkan/shader/line.vert +++ b/libs/video/renderer/vulkan/shader/line.vert @@ -1,11 +1,9 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (location = 0) in vec2 vertex; layout (location = 1) in vec2 uv; layout (location = 2) in vec4 vcolor; diff --git a/libs/video/renderer/vulkan/shader/matrices.h b/libs/video/renderer/vulkan/shader/matrices.h new file mode 100644 index 000000000..f54ffab14 --- /dev/null +++ b/libs/video/renderer/vulkan/shader/matrices.h @@ -0,0 +1,6 @@ +Matrices { + mat4 Projection3d; + mat4 View; + mat4 Sky; + mat4 Projection2d; +} diff --git a/libs/video/renderer/vulkan/shader/particle.vert b/libs/video/renderer/vulkan/shader/particle.vert index 655e31042..85c5d12b2 100644 --- a/libs/video/renderer/vulkan/shader/particle.vert +++ b/libs/video/renderer/vulkan/shader/particle.vert @@ -1,11 +1,9 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (push_constant) uniform PushConstants { mat4 Model; diff --git a/libs/video/renderer/vulkan/shader/quakebsp.vert b/libs/video/renderer/vulkan/shader/quakebsp.vert index 4b379a06a..e93c0ea9e 100644 --- a/libs/video/renderer/vulkan/shader/quakebsp.vert +++ b/libs/video/renderer/vulkan/shader/quakebsp.vert @@ -3,12 +3,9 @@ #include "entity.h" -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (set = 1, binding = 0) buffer Entities { Entity entities[]; diff --git a/libs/video/renderer/vulkan/shader/slice.vert b/libs/video/renderer/vulkan/shader/slice.vert index c1009e925..bdf749410 100644 --- a/libs/video/renderer/vulkan/shader/slice.vert +++ b/libs/video/renderer/vulkan/shader/slice.vert @@ -1,11 +1,9 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (set = 1, binding = 0) uniform textureBuffer glyph_data; // per instance data diff --git a/libs/video/renderer/vulkan/shader/sprite_depth.vert b/libs/video/renderer/vulkan/shader/sprite_depth.vert index 430603dd3..20f6dc0d6 100644 --- a/libs/video/renderer/vulkan/shader/sprite_depth.vert +++ b/libs/video/renderer/vulkan/shader/sprite_depth.vert @@ -1,11 +1,9 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (set = 1, binding = 0) uniform Vertices { vec4 xyuv[4]; diff --git a/libs/video/renderer/vulkan/shader/sprite_gbuf.vert b/libs/video/renderer/vulkan/shader/sprite_gbuf.vert index acbf18a2e..1cdfb0f26 100644 --- a/libs/video/renderer/vulkan/shader/sprite_gbuf.vert +++ b/libs/video/renderer/vulkan/shader/sprite_gbuf.vert @@ -1,11 +1,9 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; layout (set = 1, binding = 0) uniform Vertices { vec4 xyuv[4]; diff --git a/libs/video/renderer/vulkan/shader/twod.vert b/libs/video/renderer/vulkan/shader/twod.vert index 8f0a25f57..d6501a633 100644 --- a/libs/video/renderer/vulkan/shader/twod.vert +++ b/libs/video/renderer/vulkan/shader/twod.vert @@ -1,11 +1,9 @@ #version 450 +#extension GL_GOOGLE_include_directive : enable -layout (set = 0, binding = 0) uniform Matrices { - mat4 Projection3d; - mat4 View; - mat4 Sky; - mat4 Projection2d; -}; +layout (set = 0, binding = 0) uniform +#include "matrices.h" +; /** Vertex position. x, y, s, t