Commit e4b753ca by Jamie Madill Committed by Commit Bot

Texture: Add helper to query desc from index.

BUG=angleproject:1635 Change-Id: I0e4b57119bf23d656446a5ded76ba2f62ea74d7f Reviewed-on: https://chromium-review.googlesource.com/469151 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent b8126691
......@@ -455,6 +455,11 @@ void TextureState::setImageDesc(GLenum target, size_t level, const ImageDesc &de
invalidateCompletenessCache();
}
const ImageDesc &TextureState::getImageDesc(const ImageIndex &imageIndex) const
{
return getImageDesc(imageIndex.type, imageIndex.mipIndex);
}
void TextureState::setImageDescChain(GLuint baseLevel,
GLuint maxLevel,
Extents baseSize,
......@@ -1235,12 +1240,12 @@ Error Texture::setEGLImageTarget(GLenum target, egl::Image *imageTarget)
Extents Texture::getAttachmentSize(const FramebufferAttachment::Target &target) const
{
return mState.getImageDesc(target.textureIndex().type, target.textureIndex().mipIndex).size;
return mState.getImageDesc(target.textureIndex()).size;
}
const Format &Texture::getAttachmentFormat(const FramebufferAttachment::Target &target) const
{
return getFormat(target.textureIndex().type, target.textureIndex().mipIndex);
return mState.getImageDesc(target.textureIndex()).format;
}
GLsizei Texture::getAttachmentSamples(const FramebufferAttachment::Target &target) const
......
......@@ -103,6 +103,7 @@ struct TextureState final : public angle::NonCopyable
void invalidateCompletenessCache();
const ImageDesc &getImageDesc(GLenum target, size_t level) const;
const ImageDesc &getImageDesc(const ImageIndex &imageIndex) const;
GLenum getTarget() const { return mTarget; }
const SwizzleState &getSwizzleState() const { return mSwizzleState; }
......
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