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

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

Issue 182413006: Workaround Linux AMD driver bug where TEXTURE_MAX_ANISOTROPY init value is incorrect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rid of ppapi change Created 6 years, 9 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 <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 void DoGetProgramiv( 1258 void DoGetProgramiv(
1259 GLuint program_id, GLenum pname, GLint* params); 1259 GLuint program_id, GLenum pname, GLint* params);
1260 1260
1261 // Wrapper for glRenderbufferParameteriv. 1261 // Wrapper for glRenderbufferParameteriv.
1262 void DoGetRenderbufferParameteriv( 1262 void DoGetRenderbufferParameteriv(
1263 GLenum target, GLenum pname, GLint* params); 1263 GLenum target, GLenum pname, GLint* params);
1264 1264
1265 // Wrapper for glGetShaderiv 1265 // Wrapper for glGetShaderiv
1266 void DoGetShaderiv(GLuint shader, GLenum pname, GLint* params); 1266 void DoGetShaderiv(GLuint shader, GLenum pname, GLint* params);
1267 1267
1268 // Wrappers for glGetTexParameter.
1269 void DoGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
1270 void DoGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
1271 void InitTextureMaxAnisotropyIfNeeded(GLenum target, GLenum pname);
1272
1268 // Wrappers for glGetVertexAttrib. 1273 // Wrappers for glGetVertexAttrib.
1269 void DoGetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params); 1274 void DoGetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params);
1270 void DoGetVertexAttribiv(GLuint index, GLenum pname, GLint *params); 1275 void DoGetVertexAttribiv(GLuint index, GLenum pname, GLint *params);
1271 1276
1272 // Wrappers for glIsXXX functions. 1277 // Wrappers for glIsXXX functions.
1273 bool DoIsEnabled(GLenum cap); 1278 bool DoIsEnabled(GLenum cap);
1274 bool DoIsBuffer(GLuint client_id); 1279 bool DoIsBuffer(GLuint client_id);
1275 bool DoIsFramebuffer(GLuint client_id); 1280 bool DoIsFramebuffer(GLuint client_id);
1276 bool DoIsProgram(GLuint client_id); 1281 bool DoIsProgram(GLuint client_id);
1277 bool DoIsRenderbuffer(GLuint client_id); 1282 bool DoIsRenderbuffer(GLuint client_id);
(...skipping 5578 matching lines...) Expand 10 before | Expand all | Expand 10 after
6856 break; 6861 break;
6857 case GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 6862 case GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:
6858 *params = attrib->divisor(); 6863 *params = attrib->divisor();
6859 break; 6864 break;
6860 default: 6865 default:
6861 NOTREACHED(); 6866 NOTREACHED();
6862 break; 6867 break;
6863 } 6868 }
6864 } 6869 }
6865 6870
6871 void GLES2DecoderImpl::DoGetTexParameterfv(
6872 GLenum target, GLenum pname, GLfloat* params) {
6873 InitTextureMaxAnisotropyIfNeeded(target, pname);
6874 glGetTexParameterfv(target, pname, params);
6875 }
6876
6877 void GLES2DecoderImpl::DoGetTexParameteriv(
6878 GLenum target, GLenum pname, GLint* params) {
6879 InitTextureMaxAnisotropyIfNeeded(target, pname);
6880 glGetTexParameteriv(target, pname, params);
6881 }
6882
6883 void GLES2DecoderImpl::InitTextureMaxAnisotropyIfNeeded(
6884 GLenum target, GLenum pname) {
6885 if (!workarounds().init_texture_max_anisotropy)
6886 return;
6887 if (pname != GL_TEXTURE_MAX_ANISOTROPY_EXT ||
6888 !validators_->texture_parameter.IsValid(pname)) {
6889 return;
6890 }
6891
6892 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
6893 &state_, target);
6894 if (!texture_ref) {
6895 LOCAL_SET_GL_ERROR(
6896 GL_INVALID_OPERATION,
6897 "glGetTexParamter{fi}v", "unknown texture for target");
6898 return;
6899 }
6900 Texture* texture = texture_ref->texture();
6901 texture->InitTextureMaxAnisotropyIfNeeded(target);
6902 }
6903
6866 void GLES2DecoderImpl::DoGetVertexAttribfv( 6904 void GLES2DecoderImpl::DoGetVertexAttribfv(
6867 GLuint index, GLenum pname, GLfloat* params) { 6905 GLuint index, GLenum pname, GLfloat* params) {
6868 VertexAttrib* attrib = state_.vertex_attrib_manager->GetVertexAttrib(index); 6906 VertexAttrib* attrib = state_.vertex_attrib_manager->GetVertexAttrib(index);
6869 if (!attrib) { 6907 if (!attrib) {
6870 LOCAL_SET_GL_ERROR( 6908 LOCAL_SET_GL_ERROR(
6871 GL_INVALID_VALUE, "glGetVertexAttribfv", "index out of range"); 6909 GL_INVALID_VALUE, "glGetVertexAttribfv", "index out of range");
6872 return; 6910 return;
6873 } 6911 }
6874 switch (pname) { 6912 switch (pname) {
6875 case GL_CURRENT_VERTEX_ATTRIB: { 6913 case GL_CURRENT_VERTEX_ATTRIB: {
(...skipping 3669 matching lines...) Expand 10 before | Expand all | Expand 10 after
10545 DoDidUseTexImageIfNeeded(texture, texture->target()); 10583 DoDidUseTexImageIfNeeded(texture, texture->target());
10546 } 10584 }
10547 10585
10548 // Include the auto-generated part of this file. We split this because it means 10586 // Include the auto-generated part of this file. We split this because it means
10549 // we can easily edit the non-auto generated parts right here in this file 10587 // we can easily edit the non-auto generated parts right here in this file
10550 // instead of having to edit some template or the code generator. 10588 // instead of having to edit some template or the code generator.
10551 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10589 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10552 10590
10553 } // namespace gles2 10591 } // namespace gles2
10554 } // namespace gpu 10592 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698