Skip to content

Commit 0e06eb8

Browse files
committed
Fix union order to simplify empty initializers.
1 parent 0e3a5ed commit 0e06eb8

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class SceneShaderForwardClustered {
100100

101101
struct ShaderSpecialization {
102102
union {
103+
uint32_t packed_0;
104+
103105
struct {
104106
uint32_t use_forward_gi : 1;
105107
uint32_t use_light_projector : 1;
@@ -114,31 +116,29 @@ class SceneShaderForwardClustered {
114116
uint32_t directional_soft_shadow_samples : 6;
115117
uint32_t directional_penumbra_shadow_samples : 6;
116118
};
117-
118-
uint32_t packed_0;
119119
};
120120

121121
union {
122+
uint32_t packed_1;
123+
122124
struct {
123125
uint32_t multimesh : 1;
124126
uint32_t multimesh_format_2d : 1;
125127
uint32_t multimesh_has_color : 1;
126128
uint32_t multimesh_has_custom_data : 1;
127129
};
128-
129-
uint32_t packed_1;
130130
};
131131

132132
uint32_t packed_2;
133133
};
134134

135135
struct UbershaderConstants {
136136
union {
137+
uint32_t packed_0;
138+
137139
struct {
138140
uint32_t cull_mode : 2;
139141
};
140-
141-
uint32_t packed_0;
142142
};
143143
};
144144

servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class SceneShaderForwardMobile {
5959

6060
struct ShaderSpecialization {
6161
union {
62+
uint32_t packed_0;
63+
6264
struct {
6365
uint32_t use_light_projector : 1;
6466
uint32_t use_light_soft_shadows : 1;
@@ -82,11 +84,11 @@ class SceneShaderForwardMobile {
8284
uint32_t soft_shadow_samples : 6;
8385
uint32_t penumbra_shadow_samples : 6;
8486
};
85-
86-
uint32_t packed_0;
8787
};
8888

8989
union {
90+
uint32_t packed_1;
91+
9092
struct {
9193
uint32_t directional_soft_shadow_samples : 6;
9294
uint32_t directional_penumbra_shadow_samples : 6;
@@ -96,32 +98,30 @@ class SceneShaderForwardMobile {
9698
uint32_t directional_lights : 4;
9799
uint32_t decals : 4;
98100
};
99-
100-
uint32_t packed_1;
101101
};
102102

103103
union {
104+
uint32_t packed_2;
105+
104106
struct {
105107
uint32_t directional_light_blend_splits : 8;
106108
uint32_t padding_1 : 24;
107109
};
108-
109-
uint32_t packed_2;
110110
};
111111

112112
union {
113-
float luminance_multiplier;
114113
float packed_3;
114+
float luminance_multiplier;
115115
};
116116
};
117117

118118
struct UbershaderConstants {
119119
union {
120+
uint32_t packed_0;
121+
120122
struct {
121123
uint32_t cull_mode : 2;
122124
};
123-
124-
uint32_t packed_0;
125125
};
126126

127127
uint32_t padding_1;

servers/rendering/renderer_rd/renderer_canvas_render_rd.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ class RendererCanvasRenderRD : public RendererCanvasRender {
116116

117117
struct ShaderSpecialization {
118118
union {
119+
uint32_t packed_0;
120+
119121
struct {
120122
uint32_t use_lighting : 1;
121123
};
122-
123-
uint32_t packed_0;
124124
};
125125
};
126126

0 commit comments

Comments
 (0)