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 -8
View File
@@ -66,9 +66,8 @@ public:
ptrdiff_t getHandle() const override;
void setVideoTextures(Texture *ytexture, Texture *cbtexture, Texture *crtexture) override;
void updateScreenParams();
void updatePointSize(float size);
void updateBuiltinUniforms();
void updateBuiltinUniforms(love::graphics::Graphics *gfx, int viewportW, int viewportH);
static std::string getGLSLVersion();
static bool isSupported();
@@ -119,14 +118,8 @@ private:
std::vector<std::pair<const UniformInfo *, int>> pendingUniformUpdates;
bool canvasWasActive;
Rect lastViewport;
float lastPointSize;
Matrix4 lastTransformMatrix;
Matrix4 lastProjectionMatrix;
}; // Shader
} // opengl