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:
authorDalai Felinto <dfelinto@gmail.com>2017-07-14 18:40:54 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-07-14 18:46:10 +0300
commit2a489273d7e2354a9f1afc3212863ff4b463cf86 (patch)
treea12701d9ca43b6ace0993cfc31bc278eed3cc4fb /source/blender/gpu/GPU_uniformbuffer.h
parent73b142529705e75790a4b9279109763014ca63e6 (diff)
Implement Uniformbuffer objects for nodetree parameters
For users that means you can tweak shaders in the nodetree and things are way faster. This is a huge improvement, particularly in systems that have no shader cache. From the code perspective it means we are no longer re-compiling the shader every time a value is tweaked in the UI. We are using uniforms for those values. It would be slow to add that many uniforms for all the shaders. So instead we are using UBO (Uniform Buffer Objects). This fixes the main issue of T51467. However GWN_shaderinterface_create() still needs to be improvedi. When opening a .blend all shaders are compiled once, so optimizing it will bring a measurable impact. ======================================================================== NOTE: This breaks update of Cycles material upon nodetree nodes tweaking. It will be fixed separately by depsgraph, once tackling T51925 (Animated Eevee values slowdown). The idea is to make Depsgraph update more granular. The XXX TODO in rna_nodetree.c will be tackled at that time as well. ======================================================================== Reviewers: sergey, brecht, fclem Differential Revision: https://developer.blender.org/D2739
Diffstat (limited to 'source/blender/gpu/GPU_uniformbuffer.h')
-rw-r--r--source/blender/gpu/GPU_uniformbuffer.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_uniformbuffer.h b/source/blender/gpu/GPU_uniformbuffer.h
index 36b659e30b1..e342078d8fd 100644
--- a/source/blender/gpu/GPU_uniformbuffer.h
+++ b/source/blender/gpu/GPU_uniformbuffer.h
@@ -32,12 +32,19 @@
#ifndef __GPU_UNIFORMBUFFER_H__
#define __GPU_UNIFORMBUFFER_H__
+typedef enum GPUType GPUType;
+struct ListBase;
+
typedef struct GPUUniformBuffer GPUUniformBuffer;
+typedef struct GPUUniformBufferDynamicItem GPUUniformBufferDynamicItem;
GPUUniformBuffer *GPU_uniformbuffer_create(int size, const void *data, char err_out[256]);
+GPUUniformBuffer *GPU_uniformbuffer_dynamic_create(struct ListBase *inputs, char err_out[256]);
+
void GPU_uniformbuffer_free(GPUUniformBuffer *ubo);
void GPU_uniformbuffer_update(GPUUniformBuffer *ubo, const void *data);
+void GPU_uniformbuffer_dynamic_update(GPUUniformBuffer *ubo_);
void GPU_uniformbuffer_bind(GPUUniformBuffer *ubo, int number);
#if 0
@@ -46,4 +53,10 @@ void GPU_uniformbuffer_unbind(GPUUniformBuffer *ubo);
int GPU_uniformbuffer_bindpoint(GPUUniformBuffer *ubo);
+bool GPU_uniformbuffer_is_empty(GPUUniformBuffer *ubo);
+bool GPU_uniformbuffer_is_dirty(GPUUniformBuffer *ubo);
+void GPU_uniformbuffer_tag_dirty(GPUUniformBuffer *ubo);
+
+#define GPU_UBO_BLOCK_NAME "nodeTree"
+
#endif /* __GPU_UNIFORMBUFFER_H__ */