Commit 4c2cc893 authored by Laszlo Agocs's avatar Laszlo Agocs

gl: Fix wrong extension check for R8

parent a1ad846c
......@@ -326,8 +326,8 @@ bool QRhiGles2::create(QRhi::Flags flags)
caps.bgraExternalFormat = f->hasOpenGLExtension(QOpenGLExtensions::BGRATextureFormat);
caps.bgraInternalFormat = caps.bgraExternalFormat && actualFormat.renderableType() == QSurfaceFormat::OpenGLES;
caps.sized8Formats = f->hasOpenGLExtension(QOpenGLExtensions::Sized8Formats);
caps.sized16Formats = f->hasOpenGLExtension(QOpenGLExtensions::Sized16Formats);
caps.r8Format = f->hasOpenGLFeature(QOpenGLFunctions::TextureRGFormats);
caps.r16Format = f->hasOpenGLExtension(QOpenGLExtensions::Sized16Formats);
nativeHandlesStruct.context = ctx;
......@@ -537,10 +537,10 @@ bool QRhiGles2::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture
return caps.bgraExternalFormat;
case QRhiTexture::R8:
return caps.sized8Formats;
return caps.r8Format;
case QRhiTexture::R16:
return caps.sized16Formats;
return caps.r16Format;
default:
break;
......
......@@ -567,8 +567,8 @@ public:
fixedIndexPrimitiveRestart(false),
bgraExternalFormat(false),
bgraInternalFormat(false),
sized8Formats(false),
sized16Formats(false)
r8Format(false),
r16Format(false)
{ }
int maxTextureSize;
// Multisample fb and blit are supported (GLES 3.0 or OpenGL 3.x). Not
......@@ -579,8 +579,8 @@ public:
uint fixedIndexPrimitiveRestart : 1;
uint bgraExternalFormat : 1;
uint bgraInternalFormat : 1;
uint sized8Formats : 1;
uint sized16Formats : 1;
uint r8Format : 1;
uint r16Format : 1;
} caps;
bool inFrame = false;
bool inPass = false;
......
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