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

GPU: Add SDL_CalculateGPUTextureFormatSize #11146

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

thatcosmonaut
Copy link
Collaborator

This is a fairly common client need and it's annoyingly nuanced to implement, so we should expose it.

Copy link
Collaborator

@flibitijibibo flibitijibibo left a comment

Choose a reason for hiding this comment

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

If not as an export, maybe as part of documentation for the blocksize functions?

include/SDL3/SDL_gpu.h Outdated Show resolved Hide resolved
include/SDL3/SDL_gpu.h Outdated Show resolved Hide resolved
include/SDL3/SDL_gpu.h Outdated Show resolved Hide resolved
@slouken
Copy link
Collaborator

slouken commented Oct 10, 2024

I'm fine with this. It looks like BytesPerImage needs to be replaced with a call to this function?
Does it work with all texture formats, or just the block based ones?

src/gpu/SDL_gpu.c Outdated Show resolved Hide resolved
@thatcosmonaut thatcosmonaut force-pushed the texture_size branch 2 times, most recently from 51a381a to d950363 Compare October 10, 2024 15:44
include/SDL3/SDL_gpu.h Outdated Show resolved Hide resolved
Update include/SDL3/SDL_gpu.h

Co-authored-by: Sam Lantinga <[email protected]>
@thatcosmonaut
Copy link
Collaborator Author

Addressed all the comments, let me know if there's anything else.

@thatcosmonaut thatcosmonaut merged commit 6ea4a66 into libsdl-org:main Oct 10, 2024
38 checks passed
@thatcosmonaut thatcosmonaut deleted the texture_size branch October 10, 2024 23:34
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.

5 participants