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 renderer double-copies locked textures #12506

Open
slouken opened this issue Mar 10, 2025 · 0 comments
Open

GPU renderer double-copies locked textures #12506

slouken opened this issue Mar 10, 2025 · 0 comments
Assignees
Milestone

Comments

@slouken
Copy link
Collaborator

slouken commented Mar 10, 2025

The GPU 2D renderer keeps an internal pixels buffer that it returns to the application in SDL_LockTexture(), and then allocates a GPU transfer buffer and copies the internal pixels to that, doing two copies for every texture upload.

Instead, it would be nice to allocate the transfer buffer in SDL_LockTexture() and let the application write directly to that and then upload to the GPU on unlock. If we do that we eliminate the double copy, don't need to keep a copy of the pixels around, and SDL_UpdateTexture() can be implemented in terms of LockTexture.

@slouken slouken added this to the 3.x milestone Mar 10, 2025
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

No branches or pull requests

2 participants