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:
Alex Szpakowski
2019-11-18 21:13:54 -04:00
parent 37c579929b
commit 3435a6bcbf
10 changed files with 98 additions and 172 deletions
+1 -11
View File
@@ -220,7 +220,7 @@ public:
* Set up necessary state (LOVE-provided shader uniforms, etc.) for drawing.
* This *MUST* be called directly before OpenGL drawing functions.
**/
void prepareDraw();
void prepareDraw(love::graphics::Graphics *gfx);
/**
* State-tracked glBindBuffer.
@@ -262,13 +262,6 @@ public:
**/
void setScissor(const Rect &v, bool canvasActive);
/**
* Sets the constant color (vertex attribute). This may be applied
* internally at draw-time. This gets gamma-corrected internally as well.
**/
void setConstantColor(const Colorf &color);
const Colorf &getConstantColor() const;
/**
* Sets the global point size.
**/
@@ -473,9 +466,6 @@ private:
uint32 enabledAttribArrays;
uint32 instancedAttribArrays;
Colorf constantColor;
Colorf lastConstantColor;
Rect viewport;
Rect scissor;