Gawain: use ShaderInterface to manage uniforms

This eliminates tons of glGetUniformLocation calls from the drawing loop. Vast majority of code can keep making the same function calls. They're just faster now!

- Batch_Uniform*
- immUniform*
- gpuBindMatrices
- and others
This commit is contained in:
2017-04-12 18:55:32 -04:00
parent 6bfb9b7b5f
commit b02786ae6b
12 changed files with 130 additions and 206 deletions

View File

@@ -34,6 +34,7 @@
#include "BLI_sys_types.h"
#include "GPU_glew.h"
#include "../../../intern/gawain/gawain/shader_interface.h"
#ifdef __cplusplus
extern "C" {
@@ -132,7 +133,7 @@ const float *gpuGetNormalMatrixInverse(float m[3][3]);
/* set uniform values for currently bound shader */
void gpuBindMatrices(GLuint program);
void gpuBindMatrices(const ShaderInterface*);
bool gpuMatricesDirty(void); /* since last bind */
#ifdef __cplusplus