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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
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 03a2a4fdad2bf1a201aca6c4808f7735a2b640cb..e7d50e68097fafc368942bc8363289375303b730 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9270,6 +9270,23 @@ void GLES2DecoderImpl::GetTexParameterImpl(
return;
}
break;
+ // Get the level information from the texture to avoid a Mac driver
+ // bug where they store the levels in int16_t, making values bigger
+ // 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,
+ case GL_TEXTURE_BASE_LEVEL:
+ if (fparams) {
+ fparams[0] = static_cast<GLfloat>(texture->base_level());
+ } else {
+ iparams[0] = texture->base_level();
+ }
+ return;
+ case GL_TEXTURE_MAX_LEVEL:
+ if (fparams) {
+ fparams[0] = static_cast<GLfloat>(texture->max_level());
+ } else {
+ iparams[0] = texture->max_level();
+ }
+ return;
default:
break;
}
« 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