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:
authorJeroen Bakker <j.bakker@atmind.nl>2018-06-29 09:25:23 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-06-29 09:27:14 +0300
commitd34b0faa65f9585d7013a120523e9b87a22c60bd (patch)
tree7601764452e34642e43f72f50b171a6039195126 /source/blender/draw/engines/workbench/workbench_private.h
parent9bd0c63382bf226c271c40d5a5967c22c75718ea (diff)
Workbench: Removed MaterialData UBO
Most of the times the materials differ due to the object_id. This was an overhead and resulted in instabilities on Intel graphical cards. This commit will revert the Material Data UBO and replace it with normal uniform.
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_private.h')
-rw-r--r--source/blender/draw/engines/workbench/workbench_private.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_private.h b/source/blender/draw/engines/workbench/workbench_private.h
index 5eb7631104d..a1d829280ef 100644
--- a/source/blender/draw/engines/workbench/workbench_private.h
+++ b/source/blender/draw/engines/workbench/workbench_private.h
@@ -138,13 +138,6 @@ typedef struct WORKBENCH_UBO_World {
} WORKBENCH_UBO_World;
BLI_STATIC_ASSERT_ALIGN(WORKBENCH_UBO_World, 16)
-typedef struct WORKBENCH_UBO_Material {
- float diffuse_color[4];
- float specular_color[4];
- float roughness;
- float pad[3];
-} WORKBENCH_UBO_Material;
-BLI_STATIC_ASSERT_ALIGN(WORKBENCH_UBO_Material, 16)
typedef struct WORKBENCH_PrivateData {
struct GHash *material_hash;
@@ -196,10 +189,9 @@ typedef struct WORKBENCH_EffectInfo {
} WORKBENCH_EffectInfo;
typedef struct WORKBENCH_MaterialData {
- /* Solid color */
- WORKBENCH_UBO_Material material_data;
- struct GPUUniformBuffer *material_ubo;
-
+ float diffuse_color[4];
+ float specular_color[4];
+ float roughness;
int object_id;
int color_type;
Image *ima;
@@ -279,6 +271,8 @@ uint workbench_material_get_hash(WORKBENCH_MaterialData *material_template);
int workbench_material_get_shader_index(WORKBENCH_PrivateData *wpd, bool use_textures, bool is_hair);
void workbench_material_set_normal_world_matrix(
DRWShadingGroup *grp, WORKBENCH_PrivateData *wpd, float persistent_matrix[3][3]);
+void workbench_material_shgroup_uniform(DRWShadingGroup *grp, WORKBENCH_MaterialData *material);
+void workbench_material_copy(WORKBENCH_MaterialData *dest_material, const WORKBENCH_MaterialData *source_material);
/* workbench_studiolight.c */
void studiolight_update_world(StudioLight *sl, WORKBENCH_UBO_World *wd);