Skip to content

Conversation

@wouterlucas
Copy link
Contributor

@wouterlucas wouterlucas commented Dec 11, 2024

Batch the amount of textures being downloaded (source) and uploaded (core ctx creation) to the GPU to reduce load on constrained devices.

The default is set to 0 where everything will be processed in a single frame, this can be reduced to any value (e.g. 50 or 25) to limit the amount of textures being processed per frame.

Todo:

  • Fix loaded events w/ dimensions
  • Run through all the tests (+fixes)
  • Check Canvas2D regression
  • Align RGB / RGBA handling with hasAlpha on Texture Creates to save some bits

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's worthwhile to make a TextureState enum so we won't have to compare strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably? That might go nicely into your shader changes. It just got updated here because // eslint-disable-next-line @typescript-eslint/no-explicit-any is no longer needed and it auto dropped the comment from my IDE 😄

@wouterlucas wouterlucas marked this pull request as ready for review December 18, 2024 15:33
@wouterlucas wouterlucas requested a review from jfboeve December 18, 2024 20:58
@wouterlucas wouterlucas added this pull request to the merge queue Dec 19, 2024
Merged via the queue into main with commit c58eda3 Dec 19, 2024
2 checks passed
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.

4 participants