Skip to content

PSP: SDL_RenderClear does not clear entire target texture #16029

Description

@Sawkez

When rendering to a texture on PSP, SDL_RenderClear only clears the top-left 480x272 region of the texture.

Steps to reproduce

  1. Create a texture with SDL_TEXTUREACCESS_TARGET that is larger than 480x272;
  2. Set the texture as the current render target;
  3. Draw something to the texture;
  4. Clear the texture using SDL_RenderClear;
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions