Commit 893e22d1 authored by Boudewijn Rempt's avatar Boudewijn Rempt Committed by Dmitry Kazakov

Fix channel swizzling problem on OSX (BGRA vs RGBA on 32Fbits)

OSX supports core profile only, so it doesn't report any extensions
for floating point texture formats. We should just use it directly if
openGL version is higher than 3.0, when floating point textures became
core profile.
parent e38339f1
......@@ -570,9 +570,9 @@ void KisOpenGLImageTextures::updateTextureFormat()
if (colorModelId == RGBAColorModelID) {
if (colorDepthId == Float16BitsColorDepthID) {
if (KisOpenGL::hasOpenGLES()) {
if (KisOpenGL::hasOpenGLES() || KisOpenGL::hasOpenGL3()) {
m_texturesInfo.internalFormat = GL_RGBA16F;
dbgUI << "Using half (GLES)";
dbgUI << "Using half (GLES or GL3)";
} else if (ctx->hasExtension("GL_ARB_texture_float")) {
m_texturesInfo.internalFormat = GL_RGBA16F_ARB;
dbgUI << "Using ARB half";
......@@ -587,10 +587,10 @@ void KisOpenGLImageTextures::updateTextureFormat()
haveBuiltInOpenExr = true;
#endif
if (haveBuiltInOpenExr && KisOpenGL::hasOpenGLES()) {
if (haveBuiltInOpenExr && (KisOpenGL::hasOpenGLES() || KisOpenGL::hasOpenGL3())) {
m_texturesInfo.type = GL_HALF_FLOAT;
destinationColorDepthId = Float16BitsColorDepthID;
dbgUI << "Pixel type half (GLES)";
dbgUI << "Pixel type half (GLES or GL3)";
} else if (haveBuiltInOpenExr && ctx->hasExtension("GL_ARB_half_float_pixel")) {
m_texturesInfo.type = GL_HALF_FLOAT_ARB;
destinationColorDepthId = Float16BitsColorDepthID;
......@@ -603,9 +603,9 @@ void KisOpenGLImageTextures::updateTextureFormat()
m_texturesInfo.format = GL_RGBA;
}
else if (colorDepthId == Float32BitsColorDepthID) {
if (KisOpenGL::hasOpenGLES()) {
if (KisOpenGL::hasOpenGLES() || KisOpenGL::hasOpenGL3()) {
m_texturesInfo.internalFormat = GL_RGBA32F;
dbgUI << "Using float (GLES)";
dbgUI << "Using float (GLES or GL3)";
} else if (ctx->hasExtension("GL_ARB_texture_float")) {
m_texturesInfo.internalFormat = GL_RGBA32F_ARB;
dbgUI << "Using ARB float";
......
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