GPU: Rename GPU_shader_get_uniform to GPU_shader_get_uniform_ensure

This is in order to make the API more multithread friendly inside the
draw manager.

GPU_shader_get_uniform will only serve to query the shader interface and
not do any GL call, making it threadsafe.

For now it only print a warning if the uniform was not queried before.
This commit is contained in:
2019-01-16 04:41:27 +01:00
parent 938b08b336
commit 4c95899098
16 changed files with 53 additions and 29 deletions

View File

@@ -428,9 +428,9 @@ void GPU_batch_program_use_end(GPUBatch *batch)
}
#if TRUST_NO_ONE
# define GET_UNIFORM const GPUShaderInput *uniform = GPU_shaderinterface_uniform(batch->interface, name); assert(uniform);
# define GET_UNIFORM const GPUShaderInput *uniform = GPU_shaderinterface_uniform_ensure(batch->interface, name); assert(uniform);
#else
# define GET_UNIFORM const GPUShaderInput *uniform = GPU_shaderinterface_uniform(batch->interface, name);
# define GET_UNIFORM const GPUShaderInput *uniform = GPU_shaderinterface_uniform_ensure(batch->interface, name);
#endif
void GPU_batch_uniform_1ui(GPUBatch *batch, const char *name, int value)