Commit fc72a073 by Geoff Lang

Update CHROMIUM_copy_texture entry points to the ES3 versions.

BUG=angleproject:1932 Change-Id: Ia45f8522320af1d747fbfb57468e8b881b033543 Reviewed-on: https://chromium-review.googlesource.com/459101Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent ee218f27
......@@ -1325,14 +1325,20 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#ifndef GL_CHROMIUM_copy_texture
#define GL_CHROMIUM_copy_texture 1
typedef void(GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUMPROC)(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
typedef void(GL_APIENTRYP PFNGLCOPYSUBTEXTURECHROMIUMPROC)(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
......@@ -1344,14 +1350,20 @@ typedef void(GL_APIENTRYP PFNGLCOPYSUBTEXTURECHROMIUMPROC)(GLuint sourceId,
GLboolean unpackUnmultiplyAlpha);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
GL_APICALL void GL_APIENTRY glCopySubTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
......
......@@ -3150,7 +3150,10 @@ void Context::generateMipmap(GLenum target)
}
void Context::copyTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
......@@ -3161,13 +3164,16 @@ void Context::copyTextureCHROMIUM(GLuint sourceId,
gl::Texture *sourceTexture = getTexture(sourceId);
gl::Texture *destTexture = getTexture(destId);
handleError(destTexture->copyTexture(this, internalFormat, destType, unpackFlipY == GL_TRUE,
unpackPremultiplyAlpha == GL_TRUE,
unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
handleError(destTexture->copyTexture(
this, destTarget, destLevel, internalFormat, destType, sourceLevel, unpackFlipY == GL_TRUE,
unpackPremultiplyAlpha == GL_TRUE, unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
}
void Context::copySubTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
......@@ -3190,9 +3196,9 @@ void Context::copySubTextureCHROMIUM(GLuint sourceId,
gl::Texture *destTexture = getTexture(destId);
Offset offset(xoffset, yoffset, 0);
Rectangle area(x, y, width, height);
handleError(destTexture->copySubTexture(this, offset, area, unpackFlipY == GL_TRUE,
unpackPremultiplyAlpha == GL_TRUE,
unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
handleError(destTexture->copySubTexture(
this, destTarget, destLevel, offset, sourceLevel, area, unpackFlipY == GL_TRUE,
unpackPremultiplyAlpha == GL_TRUE, unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
}
void Context::compressedCopyTextureCHROMIUM(GLuint sourceId, GLuint destId)
......
......@@ -496,14 +496,20 @@ class Context final : public ValidationContext
GLsizei imageSize,
const GLvoid *data);
void copyTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
void copySubTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
......
......@@ -967,38 +967,52 @@ Error Texture::copySubImage(const Context *context,
}
Error Texture::copyTexture(const Context *context,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source)
{
ASSERT(target == mState.mTarget ||
(mState.mTarget == GL_TEXTURE_CUBE_MAP && IsCubeMapTextureTarget(target)));
// Release from previous calls to eglBindTexImage, to avoid calling the Impl after
releaseTexImageInternal();
orphanImages();
ANGLE_TRY(mTexture->copyTexture(rx::SafeGetImpl(context), internalFormat, type, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source));
ANGLE_TRY(mTexture->copyTexture(rx::SafeGetImpl(context), target, level, internalFormat, type,
sourceLevel, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha, source));
const auto &sourceDesc = source->mState.getImageDesc(source->getTarget(), 0);
const GLenum sizedFormat = GetSizedInternalFormat(internalFormat, type);
mState.setImageDesc(getTarget(), 0, ImageDesc(sourceDesc.size, Format(sizedFormat)));
mState.setImageDesc(target, level, ImageDesc(sourceDesc.size, Format(sizedFormat)));
mDirtyChannel.signal();
return NoError();
}
Error Texture::copySubTexture(const Context *context,
GLenum target,
size_t level,
const Offset &destOffset,
size_t sourceLevel,
const Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source)
{
return mTexture->copySubTexture(rx::SafeGetImpl(context), destOffset, sourceArea, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
ASSERT(target == mState.mTarget ||
(mState.mTarget == GL_TEXTURE_CUBE_MAP && IsCubeMapTextureTarget(target)));
return mTexture->copySubTexture(rx::SafeGetImpl(context), target, level, destOffset,
sourceLevel, sourceArea, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha, source);
}
Error Texture::copyCompressedTexture(const Context *context, const Texture *source)
......
......@@ -313,14 +313,20 @@ class Texture final : public egl::ImageSibling,
const Framebuffer *source);
Error copyTexture(const Context *context,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source);
Error copySubTexture(const Context *context,
GLenum target,
size_t level,
const Offset &destOffset,
size_t sourceLevel,
const Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
......
......@@ -20,8 +20,11 @@ TextureImpl::~TextureImpl()
}
gl::Error TextureImpl::copyTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
......@@ -32,7 +35,10 @@ gl::Error TextureImpl::copyTexture(ContextImpl *contextImpl,
}
gl::Error TextureImpl::copySubTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
......
......@@ -95,14 +95,20 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
const gl::Framebuffer *source) = 0;
virtual gl::Error copyTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source);
virtual gl::Error copySubTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
......
......@@ -72,16 +72,28 @@ class MockTextureImpl : public TextureImpl
const gl::Offset &,
const gl::Rectangle &,
const gl::Framebuffer *));
MOCK_METHOD7(copyTexture,
gl::Error(ContextImpl *, GLenum, GLenum, bool, bool, bool, const gl::Texture *));
MOCK_METHOD7(copySubTexture,
gl::Error(ContextImpl *,
const gl::Offset &,
const gl::Rectangle &,
bool,
bool,
bool,
const gl::Texture *));
MOCK_METHOD10(copyTexture,
gl::Error(ContextImpl *,
GLenum,
size_t,
GLenum,
GLenum,
size_t,
bool,
bool,
bool,
const gl::Texture *));
MOCK_METHOD10(copySubTexture,
gl::Error(ContextImpl *,
GLenum,
size_t,
const gl::Offset &,
size_t,
const gl::Rectangle &,
bool,
bool,
bool,
const gl::Texture *));
MOCK_METHOD2(copyCompressedTexture, gl::Error(ContextImpl *, const gl::Texture *source));
MOCK_METHOD5(setStorage, gl::Error(ContextImpl *, GLenum, size_t, GLenum, const gl::Extents &));
MOCK_METHOD3(setImageExternal,
......
......@@ -178,6 +178,7 @@ class RendererD3D : public BufferFactoryD3D
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
......
......@@ -1030,17 +1030,21 @@ gl::Error TextureD3D_2D::copySubImage(ContextImpl *contextImpl,
}
gl::Error TextureD3D_2D::copyTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
ASSERT(target == GL_TEXTURE_2D);
GLenum sourceTarget = source->getTarget();
GLint sourceLevel = 0;
GLint destLevel = 0;
GLint destLevel = static_cast<GLint>(level);
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(internalFormat, type);
gl::Extents size(static_cast<int>(source->getWidth(sourceTarget, sourceLevel)),
......@@ -1055,24 +1059,28 @@ gl::Error TextureD3D_2D::copyTexture(ContextImpl *contextImpl,
gl::Rectangle sourceRect(0, 0, size.width, size.height);
gl::Offset destOffset(0, 0, 0);
ANGLE_TRY(mRenderer->copyTexture(source, sourceLevel, sourceRect,
ANGLE_TRY(mRenderer->copyTexture(source, static_cast<GLint>(sourceLevel), sourceRect,
gl::GetInternalFormatInfo(sizedInternalFormat).format,
destOffset, mTexStorage, destLevel, unpackFlipY,
destOffset, mTexStorage, target, destLevel, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
return gl::NoError();
}
gl::Error TextureD3D_2D::copySubTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
GLint sourceLevel = 0;
GLint destLevel = 0;
ASSERT(target == GL_TEXTURE_2D);
GLint destLevel = static_cast<GLint>(level);
ASSERT(canCreateRenderTargetForImage(gl::ImageIndex::Make2D(destLevel)));
......@@ -1080,9 +1088,9 @@ gl::Error TextureD3D_2D::copySubTexture(ContextImpl *contextImpl,
ASSERT(isValidLevel(destLevel));
ANGLE_TRY(updateStorageLevel(destLevel));
ANGLE_TRY(mRenderer->copyTexture(source, sourceLevel, sourceArea,
ANGLE_TRY(mRenderer->copyTexture(source, static_cast<GLint>(sourceLevel), sourceArea,
gl::GetInternalFormatInfo(getBaseLevelInternalFormat()).format,
destOffset, mTexStorage, destLevel, unpackFlipY,
destOffset, mTexStorage, target, destLevel, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
return gl::NoError();
......
......@@ -201,14 +201,20 @@ class TextureD3D_2D : public TextureD3D
const gl::Framebuffer *source) override;
gl::Error copyTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error copySubTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
......
......@@ -3206,6 +3206,7 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
......@@ -3216,6 +3217,7 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
TextureStorage *sourceStorage = nullptr;
ANGLE_TRY(const_cast<TextureD3D *>(sourceD3D)->getNativeTexture(&sourceStorage));
ASSERT(destTarget == GL_TEXTURE_2D);
TextureStorage11_2D *sourceStorage11 = GetAs<TextureStorage11_2D>(sourceStorage);
ASSERT(sourceStorage11);
......
......@@ -219,6 +219,7 @@ class Renderer11 : public RendererD3D
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
......
......@@ -2463,11 +2463,14 @@ gl::Error Renderer9::copyTexture(const gl::Texture *source,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha)
{
ASSERT(destTarget == GL_TEXTURE_2D);
RECT rect;
rect.left = sourceRect.x;
rect.top = sourceRect.y;
......
......@@ -216,6 +216,7 @@ class Renderer9 : public RendererD3D
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
......
......@@ -428,7 +428,10 @@ gl::Error BlitGL::blitColorBufferWithShader(const gl::Framebuffer *source,
}
gl::Error BlitGL::copySubTexture(TextureGL *source,
size_t sourceLevel,
TextureGL *dest,
GLenum destTarget,
size_t destLevel,
const gl::Extents &sourceSize,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset,
......@@ -464,6 +467,7 @@ gl::Error BlitGL::copySubTexture(TextureGL *source,
}
source->setMinFilter(GL_NEAREST);
source->setMagFilter(GL_NEAREST);
source->setBaseLevel(static_cast<GLuint>(sourceLevel));
// Render to the destination texture, sampling from the source texture
ScopedGLState scopedState(
......@@ -500,8 +504,8 @@ gl::Error BlitGL::copySubTexture(TextureGL *source,
}
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mScratchFBO);
mFunctions->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, dest->getTarget(),
dest->getTextureID(), 0);
mFunctions->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, destTarget,
dest->getTextureID(), static_cast<GLint>(destLevel));
mStateManager->bindVertexArray(mVAO, 0);
mFunctions->drawArrays(GL_TRIANGLES, 0, 3);
......
......@@ -61,7 +61,10 @@ class BlitGL : public angle::NonCopyable
GLenum filter);
gl::Error copySubTexture(TextureGL *source,
size_t sourceLevel,
TextureGL *dest,
GLenum destTarget,
size_t destLevel,
const gl::Extents &sourceSize,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset,
......
......@@ -632,8 +632,11 @@ gl::Error TextureGL::copySubImage(ContextImpl *contextImpl,
}
gl::Error TextureGL::copyTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
......@@ -647,12 +650,16 @@ gl::Error TextureGL::copyTexture(ContextImpl *contextImpl,
reserveTexImageToBeFilled(getTarget(), 0, sizedInternalFormat, sourceImageDesc.size,
internalFormat, type);
return copySubTextureHelper(gl::Offset(0, 0, 0), sourceArea, internalFormat, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
return copySubTextureHelper(target, level, gl::Offset(0, 0, 0), sourceLevel, sourceArea,
internalFormat, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha, source);
}
gl::Error TextureGL::copySubTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
......@@ -660,11 +667,14 @@ gl::Error TextureGL::copySubTexture(ContextImpl *contextImpl,
const gl::Texture *source)
{
GLenum destFormat = mState.getImageDesc(mState.mTarget, 0).format.format;
return copySubTextureHelper(destOffset, sourceArea, destFormat, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
return copySubTextureHelper(target, level, destOffset, sourceLevel, sourceArea, destFormat,
unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
}
gl::Error TextureGL::copySubTextureHelper(const gl::Offset &destOffset,
gl::Error TextureGL::copySubTextureHelper(GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
GLenum destFormat,
bool unpackFlipY,
......@@ -691,9 +701,10 @@ gl::Error TextureGL::copySubTextureHelper(const gl::Offset &destOffset,
}
// We can't use copyTexSubImage, do a manual copy
return mBlitter->copySubTexture(sourceGL, this, sourceImageDesc.size, sourceArea, destOffset,
needsLumaWorkaround, sourceGL->mLevelInfo[0].sourceFormat,
unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
return mBlitter->copySubTexture(
sourceGL, sourceLevel, this, target, level, sourceImageDesc.size, sourceArea, destOffset,
needsLumaWorkaround, sourceGL->mLevelInfo[sourceLevel].sourceFormat, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
}
gl::Error TextureGL::setStorage(ContextImpl *contextImpl,
......@@ -1031,6 +1042,18 @@ bool TextureGL::hasAnyDirtyBit() const
return mLocalDirtyBits.any();
}
void TextureGL::setBaseLevel(GLuint baseLevel)
{
if (baseLevel != mAppliedBaseLevel)
{
mAppliedBaseLevel = baseLevel;
mLocalDirtyBits.set(gl::Texture::DIRTY_BIT_BASE_LEVEL);
mStateManager->bindTexture(getTarget(), mTextureID);
mFunctions->texParameteri(getTarget(), GL_TEXTURE_BASE_LEVEL, baseLevel);
}
}
void TextureGL::setMinFilter(GLenum filter)
{
if (filter != mAppliedSampler.minFilter)
......
......@@ -108,20 +108,29 @@ class TextureGL : public TextureImpl
const gl::Framebuffer *source) override;
gl::Error copyTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error copySubTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error copySubTextureHelper(const gl::Offset &destOffset,
gl::Error copySubTextureHelper(GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
GLenum destFormat,
bool unpackFlipY,
......@@ -156,11 +165,11 @@ class TextureGL : public TextureImpl
GLuint getTextureID() const;
GLenum getTarget() const;
void setBaseLevel(GLuint) override {}
void syncState(const gl::Texture::DirtyBits &dirtyBits) override;
bool hasAnyDirtyBit() const;
void setBaseLevel(GLuint baseLevel) override;
void setMinFilter(GLenum filter);
void setMagFilter(GLenum filter);
......
......@@ -3171,7 +3171,10 @@ bool ValidateProgramPathFragmentInputGen(Context *context,
bool ValidateCopyTextureCHROMIUM(Context *context,
GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
......@@ -3249,7 +3252,10 @@ bool ValidateCopyTextureCHROMIUM(Context *context,
bool ValidateCopySubTextureCHROMIUM(Context *context,
GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
......@@ -3332,7 +3338,6 @@ bool ValidateCopySubTextureCHROMIUM(Context *context,
return false;
}
GLenum destTarget = dest->getTarget();
ASSERT(destTarget != GL_TEXTURE_CUBE_MAP);
if (dest->getWidth(sourceTarget, 0) == 0 || dest->getHeight(sourceTarget, 0) == 0)
{
......
......@@ -318,7 +318,10 @@ bool ValidateProgramPathFragmentInputGen(Context *context,
bool ValidateCopyTextureCHROMIUM(Context *context,
GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
......@@ -326,7 +329,10 @@ bool ValidateCopyTextureCHROMIUM(Context *context,
GLboolean unpackUnmultiplyAlpha);
bool ValidateCopySubTextureCHROMIUM(Context *context,
GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
......
......@@ -1854,7 +1854,10 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program
}
ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
......@@ -1862,30 +1865,35 @@ ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
GLboolean unpackUnmultiplyAlpha)
{
EVENT(
"(GLuint sourceId = %u, GLuint destId = %u, GLint internalFormat = 0x%X, GLenum destType = "
"(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
"%u, GLint destLevel = %d, GLint internalFormat = 0x%X, GLenum destType = "
"0x%X, GLboolean unpackFlipY = %u, GLboolean unpackPremultiplyAlpha = %u, GLboolean "
"unpackUnmultiplyAlpha = %u)",
sourceId, destId, internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha);
sourceId, sourceLevel, destTarget, destId, destLevel, internalFormat, destType, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateCopyTextureCHROMIUM(context, sourceId, destId, internalFormat, destType,
unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha))
!ValidateCopyTextureCHROMIUM(context, sourceId, sourceLevel, destTarget, destId,
destLevel, internalFormat, destType, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha))
{
return;
}
context->copyTextureCHROMIUM(sourceId, destId, internalFormat, destType, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
context->copyTextureCHROMIUM(sourceId, sourceLevel, destTarget, destId, destLevel,
internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha);
}
}
ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
......@@ -1897,25 +1905,27 @@ ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
GLboolean unpackUnmultiplyAlpha)
{
EVENT(
"(GLuint sourceId = %u, GLuint destId = %u, , GLboolean unpackFlipY = %u, GLint xoffset = "
"(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
"%u, GLint destLevel = %d, GLint xoffset = "
"%d, GLint yoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = "
"%d, GLboolean unpackPremultiplyAlpha = %u, GLboolean unpackUnmultiplyAlpha = %u)",
sourceId, destId, xoffset, yoffset, x, y, width, height, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
sourceId, sourceLevel, destTarget, destId, destLevel, xoffset, yoffset, x, y, width, height,
unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateCopySubTextureCHROMIUM(context, sourceId, destId, xoffset, yoffset, x, y,
width, height, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha))
!ValidateCopySubTextureCHROMIUM(
context, sourceId, sourceLevel, destTarget, destId, destLevel, xoffset, yoffset, x,
y, width, height, unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha))
{
return;
}
context->copySubTextureCHROMIUM(sourceId, destId, xoffset, yoffset, x, y, width, height,
unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
context->copySubTextureCHROMIUM(sourceId, sourceLevel, destTarget, destId, destLevel,
xoffset, yoffset, x, y, width, height, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
}
}
......
......@@ -240,7 +240,10 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program
// GL_CHROMIUM_copy_texture
ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
......@@ -248,7 +251,10 @@ ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
GLboolean unpackUnmultiplyAlpha);
ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
GLint sourceLevel,
GLenum destTarget,
GLuint destId,
GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
......
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