Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix union order to simplify empty initializers. #101344

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class SceneShaderForwardClustered {

struct ShaderSpecialization {
union {
uint32_t packed_0;

struct {
uint32_t use_forward_gi : 1;
uint32_t use_light_projector : 1;
Expand All @@ -114,31 +116,29 @@ class SceneShaderForwardClustered {
uint32_t directional_soft_shadow_samples : 6;
uint32_t directional_penumbra_shadow_samples : 6;
};

uint32_t packed_0;
};

union {
uint32_t packed_1;

struct {
uint32_t multimesh : 1;
uint32_t multimesh_format_2d : 1;
uint32_t multimesh_has_color : 1;
uint32_t multimesh_has_custom_data : 1;
};

uint32_t packed_1;
};

uint32_t packed_2;
};

struct UbershaderConstants {
union {
uint32_t packed_0;

struct {
uint32_t cull_mode : 2;
};

uint32_t packed_0;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class SceneShaderForwardMobile {

struct ShaderSpecialization {
union {
uint32_t packed_0;

struct {
uint32_t use_light_projector : 1;
uint32_t use_light_soft_shadows : 1;
Expand All @@ -82,11 +84,11 @@ class SceneShaderForwardMobile {
uint32_t soft_shadow_samples : 6;
uint32_t penumbra_shadow_samples : 6;
};

uint32_t packed_0;
};

union {
uint32_t packed_1;

struct {
uint32_t directional_soft_shadow_samples : 6;
uint32_t directional_penumbra_shadow_samples : 6;
Expand All @@ -96,32 +98,30 @@ class SceneShaderForwardMobile {
uint32_t directional_lights : 4;
uint32_t decals : 4;
};

uint32_t packed_1;
};

union {
uint32_t packed_2;

struct {
uint32_t directional_light_blend_splits : 8;
uint32_t padding_1 : 24;
};

uint32_t packed_2;
};

union {
float luminance_multiplier;
float packed_3;
float luminance_multiplier;
};
};

struct UbershaderConstants {
union {
uint32_t packed_0;

struct {
uint32_t cull_mode : 2;
};

uint32_t packed_0;
};

uint32_t padding_1;
Expand Down
4 changes: 2 additions & 2 deletions servers/rendering/renderer_rd/renderer_canvas_render_rd.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ class RendererCanvasRenderRD : public RendererCanvasRender {

struct ShaderSpecialization {
union {
uint32_t packed_0;

struct {
uint32_t use_lighting : 1;
};

uint32_t packed_0;
};
};

Expand Down