diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-06-02 13:11:39 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-06-02 13:11:39 +0300 |
commit | cecda64e2ead502a052f9bea5ffde39e4a46bf90 (patch) | |
tree | 0473548813e5823312a7a4381b75b7d1324e8ba2 /source/blender/editors/interface | |
parent | bdda53fdb29d9f015df2db66a0cda98b0c19e1ff (diff) |
GPU: ShaderInterface: Refactor to setup all uniform at creation time
This remove the complexity of queriying the locations at runtime and
allows for more performance and upfront binding specifications.
The benefit of doing everything at creation time is that we can assign binding
points in a predictable order which is going to be somewhat the same for
every similar shader.
This also rewrite GPU_vertformat_from_shader to not use shaderface.
This is to keep the shaderface simple. If it becomes necessary to not query
the shader after creation (i.e: vulkan?) we could just create the vert
format in advance at compilation for PyGPU shaders.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D7879
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index c94a95890c0..0f22c83d945 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1604,7 +1604,7 @@ static void icon_draw_cache_texture_flush_ex(GLuint texture, GPU_shader_bind(shader); int img_loc = GPU_shader_get_uniform_ensure(shader, "image"); - int data_loc = GPU_shader_get_uniform_ensure(shader, "calls_data[0]"); + int data_loc = GPU_shader_get_uniform_ensure(shader, "calls_data"); glUniform1i(img_loc, 0); glUniform4fv(data_loc, ICON_DRAW_CACHE_SIZE * 3, (float *)texture_draw_calls->drawcall_cache); |