From cfc73cc1af5e25cce644a9cd7703ab6a2fd90c79 Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Mon, 8 Apr 2019 16:26:51 -0400 Subject: [PATCH] Correct subImage uses of texture type -> target. Texture "types" are the same as texture "targets" except for cube maps. Cube map targets specify a single face. Cube map types specify a whole cube map. The subImage functions should take a target instead of a type. We were using both in different places. This CL corrects all uses in subImage calls to "target". It also adds a helper for getting a target texture from a target. And clarifies the naming of the texture query methods. Bug: angleproject:3356 Change-Id: I06eb5c5666eec9b8934becf2ba57a066d5cdabde Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1558672 Commit-Queue: Jamie Madill Reviewed-by: Jonah Ryan-Davis Reviewed-by: Tim Van Patten Reviewed-by: Jamie Madill --- scripts/entry_point_packed_gl_enums.json | 10 +-- scripts/run_code_generation_hashes.json | 10 +-- src/common/PackedEnums.cpp | 3 +- src/libANGLE/Context.cpp | 89 ++++++++++--------- src/libANGLE/Context.h | 13 +-- src/libANGLE/validationEGL.cpp | 2 +- src/libANGLE/validationES.cpp | 8 +- src/libANGLE/validationES2.cpp | 6 +- src/libANGLE/validationES3.cpp | 37 ++++---- src/libANGLE/validationES3_autogen.h | 6 +- src/libANGLE/validationESEXT_autogen.h | 4 +- .../entry_points_gles_3_0_autogen.cpp | 6 +- .../entry_points_gles_ext_autogen.cpp | 14 +-- 13 files changed, 107 insertions(+), 101 deletions(-) diff --git a/scripts/entry_point_packed_gl_enums.json b/scripts/entry_point_packed_gl_enums.json index 91f2a84bc..b7cbb2a18 100644 --- a/scripts/entry_point_packed_gl_enums.json +++ b/scripts/entry_point_packed_gl_enums.json @@ -55,10 +55,10 @@ "target": "TextureTarget" }, "glCompressedTexSubImage3D": { - "target": "TextureType" + "target": "TextureTarget" }, "glCompressedTexSubImage3DRobustANGLE": { - "target": "TextureType" + "target": "TextureTarget" }, "glCopyTexImage2D": { "target": "TextureTarget" @@ -73,7 +73,7 @@ "target": "TextureTarget" }, "glCopyTexSubImage3D": { - "target": "TextureType" + "target": "TextureTarget" }, "glCopySubTexture3DANGLE": { "destTarget": "TextureTarget" @@ -466,10 +466,10 @@ "target": "TextureTarget" }, "glTexSubImage3D": { - "target": "TextureType" + "target": "TextureTarget" }, "glTexSubImage3DRobustANGLE": { - "target": "TextureType" + "target": "TextureTarget" }, "glUnmapBuffer": { "target": "BufferBinding" diff --git a/scripts/run_code_generation_hashes.json b/scripts/run_code_generation_hashes.json index 58b07d052..ef16add69 100644 --- a/scripts/run_code_generation_hashes.json +++ b/scripts/run_code_generation_hashes.json @@ -92,7 +92,7 @@ "GL/EGL entry points:scripts/egl_angle_ext.xml": "745534010f31fbe8e1a1fcddce15ed2d", "GL/EGL entry points:scripts/entry_point_packed_gl_enums.json": - "a161bca02b89f244c56cc2702581e805", + "9bc20d81551055da0fb453ccf3f52f60", "GL/EGL entry points:scripts/generate_entry_points.py": "7bd73a78c638334a114ed027d49cb6df", "GL/EGL entry points:scripts/gl.xml": @@ -110,9 +110,9 @@ "GL/EGL entry points:src/libANGLE/validationES31_autogen.h": "22ef241ea5b79a6abe6589f1afcc80a2", "GL/EGL entry points:src/libANGLE/validationES3_autogen.h": - "210f732f87ac6a184bde4d4d1e548f70", + "345af98379909661060556c7ffaef7c0", "GL/EGL entry points:src/libANGLE/validationESEXT_autogen.h": - "aec7b57a43322eb9f3959dc12e474058", + "4585c928c60468b4a1909f31ce502daf", "GL/EGL entry points:src/libGLESv2/entry_points_enum_autogen.h": "c023a19637be195551e04642f489eb24", "GL/EGL entry points:src/libGLESv2/entry_points_gles_1_0_autogen.cpp": @@ -124,7 +124,7 @@ "GL/EGL entry points:src/libGLESv2/entry_points_gles_2_0_autogen.h": "3bbaf1cf42fba5d675e5b54cd1d14df7", "GL/EGL entry points:src/libGLESv2/entry_points_gles_3_0_autogen.cpp": - "555b6fa72e56b5d6a531b744e5dd0607", + "86234d9b1a412ba827131adf931453c1", "GL/EGL entry points:src/libGLESv2/entry_points_gles_3_0_autogen.h": "395f6978219abd5182bbe80cc367e40c", "GL/EGL entry points:src/libGLESv2/entry_points_gles_3_1_autogen.cpp": @@ -132,7 +132,7 @@ "GL/EGL entry points:src/libGLESv2/entry_points_gles_3_1_autogen.h": "043d09a964c740067bf4279e0b544aed", "GL/EGL entry points:src/libGLESv2/entry_points_gles_ext_autogen.cpp": - "41608a3051395e280509f4dffca55659", + "6f0d4c01e04b65800e4a800327581a26", "GL/EGL entry points:src/libGLESv2/entry_points_gles_ext_autogen.h": "1daa12e804ae05ed40176d18eb895e84", "GL/EGL entry points:src/libGLESv2/libGLESv2_autogen.cpp": diff --git a/src/common/PackedEnums.cpp b/src/common/PackedEnums.cpp index 805c3b821..b165043ba 100644 --- a/src/common/PackedEnums.cpp +++ b/src/common/PackedEnums.cpp @@ -38,8 +38,7 @@ TextureType TextureTargetToType(TextureTarget target) return TextureType::_2DMultisampleArray; case TextureTarget::_3D: return TextureType::_3D; - default: - UNREACHABLE(); + case TextureTarget::InvalidEnum: return TextureType::InvalidEnum; } } diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp index 1f6b3f749..05c50221b 100644 --- a/src/libANGLE/Context.cpp +++ b/src/libANGLE/Context.cpp @@ -1325,12 +1325,17 @@ Query *Context::getQuery(GLuint handle) const return mQueryMap.query(handle); } -Texture *Context::getTargetTexture(TextureType type) const +Texture *Context::getTextureByType(TextureType type) const { ASSERT(ValidTextureTarget(this, type) || ValidTextureExternalTarget(this, type)); return mState.getTargetTexture(type); } +Texture *Context::getTextureByTarget(TextureTarget target) const +{ + return getTextureByType(TextureTargetToType(target)); +} + Texture *Context::getSamplerTexture(unsigned int sampler, TextureType type) const { return mState.getSamplerTexture(sampler, type); @@ -2031,7 +2036,7 @@ void Context::getRenderbufferParameterivRobust(GLenum target, void Context::getTexParameterfv(TextureType target, GLenum pname, GLfloat *params) { - const Texture *const texture = getTargetTexture(target); + const Texture *const texture = getTextureByType(target); QueryTexParameterfv(texture, pname, params); } @@ -2046,19 +2051,19 @@ void Context::getTexParameterfvRobust(TextureType target, void Context::getTexParameteriv(TextureType target, GLenum pname, GLint *params) { - const Texture *const texture = getTargetTexture(target); + const Texture *const texture = getTextureByType(target); QueryTexParameteriv(texture, pname, params); } void Context::getTexParameterIiv(TextureType target, GLenum pname, GLint *params) { - const Texture *const texture = getTargetTexture(target); + const Texture *const texture = getTextureByType(target); QueryTexParameterIiv(texture, pname, params); } void Context::getTexParameterIuiv(TextureType target, GLenum pname, GLuint *params) { - const Texture *const texture = getTargetTexture(target); + const Texture *const texture = getTextureByType(target); QueryTexParameterIuiv(texture, pname, params); } @@ -2091,7 +2096,7 @@ void Context::getTexParameterIuivRobust(TextureType target, void Context::getTexLevelParameteriv(TextureTarget target, GLint level, GLenum pname, GLint *params) { - Texture *texture = getTargetTexture(TextureTargetToType(target)); + Texture *texture = getTextureByTarget(target); QueryTexLevelParameteriv(texture, target, level, pname, params); } @@ -2110,7 +2115,7 @@ void Context::getTexLevelParameterfv(TextureTarget target, GLenum pname, GLfloat *params) { - Texture *texture = getTargetTexture(TextureTargetToType(target)); + Texture *texture = getTextureByTarget(target); QueryTexLevelParameterfv(texture, target, level, pname, params); } @@ -2126,13 +2131,13 @@ void Context::getTexLevelParameterfvRobust(TextureTarget target, void Context::texParameterf(TextureType target, GLenum pname, GLfloat param) { - Texture *const texture = getTargetTexture(target); + Texture *const texture = getTextureByType(target); SetTexParameterf(this, texture, pname, param); } void Context::texParameterfv(TextureType target, GLenum pname, const GLfloat *params) { - Texture *const texture = getTargetTexture(target); + Texture *const texture = getTextureByType(target); SetTexParameterfv(this, texture, pname, params); } @@ -2146,25 +2151,25 @@ void Context::texParameterfvRobust(TextureType target, void Context::texParameteri(TextureType target, GLenum pname, GLint param) { - Texture *const texture = getTargetTexture(target); + Texture *const texture = getTextureByType(target); SetTexParameteri(this, texture, pname, param); } void Context::texParameteriv(TextureType target, GLenum pname, const GLint *params) { - Texture *const texture = getTargetTexture(target); + Texture *const texture = getTextureByType(target); SetTexParameteriv(this, texture, pname, params); } void Context::texParameterIiv(TextureType target, GLenum pname, const GLint *params) { - Texture *const texture = getTargetTexture(target); + Texture *const texture = getTextureByType(target); SetTexParameterIiv(this, texture, pname, params); } void Context::texParameterIuiv(TextureType target, GLenum pname, const GLuint *params) { - Texture *const texture = getTargetTexture(target); + Texture *const texture = getTextureByType(target); SetTexParameterIuiv(this, texture, pname, params); } @@ -3702,7 +3707,7 @@ void Context::copyTexImage2D(TextureTarget target, Rectangle sourceArea(x, y, width, height); Framebuffer *framebuffer = mState.getReadFramebuffer(); - Texture *texture = getTargetTexture(TextureTargetToType(target)); + Texture *texture = getTextureByTarget(target); ANGLE_CONTEXT_TRY( texture->copyImage(this, target, level, sourceArea, internalformat, framebuffer)); } @@ -3730,11 +3735,11 @@ void Context::copyTexSubImage2D(TextureTarget target, ImageIndex index = ImageIndex::MakeFromTarget(target, level); Framebuffer *framebuffer = mState.getReadFramebuffer(); - Texture *texture = getTargetTexture(TextureTargetToType(target)); + Texture *texture = getTextureByTarget(target); ANGLE_CONTEXT_TRY(texture->copySubImage(this, index, destOffset, sourceArea, framebuffer)); } -void Context::copyTexSubImage3D(TextureType target, +void Context::copyTexSubImage3D(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -3755,10 +3760,10 @@ void Context::copyTexSubImage3D(TextureType target, Offset destOffset(xoffset, yoffset, zoffset); Rectangle sourceArea(x, y, width, height); - ImageIndex index = ImageIndex::MakeFromType(target, level, zoffset); + ImageIndex index = ImageIndex::MakeFromType(TextureTargetToType(target), level, zoffset); Framebuffer *framebuffer = mState.getReadFramebuffer(); - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByTarget(target); ANGLE_CONTEXT_TRY(texture->copySubImage(this, index, destOffset, sourceArea, framebuffer)); } @@ -3997,7 +4002,7 @@ void Context::texImage2D(TextureTarget target, ANGLE_CONTEXT_TRY(syncStateForTexImage()); Extents size(width, height, 1); - Texture *texture = getTargetTexture(TextureTargetToType(target)); + Texture *texture = getTextureByTarget(target); ANGLE_CONTEXT_TRY(texture->setImage(this, mState.getUnpackState(), target, level, internalformat, size, format, type, static_cast(pixels))); @@ -4031,7 +4036,7 @@ void Context::texImage3D(TextureType target, ANGLE_CONTEXT_TRY(syncStateForTexImage()); Extents size(width, height, depth); - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByType(target); ANGLE_CONTEXT_TRY(texture->setImage(this, mState.getUnpackState(), NonCubeTextureTypeToTarget(target), level, internalformat, size, format, type, static_cast(pixels))); @@ -4071,7 +4076,7 @@ void Context::texSubImage2D(TextureTarget target, ANGLE_CONTEXT_TRY(syncStateForTexImage()); Box area(xoffset, yoffset, 0, width, height, 1); - Texture *texture = getTargetTexture(TextureTargetToType(target)); + Texture *texture = getTextureByTarget(target); gl::Buffer *unpackBuffer = mState.getTargetBuffer(gl::BufferBinding::PixelUnpack); @@ -4094,7 +4099,7 @@ void Context::texSubImage2DRobust(TextureTarget target, texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); } -void Context::texSubImage3D(TextureType target, +void Context::texSubImage3D(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -4115,16 +4120,16 @@ void Context::texSubImage3D(TextureType target, ANGLE_CONTEXT_TRY(syncStateForTexImage()); Box area(xoffset, yoffset, zoffset, width, height, depth); - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByTarget(target); gl::Buffer *unpackBuffer = mState.getTargetBuffer(gl::BufferBinding::PixelUnpack); - ANGLE_CONTEXT_TRY(texture->setSubImage(this, mState.getUnpackState(), unpackBuffer, - NonCubeTextureTypeToTarget(target), level, area, format, - type, static_cast(pixels))); + ANGLE_CONTEXT_TRY(texture->setSubImage(this, mState.getUnpackState(), unpackBuffer, target, + level, area, format, type, + static_cast(pixels))); } -void Context::texSubImage3DRobust(TextureType target, +void Context::texSubImage3DRobust(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -4153,7 +4158,7 @@ void Context::compressedTexImage2D(TextureTarget target, ANGLE_CONTEXT_TRY(syncStateForTexImage()); Extents size(width, height, 1); - Texture *texture = getTargetTexture(TextureTargetToType(target)); + Texture *texture = getTextureByTarget(target); ANGLE_CONTEXT_TRY(texture->setCompressedImage(this, mState.getUnpackState(), target, level, internalformat, size, imageSize, static_cast(data))); @@ -4185,7 +4190,7 @@ void Context::compressedTexImage3D(TextureType target, ANGLE_CONTEXT_TRY(syncStateForTexImage()); Extents size(width, height, depth); - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByType(target); ANGLE_CONTEXT_TRY(texture->setCompressedImage( this, mState.getUnpackState(), NonCubeTextureTypeToTarget(target), level, internalformat, size, imageSize, static_cast(data))); @@ -4219,7 +4224,7 @@ void Context::compressedTexSubImage2D(TextureTarget target, ANGLE_CONTEXT_TRY(syncStateForTexImage()); Box area(xoffset, yoffset, 0, width, height, 1); - Texture *texture = getTargetTexture(TextureTargetToType(target)); + Texture *texture = getTextureByTarget(target); ANGLE_CONTEXT_TRY(texture->setCompressedSubImage(this, mState.getUnpackState(), target, level, area, format, imageSize, static_cast(data))); @@ -4240,7 +4245,7 @@ void Context::compressedTexSubImage2DRobust(TextureTarget target, data); } -void Context::compressedTexSubImage3D(TextureType target, +void Context::compressedTexSubImage3D(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -4261,13 +4266,13 @@ void Context::compressedTexSubImage3D(TextureType target, ANGLE_CONTEXT_TRY(syncStateForTexImage()); Box area(xoffset, yoffset, zoffset, width, height, depth); - Texture *texture = getTargetTexture(target); - ANGLE_CONTEXT_TRY(texture->setCompressedSubImage( - this, mState.getUnpackState(), NonCubeTextureTypeToTarget(target), level, area, format, - imageSize, static_cast(data))); + Texture *texture = getTextureByTarget(target); + ANGLE_CONTEXT_TRY(texture->setCompressedSubImage(this, mState.getUnpackState(), target, level, + area, format, imageSize, + static_cast(data))); } -void Context::compressedTexSubImage3DRobust(TextureType target, +void Context::compressedTexSubImage3DRobust(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -4286,7 +4291,7 @@ void Context::compressedTexSubImage3DRobust(TextureType target, void Context::generateMipmap(TextureType target) { - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByType(target); ANGLE_CONTEXT_TRY(texture->generateMipmap(this)); } @@ -5159,7 +5164,7 @@ void Context::texStorage2DMultisample(TextureType target, GLboolean fixedsamplelocations) { Extents size(width, height, 1); - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByType(target); ANGLE_CONTEXT_TRY(texture->setStorageMultisample(this, target, samples, internalformat, size, ConvertToBool(fixedsamplelocations))); } @@ -5173,7 +5178,7 @@ void Context::texStorage3DMultisample(TextureType target, GLboolean fixedsamplelocations) { Extents size(width, height, depth); - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByType(target); ANGLE_CONTEXT_TRY(texture->setStorageMultisample(this, target, samples, internalformat, size, ConvertToBool(fixedsamplelocations))); } @@ -5293,7 +5298,7 @@ void Context::texStorage2D(TextureType target, GLsizei height) { Extents size(width, height, 1); - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByType(target); ANGLE_CONTEXT_TRY(texture->setStorage(this, target, levels, internalFormat, size)); } @@ -5305,7 +5310,7 @@ void Context::texStorage3D(TextureType target, GLsizei depth) { Extents size(width, height, depth); - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByType(target); ANGLE_CONTEXT_TRY(texture->setStorage(this, target, levels, internalFormat, size)); } @@ -7263,7 +7268,7 @@ void Context::importSemaphoreFd(GLuint semaphore, GLenum handleType, GLint fd) void Context::eGLImageTargetTexture2D(TextureType target, GLeglImageOES image) { - Texture *texture = getTargetTexture(target); + Texture *texture = getTextureByType(target); egl::Image *imageObject = static_cast(image); ANGLE_CONTEXT_TRY(texture->setEGLImageTarget(this, target, imageObject)); } diff --git a/src/libANGLE/Context.h b/src/libANGLE/Context.h index c86bc71f9..ec40730ae 100644 --- a/src/libANGLE/Context.h +++ b/src/libANGLE/Context.h @@ -669,7 +669,8 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl GLchar *label) const; void getObjectPtrLabel(const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label) const; - Texture *getTargetTexture(TextureType type) const; + Texture *getTextureByType(TextureType type) const; + Texture *getTextureByTarget(TextureTarget target) const; Texture *getSamplerTexture(unsigned int sampler, TextureType type) const; Compiler *getCompiler() const; @@ -921,7 +922,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl GLsizei width, GLsizei height); - void copyTexSubImage3D(TextureType target, + void copyTexSubImage3D(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -1032,7 +1033,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl GLenum type, GLsizei bufSize, const void *pixels); - void texSubImage3D(TextureType target, + void texSubImage3D(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -1043,7 +1044,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl GLenum format, GLenum type, const void *pixels); - void texSubImage3DRobust(TextureType target, + void texSubImage3DRobust(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -1110,7 +1111,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl GLsizei imageSize, GLsizei dataSize, const GLvoid *data); - void compressedTexSubImage3D(TextureType target, + void compressedTexSubImage3D(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -1121,7 +1122,7 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl GLenum format, GLsizei imageSize, const void *data); - void compressedTexSubImage3DRobust(TextureType target, + void compressedTexSubImage3DRobust(TextureTarget target, GLint level, GLint xoffset, GLint yoffset, diff --git a/src/libANGLE/validationEGL.cpp b/src/libANGLE/validationEGL.cpp index a092d0a9a..a9dfb86fc 100644 --- a/src/libANGLE/validationEGL.cpp +++ b/src/libANGLE/validationEGL.cpp @@ -2956,7 +2956,7 @@ Error ValidateBindTexImage(const Display *display, if (context) { gl::TextureType type = egl_gl::EGLTextureTargetToTextureType(surface->getTextureTarget()); - *textureObject = context->getTargetTexture(type); + *textureObject = context->getTextureByType(type); ASSERT(*textureObject != nullptr); if ((*textureObject)->getImmutableFormat()) diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp index 310821997..e0ed3d9d5 100644 --- a/src/libANGLE/validationES.cpp +++ b/src/libANGLE/validationES.cpp @@ -5100,7 +5100,7 @@ bool ValidateGetTexParameterBase(Context *context, return false; } - if (context->getTargetTexture(target) == nullptr) + if (context->getTextureByType(target) == nullptr) { // Should only be possible for external textures context->validationError(GL_INVALID_ENUM, kTextureNotBound); @@ -5559,7 +5559,7 @@ bool ValidateTexParameterBase(Context *context, return false; } - if (context->getTargetTexture(target) == nullptr) + if (context->getTextureByType(target) == nullptr) { // Should only be possible for external textures context->validationError(GL_INVALID_ENUM, kTextureNotBound); @@ -6262,7 +6262,7 @@ bool ValidateTexStorageMultisample(Context *context, return false; } - Texture *texture = context->getTargetTexture(target); + Texture *texture = context->getTextureByType(target); if (!texture || texture->id() == 0) { context->validationError(GL_INVALID_OPERATION, kZeroBoundToTarget); @@ -6319,7 +6319,7 @@ bool ValidateGetTexLevelParameterBase(Context *context, return false; } - if (context->getTargetTexture(type) == nullptr) + if (context->getTextureByType(type) == nullptr) { context->validationError(GL_INVALID_ENUM, kTextureNotBound); return false; diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp index 035ddff1c..29505a479 100644 --- a/src/libANGLE/validationES2.cpp +++ b/src/libANGLE/validationES2.cpp @@ -1203,7 +1203,7 @@ bool ValidateES2TexImageParameters(Context *context, return false; } - gl::Texture *texture = context->getTargetTexture(texType); + gl::Texture *texture = context->getTextureByType(texType); if (!texture) { context->validationError(GL_INVALID_OPERATION, kBufferNotBound); @@ -1905,7 +1905,7 @@ bool ValidateES2TexStorageParameters(Context *context, break; } - gl::Texture *texture = context->getTargetTexture(target); + gl::Texture *texture = context->getTextureByType(target); if (!texture || texture->id() == 0) { context->validationError(GL_INVALID_OPERATION, kMissingTexture); @@ -6225,7 +6225,7 @@ bool ValidateGenerateMipmap(Context *context, TextureType target) return false; } - Texture *texture = context->getTargetTexture(target); + Texture *texture = context->getTextureByType(target); if (texture == nullptr) { diff --git a/src/libANGLE/validationES3.cpp b/src/libANGLE/validationES3.cpp index a5750f2a7..bc1a39a5e 100644 --- a/src/libANGLE/validationES3.cpp +++ b/src/libANGLE/validationES3.cpp @@ -431,7 +431,7 @@ bool ValidateES3TexImageParametersBase(Context *context, return false; } - gl::Texture *texture = context->getTargetTexture(texType); + gl::Texture *texture = context->getTextureByType(texType); if (!texture) { context->validationError(GL_INVALID_OPERATION, kMissingTexture); @@ -1125,7 +1125,7 @@ bool ValidateES3TexStorageParametersBase(Context *context, return false; } - gl::Texture *texture = context->getTargetTexture(target); + gl::Texture *texture = context->getTextureByType(target); if (!texture || texture->id() == 0) { context->validationError(GL_INVALID_OPERATION, kMissingTexture); @@ -1995,7 +1995,7 @@ bool ValidateDrawBuffers(Context *context, GLsizei n, const GLenum *bufs) } bool ValidateCopyTexSubImage3D(Context *context, - TextureType target, + TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -2011,8 +2011,9 @@ bool ValidateCopyTexSubImage3D(Context *context, return false; } - return ValidateES3CopyTexImage3DParameters(context, target, level, GL_NONE, true, xoffset, - yoffset, zoffset, x, y, width, height, 0); + return ValidateES3CopyTexImage3DParameters(context, TextureTargetToType(target), level, GL_NONE, + true, xoffset, yoffset, zoffset, x, y, width, height, + 0); } bool ValidateCopyTexture3DANGLE(Context *context, @@ -2219,7 +2220,7 @@ bool ValidateTexImage3DRobustANGLE(Context *context, } bool ValidateTexSubImage3D(Context *context, - TextureType target, + TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -2237,13 +2238,13 @@ bool ValidateTexSubImage3D(Context *context, return false; } - return ValidateES3TexImage3DParameters(context, target, level, GL_NONE, false, true, xoffset, - yoffset, zoffset, width, height, depth, 0, format, type, - -1, pixels); + return ValidateES3TexImage3DParameters(context, TextureTargetToType(target), level, GL_NONE, + false, true, xoffset, yoffset, zoffset, width, height, + depth, 0, format, type, -1, pixels); } bool ValidateTexSubImage3DRobustANGLE(Context *context, - TextureType target, + TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -2267,13 +2268,13 @@ bool ValidateTexSubImage3DRobustANGLE(Context *context, return false; } - return ValidateES3TexImage3DParameters(context, target, level, GL_NONE, false, true, xoffset, - yoffset, zoffset, width, height, depth, 0, format, type, - bufSize, pixels); + return ValidateES3TexImage3DParameters(context, TextureTargetToType(target), level, GL_NONE, + false, true, xoffset, yoffset, zoffset, width, height, + depth, 0, format, type, bufSize, pixels); } bool ValidateCompressedTexSubImage3D(Context *context, - TextureType target, + TextureTarget target, GLint level, GLint xoffset, GLint yoffset, @@ -2311,9 +2312,9 @@ bool ValidateCompressedTexSubImage3D(Context *context, return false; } - if (!ValidateES3TexImage3DParameters(context, target, level, GL_NONE, true, true, xoffset, - yoffset, zoffset, width, height, depth, 0, format, GL_NONE, - -1, data)) + if (!ValidateES3TexImage3DParameters(context, TextureTargetToType(target), level, GL_NONE, true, + true, xoffset, yoffset, zoffset, width, height, depth, 0, + format, GL_NONE, -1, data)) { return false; } @@ -2328,7 +2329,7 @@ bool ValidateCompressedTexSubImage3D(Context *context, } bool ValidateCompressedTexSubImage3DRobustANGLE(Context *context, - TextureType target, + TextureTarget target, GLint level, GLint xoffset, GLint yoffset, diff --git a/src/libANGLE/validationES3_autogen.h b/src/libANGLE/validationES3_autogen.h index d2ba1fca3..6835852f6 100644 --- a/src/libANGLE/validationES3_autogen.h +++ b/src/libANGLE/validationES3_autogen.h @@ -63,7 +63,7 @@ bool ValidateCompressedTexImage3D(Context *context, GLsizei imageSize, const void *data); bool ValidateCompressedTexSubImage3D(Context *context, - TextureType targetPacked, + TextureTarget targetPacked, GLint level, GLint xoffset, GLint yoffset, @@ -81,7 +81,7 @@ bool ValidateCopyBufferSubData(Context *context, GLintptr writeOffset, GLsizeiptr size); bool ValidateCopyTexSubImage3D(Context *context, - TextureType targetPacked, + TextureTarget targetPacked, GLint level, GLint xoffset, GLint yoffset, @@ -269,7 +269,7 @@ bool ValidateTexStorage3D(Context *context, GLsizei height, GLsizei depth); bool ValidateTexSubImage3D(Context *context, - TextureType targetPacked, + TextureTarget targetPacked, GLint level, GLint xoffset, GLint yoffset, diff --git a/src/libANGLE/validationESEXT_autogen.h b/src/libANGLE/validationESEXT_autogen.h index b9ca49659..74ea07025 100644 --- a/src/libANGLE/validationESEXT_autogen.h +++ b/src/libANGLE/validationESEXT_autogen.h @@ -277,7 +277,7 @@ bool ValidateTexImage3DRobustANGLE(Context *context, GLsizei bufSize, const void *pixels); bool ValidateTexSubImage3DRobustANGLE(Context *context, - TextureType targetPacked, + TextureTarget targetPacked, GLint level, GLint xoffset, GLint yoffset, @@ -322,7 +322,7 @@ bool ValidateCompressedTexImage3DRobustANGLE(Context *context, GLsizei dataSize, const GLvoid *data); bool ValidateCompressedTexSubImage3DRobustANGLE(Context *context, - TextureType targetPacked, + TextureTarget targetPacked, GLint level, GLint xoffset, GLint yoffset, diff --git a/src/libGLESv2/entry_points_gles_3_0_autogen.cpp b/src/libGLESv2/entry_points_gles_3_0_autogen.cpp index c8d5eceb6..696ac1584 100644 --- a/src/libGLESv2/entry_points_gles_3_0_autogen.cpp +++ b/src/libGLESv2/entry_points_gles_3_0_autogen.cpp @@ -303,7 +303,7 @@ void GL_APIENTRY CompressedTexSubImage3D(GLenum target, Context *context = GetValidGlobalContext(); if (context) { - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateCompressedTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data)) @@ -361,7 +361,7 @@ void GL_APIENTRY CopyTexSubImage3D(GLenum target, Context *context = GetValidGlobalContext(); if (context) { - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateCopyTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, x, y, width, height)) @@ -1544,7 +1544,7 @@ void GL_APIENTRY TexSubImage3D(GLenum target, Context *context = GetValidGlobalContext(); if (context) { - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels)) diff --git a/src/libGLESv2/entry_points_gles_ext_autogen.cpp b/src/libGLESv2/entry_points_gles_ext_autogen.cpp index 4846ba4c2..55a755057 100644 --- a/src/libGLESv2/entry_points_gles_ext_autogen.cpp +++ b/src/libGLESv2/entry_points_gles_ext_autogen.cpp @@ -959,7 +959,7 @@ void GL_APIENTRY TexSubImage3DRobustANGLE(GLenum target, Context *context = GetValidGlobalContext(); if (context) { - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateTexSubImage3DRobustANGLE(context, targetPacked, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, @@ -1093,7 +1093,7 @@ void GL_APIENTRY CompressedTexSubImage3DRobustANGLE(GLenum target, Context *context = GetValidGlobalContext(); if (context) { - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateCompressedTexSubImage3DRobustANGLE(context, targetPacked, level, xoffset, yoffset, zoffset, width, height, depth, @@ -6462,7 +6462,7 @@ void GL_APIENTRY CompressedTexSubImage3DContextANGLE(GLeglContext ctx, if (context) { ASSERT(context == GetValidGlobalContext()); - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateCompressedTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data)) @@ -6585,7 +6585,7 @@ void GL_APIENTRY CopyTexSubImage3DContextANGLE(GLeglContext ctx, if (context) { ASSERT(context == GetValidGlobalContext()); - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateCopyTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, x, y, width, height)) @@ -14867,7 +14867,7 @@ void GL_APIENTRY TexSubImage3DContextANGLE(GLeglContext ctx, if (context) { ASSERT(context == GetValidGlobalContext()); - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateTexSubImage3D(context, targetPacked, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels)) @@ -17558,7 +17558,7 @@ void GL_APIENTRY TexSubImage3DRobustANGLEContextANGLE(GLeglContext ctx, if (context) { ASSERT(context == GetValidGlobalContext()); - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateTexSubImage3DRobustANGLE(context, targetPacked, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, @@ -17700,7 +17700,7 @@ void GL_APIENTRY CompressedTexSubImage3DRobustANGLEContextANGLE(GLeglContext ctx if (context) { ASSERT(context == GetValidGlobalContext()); - TextureType targetPacked = FromGLenum(target); + TextureTarget targetPacked = FromGLenum(target); if (context->skipValidation() || ValidateCompressedTexSubImage3DRobustANGLE(context, targetPacked, level, xoffset, yoffset, zoffset, width, height, depth,