Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-06-02 13:11:39 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-06-02 13:11:39 +0300
commitcecda64e2ead502a052f9bea5ffde39e4a46bf90 (patch)
tree0473548813e5823312a7a4381b75b7d1324e8ba2 /source/blender/gpu/GPU_vertex_format.h
parentbdda53fdb29d9f015df2db66a0cda98b0c19e1ff (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/gpu/GPU_vertex_format.h')
-rw-r--r--source/blender/gpu/GPU_vertex_format.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/gpu/GPU_vertex_format.h b/source/blender/gpu/GPU_vertex_format.h
index 7adad2ff831..61b14a4c5c0 100644
--- a/source/blender/gpu/GPU_vertex_format.h
+++ b/source/blender/gpu/GPU_vertex_format.h
@@ -101,12 +101,11 @@ typedef struct GPUVertFormat {
char names[GPU_VERT_ATTR_NAMES_BUF_LEN];
} GPUVertFormat;
-struct GPUShaderInterface;
+struct GPUShader;
void GPU_vertformat_clear(GPUVertFormat *);
void GPU_vertformat_copy(GPUVertFormat *dest, const GPUVertFormat *src);
-void GPU_vertformat_from_interface(GPUVertFormat *format,
- const struct GPUShaderInterface *shaderface);
+void GPU_vertformat_from_shader(GPUVertFormat *format, const struct GPUShader *shader);
uint GPU_vertformat_attr_add(
GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode);