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>2018-08-03 19:53:36 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-08-08 22:26:49 +0300
commit82352565b79d1abb3b6f513bf186c1b3d80e8f0c (patch)
treeaec2daede19ce964e8dc66db76f36dbb4aac5e48 /source/blender/gpu/intern/gpu_material.c
parent05c0992c9b8fd852855b908fcd6333678360c307 (diff)
Eevee: Remove some of the non-necessary uniforms
The remaining ones are from the attributes linear/srgb switches and from nodes that should be pruned before running their _gpu function.
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r--source/blender/gpu/intern/gpu_material.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 9859f56c1db..69c3a3a73ba 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -109,6 +109,9 @@ struct GPUMaterial {
*/
int domain;
+ /* Only used by Eevee to know which bsdf are used. */
+ int flag;
+
/* Used by 2.8 pipeline */
GPUUniformBuffer *ubo; /* UBOs for shader uniforms. */
@@ -564,6 +567,16 @@ bool GPU_material_use_domain_volume(GPUMaterial *mat)
return (mat->domain & GPU_DOMAIN_VOLUME);
}
+void GPU_material_flag_set(GPUMaterial *mat, GPUMatFlag flag)
+{
+ mat->flag |= flag;
+}
+
+bool GPU_material_flag_get(GPUMaterial *mat, GPUMatFlag flag)
+{
+ return (mat->flag & flag);
+}
+
GPUMaterial *GPU_material_from_nodetree_find(
ListBase *gpumaterials, const void *engine_type, int options)
{