mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Change the internal constant color from a (per-draw) vertex attribute to a uniform. Pack most built-in uniforms into a single vec4 array and update them all with a single glUniform call.
--HG-- branch : minor
This commit is contained in:
@@ -68,12 +68,8 @@ public:
|
||||
BUILTIN_TEXTURE_VIDEO_Y,
|
||||
BUILTIN_TEXTURE_VIDEO_CB,
|
||||
BUILTIN_TEXTURE_VIDEO_CR,
|
||||
BUILTIN_MATRIX_VIEW_FROM_LOCAL,
|
||||
BUILTIN_MATRIX_CLIP_FROM_VIEW,
|
||||
BUILTIN_MATRIX_CLIP_FROM_LOCAL,
|
||||
BUILTIN_MATRIX_VIEW_NORMAL_FROM_LOCAL,
|
||||
BUILTIN_UNIFORMS_PER_DRAW,
|
||||
BUILTIN_POINT_SIZE,
|
||||
BUILTIN_SCREEN_SIZE,
|
||||
BUILTIN_MAX_ENUM
|
||||
};
|
||||
|
||||
@@ -133,6 +129,16 @@ public:
|
||||
Texture **textures;
|
||||
};
|
||||
|
||||
// The members in here must respect uniform buffer alignment/padding rules.
|
||||
struct BuiltinUniformData
|
||||
{
|
||||
Matrix4 transformMatrix;
|
||||
Matrix4 projectionMatrix;
|
||||
Vector4 normalMatrix[3]; // 3x3 matrix padded to an array of 3 vector4s.
|
||||
Vector4 screenSizeParams;
|
||||
Colorf constantColor;
|
||||
};
|
||||
|
||||
// Pointer to currently active Shader.
|
||||
static Shader *current;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user