Commit: 95547bd75042c9228b7a84b25d691ba6308cb18b
Author: Luca Rood
Date:   Tue May 16 16:43:24 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB95547bd75042c9228b7a84b25d691ba6308cb18b

Minor cleanup in clay_engine.c

===================================================================

M       source/blender/draw/engines/clay/clay_engine.c

===================================================================

diff --git a/source/blender/draw/engines/clay/clay_engine.c 
b/source/blender/draw/engines/clay/clay_engine.c
index c4cca1f537b..8abf85a14cc 100644
--- a/source/blender/draw/engines/clay/clay_engine.c
+++ b/source/blender/draw/engines/clay/clay_engine.c
@@ -62,7 +62,7 @@ typedef struct CLAY_UBO_Material {
        float matcap_rot[2];
        float pad[2]; /* ensure 16 bytes alignement */
 } CLAY_UBO_Material; /* 48 bytes */
-BLI_STATIC_ASSERT_ALIGN(CLAY_UBO_Material, 16);
+BLI_STATIC_ASSERT_ALIGN(CLAY_UBO_Material, 16)
 
 typedef struct CLAY_HAIR_UBO_Material {
        float hair_randomness;
@@ -70,7 +70,8 @@ typedef struct CLAY_HAIR_UBO_Material {
        float matcap_rot[2];
        float matcap_hsv[3];
        float pad;
-} CLAY_HAIR_UBO_Material; /* 48 bytes */
+} CLAY_HAIR_UBO_Material; /* 32 bytes */
+BLI_STATIC_ASSERT_ALIGN(CLAY_UBO_Material, 16)
 
 #define MAX_CLAY_MAT 512 /* 512 = 9 bit material id */
 
@@ -154,7 +155,6 @@ static struct {
 
        /* Just a serie of int from 0 to MAX_CLAY_MAT-1 */
        int ubo_mat_idxs[MAX_CLAY_MAT];
-       int hair_ubo_mat_idxs[MAX_CLAY_MAT];
 } e_data = {NULL}; /* Engine data */
 
 typedef struct CLAY_PrivateData {
@@ -372,13 +372,6 @@ static void CLAY_engine_init(void *vedata)
                }
        }
 
-       if (e_data.hair_ubo_mat_idxs[1] == 0) {
-               /* Just int to have pointers to them */
-               for (int i = 0; i < MAX_CLAY_MAT; ++i) {
-                       e_data.hair_ubo_mat_idxs[i] = i;
-               }
-       }
-
        if (DRW_state_is_fbo()) {
                const float *viewport_size = DRW_viewport_size_get();
                DRWFboTexture tex = {&txl->depth_dup, DRW_BUF_DEPTH_24, 0};
@@ -668,7 +661,7 @@ static DRWShadingGroup *CLAY_hair_shgrp_get(Object *ob, 
CLAY_StorageList *stl, C
                                      matcap_val, hair_randomness, matcap_icon);
 
        if (hair_shgrps[hair_id] == NULL) {
-               hair_shgrps[hair_id] = CLAY_hair_shgroup_create(psl->hair_pass, 
&e_data.hair_ubo_mat_idxs[hair_id]);
+               hair_shgrps[hair_id] = CLAY_hair_shgroup_create(psl->hair_pass, 
&e_data.ubo_mat_idxs[hair_id]);
                /* if it's the first shgrp, pass bind the material UBO */
                if (stl->storage->hair_ubo_current_id == 1) {
                        DRW_shgroup_uniform_block(hair_shgrps[0], 
"material_block", stl->hair_mat_ubo);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to