1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Validate triviality of the InstanceData and RenderElementInfo structs in Mobile and Forward+ renderers.

This is needed to avoid overhead that results from calling the constructor during calls to LocalVector.resize()
This commit is contained in:
clayjohn
2025-03-03 14:28:41 -08:00
parent 9f68a81659
commit 1bdb3bc88a
2 changed files with 13 additions and 1 deletions

View File

@@ -328,6 +328,9 @@ private:
float uv_scale[4];
};
static_assert(std::is_trivially_destructible_v<InstanceData>);
static_assert(std::is_trivially_constructible_v<InstanceData>);
UBO ubo;
LocalVector<RID> uniform_buffers;
@@ -392,6 +395,9 @@ private:
uint32_t lod_index : 8;
};
static_assert(std::is_trivially_destructible_v<RenderElementInfo>);
static_assert(std::is_trivially_constructible_v<RenderElementInfo>);
template <PassMode p_pass_mode, uint32_t p_color_pass_flags = 0>
_FORCE_INLINE_ void _render_list_template(RenderingDevice::DrawListID p_draw_list, RenderingDevice::FramebufferFormatID p_framebuffer_Format, RenderListParameters *p_params, uint32_t p_from_element, uint32_t p_to_element);
void _render_list(RenderingDevice::DrawListID p_draw_list, RenderingDevice::FramebufferFormatID p_framebuffer_Format, RenderListParameters *p_params, uint32_t p_from_element, uint32_t p_to_element);