[rlsw] Fix axis aligned quad detection (#5314)

* fix `sw_quad_is_axis_aligned`

* align fix

* remove swGetColorBuffer and tweak DRM

* review alignment
This commit is contained in:
Le Juez Victor
2025-10-28 23:50:04 +01:00
committed by GitHub
parent bf5c00f7e0
commit cbff0fa22c
2 changed files with 63 additions and 54 deletions

View File

@ -824,15 +824,6 @@ void SwapScreenBuffer(void)
return;
}
// Get the software rendered color buffer
int bufferWidth = 0, bufferHeight = 0;
void *colorBuffer = swGetColorBuffer(&bufferWidth, &bufferHeight);
if (!colorBuffer)
{
TRACELOG(LOG_ERROR, "DISPLAY: Failed to get software color buffer");
return;
}
// Retrieving the dimensions of the display mode used
drmModeModeInfo *mode = &platform.connector->modes[platform.modeIndex];
uint32_t width = mode->hdisplay;
@ -900,16 +891,8 @@ void SwapScreenBuffer(void)
}
// Copy the software rendered buffer to the dumb buffer with scaling if needed
if (bufferWidth == width && bufferHeight == height)
{
// Direct copy if sizes match
swCopyFramebuffer(0, 0, bufferWidth, bufferHeight, SW_RGBA, SW_UNSIGNED_BYTE, dumbBuffer);
}
else
{
// Scale the software buffer to match the display mode
swBlitFramebuffer(0, 0, width, height, 0, 0, bufferWidth, bufferHeight, SW_RGBA, SW_UNSIGNED_BYTE, dumbBuffer);
}
// NOTE: RLSW will make a simple copy if the dimensions match
swBlitFramebuffer(0, 0, width, height, 0, 0, width, height, SW_RGBA, SW_UNSIGNED_BYTE, dumbBuffer);
// Unmap the buffer
munmap(dumbBuffer, creq.size);