Commit e1fc4c1a authored by Laszlo Agocs's avatar Laszlo Agocs

gl: return real values from texture format supported query

the non-rgba8 formats are a todo for now
parent fff98e9c
......@@ -505,6 +505,23 @@ bool QRhiGles2::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture
if (isCompressedFormat(format))
return supportedCompressedFormats.contains(toGlCompressedTextureFormat(format, flags));
switch (format) {
case QRhiTexture::D16:
Q_FALLTHROUGH();
case QRhiTexture::D32:
return false;
case QRhiTexture::BGRA8:
Q_FALLTHROUGH();
case QRhiTexture::R8:
Q_FALLTHROUGH();
case QRhiTexture::R16:
return false; // ###
default:
break;
}
return true;
}
......@@ -2103,10 +2120,12 @@ bool QGles2Texture::prepareBuild(QSize *adjustedSize)
const bool hasMipMaps = m_flags.testFlag(MipMapped);
const bool isCompressed = rhiD->isCompressedFormat(m_format);
// ### more formats
target = isCube ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D;
// ### more formats
glintformat = GL_RGBA;
glformat = GL_RGBA;
gltype = GL_UNSIGNED_BYTE;
mipLevelCount = hasMipMaps ? rhiD->q->mipLevelsForSize(size) : 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment