When rendering to a texture on PSP, SDL_RenderClear only clears the top-left 480x272 region of the texture.
Steps to reproduce
- Create a texture with
SDL_TEXTUREACCESS_TARGET that is larger than 480x272;
- Set the texture as the current render target;
- Draw something to the texture;
- Clear the texture using
SDL_RenderClear;
- Build for PSP; Run on real hardware or on an emulator.
Expected result
Entire texture is cleared.
Actual result
Only the top-left 480x272 region of the texture is cleared. The results of the earlier draws are visible through the uncleared region.
Why this happens
SDL_RenderClear on PSP uses sceGuClear. This function clears a region as determined by gu_draw_buffer.width and gu_draw_buffer.height.
These values are set by the function sceGuDispBuffer, which only gets called by SDL in PSP_CreateRenderer, and passed PSP_SCREEN_WIDTH and PSP_SCREEN_HEIGHT, which are 480 and 272 respectively.
main.c
CMakeLists.txt
When rendering to a texture on PSP,
SDL_RenderClearonly clears the top-left 480x272 region of the texture.Steps to reproduce
SDL_TEXTUREACCESS_TARGETthat is larger than 480x272;SDL_RenderClear;Expected result
Entire texture is cleared.
Actual result
Only the top-left 480x272 region of the texture is cleared. The results of the earlier draws are visible through the uncleared region.
Why this happens
SDL_RenderClearon PSP usessceGuClear. This function clears a region as determined bygu_draw_buffer.widthandgu_draw_buffer.height.These values are set by the function
sceGuDispBuffer, which only gets called by SDL inPSP_CreateRenderer, and passedPSP_SCREEN_WIDTHandPSP_SCREEN_HEIGHT, which are 480 and 272 respectively.main.c
CMakeLists.txt