Remove explicit support for systems that don't support rgba8 canvases.

This is just a very small number of really old OpenGL ES 2 drivers.
This commit is contained in:
Sasha Szpakowski
2023-10-13 21:53:45 -03:00
parent 3865868358
commit 983ea6c0e6
9 changed files with 23 additions and 75 deletions
+2 -21
View File
@@ -1864,28 +1864,9 @@ void Graphics::setWireframe(bool enable)
}
}
PixelFormat Graphics::getSizedFormat(PixelFormat format, bool /*rendertarget*/, bool /*readable*/) const
{
switch (format)
{
case PIXELFORMAT_NORMAL:
if (isGammaCorrect())
return PIXELFORMAT_RGBA8_UNORM_sRGB;
else
return PIXELFORMAT_RGBA8_UNORM;
case PIXELFORMAT_HDR:
return PIXELFORMAT_RGBA16_FLOAT;
default:
return format;
}
}
bool Graphics::isPixelFormatSupported(PixelFormat format, uint32 usage, bool sRGB)
{
bool rendertarget = (usage & PIXELFORMATUSAGEFLAGS_RENDERTARGET) != 0;
bool readable = (usage & PIXELFORMATUSAGEFLAGS_SAMPLE) != 0;
format = getSizedFormat(format, rendertarget, readable);
format = getSizedFormat(format);
if (sRGB)
format = getSRGBPixelFormat(format);
@@ -1902,7 +1883,7 @@ bool Graphics::isPixelFormatSupported(PixelFormat format, uint32 usage, bool sRG
uint32 flags = PIXELFORMATUSAGEFLAGS_NONE;
if (isPixelFormatCompressed(format) && rendertarget)
if (isPixelFormatCompressed(format) && (usage & rt) != 0)
return false;
// https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf