Chromium Code Reviews| 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; |
| } |