|
@@ -92,10 +92,10 @@ static const char render_uniforms[] = R"(
|
|
// but we can't guarantee that highp is always supported in fragment shaders...
|
|
// but we can't guarantee that highp is always supported in fragment shaders...
|
|
// We *really* don't want to use mediump for these in vertex shaders though.
|
|
// We *really* don't want to use mediump for these in vertex shaders though.
|
|
#ifdef LOVE_SPLIT_UNIFORMS_PER_DRAW
|
|
#ifdef LOVE_SPLIT_UNIFORMS_PER_DRAW
|
|
-uniform LOVE_HIGHP_OR_MEDIUMP vec4 love_UniformsPerDraw[13];
|
|
|
|
|
|
+uniform LOVE_HIGHP_OR_MEDIUMP vec4 love_UniformsPerDraw[11];
|
|
uniform LOVE_HIGHP_OR_MEDIUMP vec4 love_UniformsPerDraw2[1];
|
|
uniform LOVE_HIGHP_OR_MEDIUMP vec4 love_UniformsPerDraw2[1];
|
|
#else
|
|
#else
|
|
-uniform LOVE_HIGHP_OR_MEDIUMP vec4 love_UniformsPerDraw[14];
|
|
|
|
|
|
+uniform LOVE_HIGHP_OR_MEDIUMP vec4 love_UniformsPerDraw[12];
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// Older GLSL doesn't support preprocessor line continuations...
|
|
// Older GLSL doesn't support preprocessor line continuations...
|
|
@@ -103,26 +103,23 @@ uniform LOVE_HIGHP_OR_MEDIUMP vec4 love_UniformsPerDraw[14];
|
|
#define ProjectionMatrix mat4(love_UniformsPerDraw[4], love_UniformsPerDraw[5], love_UniformsPerDraw[6], love_UniformsPerDraw[7])
|
|
#define ProjectionMatrix mat4(love_UniformsPerDraw[4], love_UniformsPerDraw[5], love_UniformsPerDraw[6], love_UniformsPerDraw[7])
|
|
#define TransformProjectionMatrix (ProjectionMatrix * TransformMatrix)
|
|
#define TransformProjectionMatrix (ProjectionMatrix * TransformMatrix)
|
|
|
|
|
|
-#define NormalMatrix mat3(love_UniformsPerDraw[8].xyz, love_UniformsPerDraw[9].xyz, love_UniformsPerDraw[10].xyz)
|
|
|
|
|
|
+#define CurrentDPIScale (love_UniformsPerDraw[8].x)
|
|
|
|
+#define ConstantPointSize (love_UniformsPerDraw[8].y)
|
|
|
|
|
|
-#define CurrentDPIScale (love_UniformsPerDraw[8].w)
|
|
|
|
-#define ConstantPointSize (love_UniformsPerDraw[9].w)
|
|
|
|
|
|
+#define love_ClipSpaceParams (love_UniformsPerDraw[9])
|
|
|
|
|
|
-#define love_ClipSpaceParams (love_UniformsPerDraw[11])
|
|
|
|
-
|
|
|
|
-#define ConstantColor (love_UniformsPerDraw[12])
|
|
|
|
|
|
+#define ConstantColor (love_UniformsPerDraw[10])
|
|
|
|
|
|
#ifdef LOVE_SPLIT_UNIFORMS_PER_DRAW
|
|
#ifdef LOVE_SPLIT_UNIFORMS_PER_DRAW
|
|
#define love_ScreenSize (love_UniformsPerDraw2[0])
|
|
#define love_ScreenSize (love_UniformsPerDraw2[0])
|
|
#else
|
|
#else
|
|
-#define love_ScreenSize (love_UniformsPerDraw[13])
|
|
|
|
|
|
+#define love_ScreenSize (love_UniformsPerDraw[11])
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// Alternate names
|
|
// Alternate names
|
|
#define ViewSpaceFromLocal TransformMatrix
|
|
#define ViewSpaceFromLocal TransformMatrix
|
|
#define ClipSpaceFromView ProjectionMatrix
|
|
#define ClipSpaceFromView ProjectionMatrix
|
|
#define ClipSpaceFromLocal TransformProjectionMatrix
|
|
#define ClipSpaceFromLocal TransformProjectionMatrix
|
|
-#define ViewNormalFromLocal NormalMatrix
|
|
|
|
)";
|
|
)";
|
|
|
|
|
|
static const char global_functions[] = R"(
|
|
static const char global_functions[] = R"(
|
|
@@ -599,7 +596,7 @@ static Shader::EntryPoint getComputeEntryPoint(const std::string &src, const std
|
|
|
|
|
|
} // glsl
|
|
} // glsl
|
|
|
|
|
|
-static_assert(sizeof(Shader::BuiltinUniformData) == sizeof(float) * 4 * 14, "Update the array in wrap_GraphicsShader.lua if this changes.");
|
|
|
|
|
|
+static_assert(sizeof(Shader::BuiltinUniformData) == sizeof(float) * 4 * 12, "Update the array in wrap_GraphicsShader.lua if this changes.");
|
|
|
|
|
|
love::Type Shader::type("Shader", &Object::type);
|
|
love::Type Shader::type("Shader", &Object::type);
|
|
|
|
|