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

@@ -86,7 +86,7 @@ success:
static int bpygpu_uniform_location_get(GPUShader *shader, const char *name, const char *error_prefix)
{
int uniform = GPU_shader_get_uniform(shader, name);
int uniform = GPU_shader_get_uniform_ensure(shader, name);
if (uniform == -1) {
PyErr_Format(PyExc_ValueError, "%s: uniform %.32s %.32s not found", error_prefix, name);