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