diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-13 16:35:16 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:09 +0300 |
commit | df28d2c27e2bef54e5b4fc33d663125ac5ec83f7 (patch) | |
tree | 46aa6405616fe790e71703ba1c4a696162e6a3a9 /source/blender/gpu/intern/gpu_batch.cc | |
parent | b8b56ee1722b7b55c4224b0bb3dbf06201c96946 (diff) |
Cleanup: GPU: Replace Batch uniform by shader uniform using macro
This is a first step into removing uniforms from GPU_batch and Imm.
Diffstat (limited to 'source/blender/gpu/intern/gpu_batch.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_batch.cc | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/source/blender/gpu/intern/gpu_batch.cc b/source/blender/gpu/intern/gpu_batch.cc index 9efb6b464bc..b0a0c142036 100644 --- a/source/blender/gpu/intern/gpu_batch.cc +++ b/source/blender/gpu/intern/gpu_batch.cc @@ -226,87 +226,6 @@ void GPU_batch_set_shader(GPUBatch *batch, GPUShader *shader) GPU_shader_bind(batch->shader); } -#define GET_UNIFORM \ - const GPUShaderInput *uniform = GPU_shaderinterface_uniform(batch->shader->interface, name); \ - BLI_assert(uniform); - -void GPU_batch_uniform_1i(GPUBatch *batch, const char *name, int value) -{ - GET_UNIFORM - GPU_shader_uniform_int(batch->shader, uniform->location, value); -} - -void GPU_batch_uniform_1b(GPUBatch *batch, const char *name, bool value) -{ - GPU_batch_uniform_1i(batch, name, value ? GL_TRUE : GL_FALSE); -} - -void GPU_batch_uniform_2f(GPUBatch *batch, const char *name, float x, float y) -{ - const float data[2] = {x, y}; - GPU_batch_uniform_2fv(batch, name, data); -} - -void GPU_batch_uniform_3f(GPUBatch *batch, const char *name, float x, float y, float z) -{ - const float data[3] = {x, y, z}; - GPU_batch_uniform_3fv(batch, name, data); -} - -void GPU_batch_uniform_4f(GPUBatch *batch, const char *name, float x, float y, float z, float w) -{ - const float data[4] = {x, y, z, w}; - GPU_batch_uniform_4fv(batch, name, data); -} - -void GPU_batch_uniform_1f(GPUBatch *batch, const char *name, float x) -{ - GET_UNIFORM - GPU_shader_uniform_float(batch->shader, uniform->location, x); -} - -void GPU_batch_uniform_2fv(GPUBatch *batch, const char *name, const float data[2]) -{ - GET_UNIFORM - GPU_shader_uniform_vector(batch->shader, uniform->location, 2, 1, data); -} - -void GPU_batch_uniform_3fv(GPUBatch *batch, const char *name, const float data[3]) -{ - GET_UNIFORM - GPU_shader_uniform_vector(batch->shader, uniform->location, 3, 1, data); -} - -void GPU_batch_uniform_4fv(GPUBatch *batch, const char *name, const float data[4]) -{ - GET_UNIFORM - GPU_shader_uniform_vector(batch->shader, uniform->location, 4, 1, data); -} - -void GPU_batch_uniform_2fv_array(GPUBatch *batch, - const char *name, - const int len, - const float *data) -{ - GET_UNIFORM - GPU_shader_uniform_vector(batch->shader, uniform->location, 2, len, data); -} - -void GPU_batch_uniform_4fv_array(GPUBatch *batch, - const char *name, - const int len, - const float *data) -{ - GET_UNIFORM - GPU_shader_uniform_vector(batch->shader, uniform->location, 4, len, data); -} - -void GPU_batch_uniform_mat4(GPUBatch *batch, const char *name, const float data[4][4]) -{ - GET_UNIFORM - GPU_shader_uniform_vector(batch->shader, uniform->location, 16, 1, (const float *)data); -} - /** \} */ /* -------------------------------------------------------------------- */ |