Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2548733002: Set correct internalformat info for TexStorageEXT for WebGL1 context (Closed)
Patch Set: add unittests Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 46dc8961d05d4aeb10b72cdd9b1fe1e984276946..2c68eb9576004072e41cbef637cc4cb6c537f995 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -16747,9 +16747,10 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target,
GLsizei level_height = height;
GLsizei level_depth = depth;
- GLenum adjusted_internal_format =
- feature_info_->context_type() == CONTEXT_TYPE_OPENGLES2 ?
- format : internal_format;
+ const bool is_es2 =
+ feature_info_->context_type() == CONTEXT_TYPE_OPENGLES2 ||
+ feature_info_->context_type() == CONTEXT_TYPE_WEBGL1;
qiankun 2016/12/02 10:10:38 You can use feature_info_->IsWebGL1OrES2Context()
dshwang 2016/12/02 17:54:20 Good point! Done.
+ GLenum adjusted_internal_format = is_es2 ? format : internal_format;
for (int ii = 0; ii < levels; ++ii) {
if (target == GL_TEXTURE_CUBE_MAP) {
for (int jj = 0; jj < 6; ++jj) {
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698