Commit 041e24cc authored by Kristian H. Kristensen's avatar Kristian H. Kristensen Committed by Commit Bot

gpu: Clean up GLES2DecoderImpl::TexStorageImpl a little

CL https://codereview.chromium.org/1872663002 used level_size as a
std::vector<int32_t> initially, but after a few rounds of review was
rewritten to only use it as a int32_t temporary variable. Drop the
std::vector use, and move it closer to the single remaining use.

Change-Id: I53dabcf823514374676a7f1dc95c32e3b761a594
Reviewed-on: https://chromium-review.googlesource.com/847965Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526569}
parent 108dce43
......@@ -17901,7 +17901,6 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target,
internal_format);
GLenum type = TextureManager::ExtractTypeFromStorageFormat(internal_format);
std::vector<int32_t> level_size(levels);
{
GLsizei level_width = width;
GLsizei level_height = height;
......@@ -17912,13 +17911,14 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target,
for (int ii = 0; ii < levels; ++ii) {
uint32_t size;
if (is_compressed_format) {
GLsizei level_size;
if (!GetCompressedTexSizeInBytes(function_name,
level_width, level_height, level_depth,
internal_format, &level_size[ii])) {
internal_format, &level_size)) {
// GetCompressedTexSizeInBytes() already generates a GL error.
return;
}
size = static_cast<uint32_t>(level_size[ii]);
size = static_cast<uint32_t>(level_size);
} else {
if (!GLES2Util::ComputeImageDataSizesES3(level_width,
level_height,
......
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