Commit a8fe18fc by Geoff Lang Committed by Commit Bot

GL: Fix usage of glGetInternalFormativ.

The Target was being passed cube map faces for cube map textures. The return value is an enum, not a bool. BUG=angleproject:1932 Change-Id: I975f510fc0f6bc4d29adcbb152b0329ecbcdfa92 Reviewed-on: https://chromium-review.googlesource.com/902192Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent b5420664
...@@ -793,7 +793,7 @@ gl::Error TextureGL::copySubTextureHelper(const gl::Context *context, ...@@ -793,7 +793,7 @@ gl::Error TextureGL::copySubTextureHelper(const gl::Context *context,
// Check if the destination is renderable and copy on the GPU // Check if the destination is renderable and copy on the GPU
const LevelInfoGL &destLevelInfo = getLevelInfo(target, level); const LevelInfoGL &destLevelInfo = getLevelInfo(target, level);
if (!destSRGB && if (!destSRGB &&
nativegl::SupportsNativeRendering(mFunctions, target, destLevelInfo.nativeInternalFormat)) nativegl::SupportsNativeRendering(mFunctions, getTarget(), destLevelInfo.nativeInternalFormat))
{ {
return mBlitter->copySubTexture(context, sourceGL, sourceLevel, sourceComponentType, this, return mBlitter->copySubTexture(context, sourceGL, sourceLevel, sourceComponentType, this,
target, level, destComponentType, sourceImageDesc.size, target, level, destComponentType, sourceImageDesc.size,
......
...@@ -1208,10 +1208,10 @@ bool SupportsNativeRendering(const FunctionsGL *functions, GLenum target, GLenum ...@@ -1208,10 +1208,10 @@ bool SupportsNativeRendering(const FunctionsGL *functions, GLenum target, GLenum
if (functions->isAtLeastGL(gl::Version(4, 3)) || if (functions->isAtLeastGL(gl::Version(4, 3)) ||
functions->hasGLExtension("GL_ARB_internalformat_query2")) functions->hasGLExtension("GL_ARB_internalformat_query2"))
{ {
GLint framebufferRenderable = GL_FALSE; GLint framebufferRenderable = GL_NONE;
functions->getInternalformativ(target, internalFormat, GL_FRAMEBUFFER_RENDERABLE, 1, functions->getInternalformativ(target, internalFormat, GL_FRAMEBUFFER_RENDERABLE, 1,
&framebufferRenderable); &framebufferRenderable);
return gl::ConvertToBool(framebufferRenderable); return framebufferRenderable != GL_NONE;
} }
else else
{ {
......
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