Skip to content

system/ui: optimizes the draw_polygon() and improving code maintainability#35366

Merged
adeebshihadeh merged 1 commit intocommaai:masterfrom
deanlee:pyui_improve_draw_polygon
May 28, 2025
Merged

system/ui: optimizes the draw_polygon() and improving code maintainability#35366
adeebshihadeh merged 1 commit intocommaai:masterfrom
deanlee:pyui_improve_draw_polygon

Conversation

@deanlee
Copy link
Copy Markdown
Contributor

@deanlee deanlee commented May 28, 2025

Changes:

  • Pre-allocated FFI arrays in ShaderState.__init__, removing rl.ffi.new() from the draw_polygon to eliminate redundant allocations during polygon rendering.
  • Extracted color configuration into a _configure_shader_color helper function, enhancing draw_polygon readability
  • replace verbose rl.ShaderUniformDataType with constants

These optimizations eliminate per-draw memory allocations, minimizing garbage collection overhead and enhancing frame rate consistency for high-frequency polygon rendering.

@github-actions github-actions Bot added the ui label May 28, 2025
@deanlee deanlee force-pushed the pyui_improve_draw_polygon branch from ce0ad50 to 185a47c Compare May 28, 2025 10:54
@deanlee deanlee force-pushed the pyui_improve_draw_polygon branch from 185a47c to 7974b37 Compare May 28, 2025 11:12
@adeebshihadeh adeebshihadeh merged commit 3682fac into commaai:master May 28, 2025
16 checks passed
@deanlee deanlee deleted the pyui_improve_draw_polygon branch May 28, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants