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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2019453003: command_buffer: MAX/BASE_LEVEL fixes for GetTexParameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 9252 matching lines...) Expand 10 before | Expand all | Expand 10 after
9263 if (feature_info_->gl_version_info().IsLowerThanGL(4, 2)) { 9263 if (feature_info_->gl_version_info().IsLowerThanGL(4, 2)) {
9264 GLint levels = texture->GetImmutableLevels(); 9264 GLint levels = texture->GetImmutableLevels();
9265 if (fparams) { 9265 if (fparams) {
9266 fparams[0] = static_cast<GLfloat>(levels); 9266 fparams[0] = static_cast<GLfloat>(levels);
9267 } else { 9267 } else {
9268 iparams[0] = levels; 9268 iparams[0] = levels;
9269 } 9269 }
9270 return; 9270 return;
9271 } 9271 }
9272 break; 9272 break;
9273 // Get the level information from the texture to avoid a Mac driver
9274 // bug where they store the levels in int16_t, making values bigger
9275 // than 2^15-1 overflow in the negative range.
Zhenyao Mo 2016/05/27 22:33:44 Could you put this code behind a workaround? say,
9276 case GL_TEXTURE_BASE_LEVEL:
9277 if (fparams) {
9278 fparams[0] = static_cast<GLfloat>(texture->base_level());
9279 } else {
9280 iparams[0] = texture->base_level();
9281 }
9282 return;
9283 case GL_TEXTURE_MAX_LEVEL:
9284 if (fparams) {
9285 fparams[0] = static_cast<GLfloat>(texture->max_level());
9286 } else {
9287 iparams[0] = texture->max_level();
9288 }
9289 return;
9273 default: 9290 default:
9274 break; 9291 break;
9275 } 9292 }
9276 if (fparams) { 9293 if (fparams) {
9277 glGetTexParameterfv(target, pname, fparams); 9294 glGetTexParameterfv(target, pname, fparams);
9278 } else { 9295 } else {
9279 glGetTexParameteriv(target, pname, iparams); 9296 glGetTexParameteriv(target, pname, iparams);
9280 } 9297 }
9281 } 9298 }
9282 9299
(...skipping 7542 matching lines...) Expand 10 before | Expand all | Expand 10 after
16825 } 16842 }
16826 16843
16827 // Include the auto-generated part of this file. We split this because it means 16844 // Include the auto-generated part of this file. We split this because it means
16828 // we can easily edit the non-auto generated parts right here in this file 16845 // we can easily edit the non-auto generated parts right here in this file
16829 // instead of having to edit some template or the code generator. 16846 // instead of having to edit some template or the code generator.
16830 #include "base/macros.h" 16847 #include "base/macros.h"
16831 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 16848 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
16832 16849
16833 } // namespace gles2 16850 } // namespace gles2
16834 } // namespace gpu 16851 } // namespace gpu
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/webgl2_conformance_expectations.py ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698