implement viewports

This commit is contained in:
Samuliak 2024-07-08 17:04:50 +02:00
parent db08f73530
commit d80ddafb24
3 changed files with 31 additions and 2 deletions

View file

@ -41,7 +41,7 @@ struct RenderTarget {
const u32 startOffset = (inputAddress - location) / sizePerPixel(format);
const u32 x0 = (startOffset % (size.x() * 8)) / 8;
const u32 y0 = (startOffset / (size.x() * 8)) * 8;
return Math::Rect<u32>{x0, y0, x0 + width, y0 + height};
return Math::Rect<u32>{x0, size.y() - y0, x0 + width, size.y() - height - y0};
}
// For 2 textures to "match" we only care about their locations, formats, and dimensions to match