Organize uniforms better;
@@ -44,12 +44,6 @@ const char* lovrShaderVertexPrefix = ""
"in vec4 lovrBoneWeights; \n"
"out vec2 texCoord; \n"
"out vec4 vertexColor; \n"
-"#ifdef GL_AMD_vertex_shader_viewport_index \n"
-"#define lovrViewportIndex gl_ViewportIndex \n"
-"#else \n"
-"uniform int lovrViewportIndex; \n"
-"#endif \n"
-"uniform int lovrViewportCount; \n"
"uniform mat4 lovrModel; \n"
"uniform mat4 lovrViews[2]; \n"
"uniform mat4 lovrProjections[2]; \n"
@@ -58,6 +52,12 @@ const char* lovrShaderVertexPrefix = ""
"uniform mat3 lovrMaterialTransform; \n"
"uniform float lovrPointSize; \n"
"uniform mat4 lovrPose[MAX_BONES]; \n"
+"uniform int lovrViewportCount; \n"
+"#ifdef GL_AMD_vertex_shader_viewport_index \n"
+"#define lovrViewportIndex gl_ViewportIndex \n"
+"#else \n"
+"uniform int lovrViewportIndex; \n"
+"#endif \n"
"#line 0 \n";
const char* lovrShaderVertexSuffix = ""
@@ -91,12 +91,6 @@ const char* lovrShaderFragmentPrefix = ""
"in vec2 texCoord; \n"
"in vec4 vertexColor; \n"
"out vec4 lovrCanvas[gl_MaxDrawBuffers]; \n"
-"#ifdef GL_ARB_fragment_layer_viewport \n"
-"#define lovrViewportIndex gl_ViewportIndex \n"
-"#else \n"
-"uniform int lovrViewportIndex; \n"
-"#endif \n"
-"uniform int lovrViewportCount; \n"
"uniform float lovrMetalness; \n"
"uniform float lovrRoughness; \n"
"uniform vec4 lovrColor; \n"
@@ -109,6 +103,12 @@ const char* lovrShaderFragmentPrefix = ""
"uniform sampler2D lovrOcclusionTexture; \n"
"uniform sampler2D lovrNormalTexture; \n"
"uniform samplerCube lovrEnvironmentTexture; \n"
+"uniform int lovrViewportCount; \n"
+"#ifdef GL_ARB_fragment_layer_viewport \n"
+"#define lovrViewportIndex gl_ViewportIndex \n"
+"#else \n"
+"uniform int lovrViewportIndex; \n"
+"#endif \n"
"#line 0 \n";
const char* lovrShaderFragmentSuffix = ""
