Skip to content

Conversation

@MarcelHB
Copy link
Collaborator

@MarcelHB MarcelHB commented Dec 10, 2025

With zooming and something like FullHD settings, we can exert some more pressure to the renderer and see some potential bottlenecks. What you see here is the profiling of one single map tile:

tracy_perf_transparency

On a fast computer, the drawing is faster than a call to HasTransparency that takes around 50% of map drawing time, even falling below my display Hz on debug builds.

We don't need this call to SDL_GetColorKey, we have all we need to know in the format descriptor already, and there is no change to this from outside the sprite class, resulting in some 80 to 100% improvement in some circumstances.

Checklist

  • Commit messages are descriptive and explain the rationale for changes
  • I used the same coding style as the surrounding code
  • I have tested the proposed changes
  • I extended the documentation, if necessary
  • The proposed change builds also on our build bots (check after submission)

We have all the information we need at this point,
and calling this on hot path is quite expensive.
@sonarqubecloud
Copy link

@lynxlynxlynx lynxlynxlynx merged commit 0fd7f78 into gemrb:master Dec 10, 2025
6 of 8 checks passed
@lynxlynxlynx
Copy link
Member

Nice, thanks!

@MarcelHB MarcelHB deleted the drawing_speed branch December 10, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants