Commit 165361ca by JiangYizhou Committed by Commit Bot

Entry point refactoring

Refactor texStorage2D and texStorage3D. BUG=angleproject:747 Change-Id: Id5ab6bbff5ce6debc84318e28b12683bf8b106b1 Reviewed-on: https://chromium-review.googlesource.com/526371 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 5ea762a6
......@@ -4114,6 +4114,29 @@ void Context::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGr
mImplementation->dispatchCompute(numGroupsX, numGroupsY, numGroupsZ);
}
void Context::texStorage2D(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height)
{
Extents size(width, height, 1);
Texture *texture = getTargetTexture(target);
handleError(texture->setStorage(this, target, levels, internalFormat, size));
}
void Context::texStorage3D(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth)
{
Extents size(width, height, depth);
Texture *texture = getTargetTexture(target);
handleError(texture->setStorage(this, target, levels, internalFormat, size));
}
GLenum Context::checkFramebufferStatus(GLenum target)
{
Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
......
......@@ -781,6 +781,18 @@ class Context final : public ValidationContext
template <EntryPoint EP, typename... ParamsT>
void gatherParams(ParamsT &&... params);
void texStorage2D(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height);
void texStorage3D(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth);
private:
void syncRendererState();
void syncRendererState(const State::DirtyBits &bitMask, const State::DirtyObjects &objectMask);
......
......@@ -670,14 +670,7 @@ TexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei wi
return;
}
Extents size(width, height, 1);
Texture *texture = context->getTargetTexture(target);
Error error = texture->setStorage(context, target, levels, internalformat, size);
if (error.isError())
{
context->handleError(error);
return;
}
context->texStorage2D(target, levels, internalformat, width, height);
}
}
......
......@@ -2447,14 +2447,7 @@ TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width
return;
}
Extents size(width, height, 1);
Texture *texture = context->getTargetTexture(target);
Error error = texture->setStorage(context, target, levels, internalformat, size);
if (error.isError())
{
context->handleError(error);
return;
}
context->texStorage2D(target, levels, internalformat, width, height);
}
}
......@@ -2486,14 +2479,7 @@ void GL_APIENTRY TexStorage3D(GLenum target,
return;
}
Extents size(width, height, depth);
Texture *texture = context->getTargetTexture(target);
Error error = texture->setStorage(context, target, levels, internalformat, size);
if (error.isError())
{
context->handleError(error);
return;
}
context->texStorage3D(target, levels, internalformat, width, height, depth);
}
}
......
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