[Bf-blender-cvs] [5837de6879f] master: Cleanup: DRW: Add comment and remove bitfields.

Clément Foucault noreply at git.blender.org
Thu Jun 4 14:17:08 CEST 2020


Commit: 5837de6879f424a0a26ad787b89f1ec98c91c3c6
Author: Clément Foucault
Date:   Thu Jun 4 13:55:25 2020 +0200
Branches: master
https://developer.blender.org/rB5837de6879f424a0a26ad787b89f1ec98c91c3c6

Cleanup: DRW: Add comment and remove bitfields.

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

M	source/blender/draw/intern/draw_manager.h

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

diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h
index 733711a06da..6cae2a4f9f6 100644
--- a/source/blender/draw/intern/draw_manager.h
+++ b/source/blender/draw/intern/draw_manager.h
@@ -316,10 +316,10 @@ struct DRWUniform {
     /* DRW_UNIFORM_INT_COPY */
     int ivalue[4];
   };
-  int location;           /* Use as binding point for textures and ubos. */
-  uint32_t type : 5;      /* DRWUniformType */
-  uint32_t length : 5;    /* cannot be more than 16 */
-  uint32_t arraysize : 5; /* cannot be more than 16 too */
+  int location;      /* Uniform location or binding point for textures and ubos. */
+  uint8_t type;      /* DRWUniformType */
+  uint8_t length;    /* Length of vector types. */
+  uint8_t arraysize; /* Array size of scalar/vector types. */
 };
 
 struct DRWShadingGroup {
@@ -334,10 +334,13 @@ struct DRWShadingGroup {
   } cmd;
 
   union {
+    /* This struct is used during cache populate. */
     struct {
       int objectinfo;                /* Equal to 1 if the shader needs obinfos. */
       DRWResourceHandle pass_handle; /* Memblock key to parent pass. */
     };
+    /* This struct is used after cache populate if using the Z sorting.
+     * It will not conflict with the above struct. */
     struct {
       float distance;      /* Distance from camera. */
       uint original_index; /* Original position inside the shgroup list. */



More information about the Bf-blender-cvs mailing list