Initial support for integer format textures.

They can't be rendered to and ImageData can't use the formats, for now.
This commit is contained in:
Alex Szpakowski
2021-08-12 16:38:54 -03:00
parent 4caeb27047
commit 48b3a4e860
11 changed files with 502 additions and 252 deletions
+6
View File
@@ -693,6 +693,9 @@ void Graphics::setRenderTargets(const RenderTargets &rts)
if (!firsttex->isValidSlice(firsttarget.slice))
throw love::Exception("Invalid slice index: %d.", firsttarget.slice + 1);
if (isPixelFormatInteger(firstcolorformat))
throw love::Exception("Textures with integer pixel formats cannot be rendered to, currently.");
bool hasSRGBtexture = firstcolorformat == PIXELFORMAT_sRGBA8_UNORM;
int pixelw = firsttex->getPixelWidth(firsttarget.mipmap);
int pixelh = firsttex->getPixelHeight(firsttarget.mipmap);
@@ -726,6 +729,9 @@ void Graphics::setRenderTargets(const RenderTargets &rts)
if (isPixelFormatDepthStencil(format))
throw love::Exception("Depth/stencil format textures must be used with the 'depthstencil' field of the table passed into setRenderTargets.");
if (isPixelFormatInteger(format))
throw love::Exception("Textures with integer pixel formats cannot be rendered to, currently.");
if (format == PIXELFORMAT_sRGBA8_UNORM)
hasSRGBtexture = true;
}