Skip to content

Incorrect Software Rendering for Texture Address Mode CLAMPED #13396

@DctrNoob

Description

@DctrNoob

While working on #13390 I created a new test case to test the texture address mode CLAMPED. However, the new test case fails because the software renderer does not handle the texture address mode CLAMPED correctly. It looks like SDL_SW_RenderGeometryRaw was not written with the case of UVs outside of [0, 1]^2 in mind.

For example, in the new test case I used UVs from (-0.5, -0.5) to (1.5, 1.5) which, assuming texture address mode CLAMPED, should yield this picture:
Image

However, the software renderer produces this picture instead:
Image

My understanding so far: internally, SDL_SW_RenderGeometryRaw tries to optimize drawing by identifying quads and triggering SDL_RenderTexture for them. However, this approach fails for UVs outside of [0, 1]^2.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions