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

Unified 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, 10 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 394479dfd5dfcf2cb6b37d2cc8b819335b89a27b..855561765f62fe8133431a78248fc0b14a9c4c21 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1265,6 +1265,11 @@ class GLES2DecoderImpl : public GLES2Decoder,
// Wrapper for glGetShaderiv
void DoGetShaderiv(GLuint shader, GLenum pname, GLint* params);
+ // Wrappers for glGetTexParameter.
+ void DoGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
+ void DoGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
+ void InitTextureMaxAnisotropyIfNeeded(GLenum target, GLenum pname);
+
// Wrappers for glGetVertexAttrib.
void DoGetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params);
void DoGetVertexAttribiv(GLuint index, GLenum pname, GLint *params);
@@ -6863,6 +6868,39 @@ void GLES2DecoderImpl::GetVertexAttribHelper(
}
}
+void GLES2DecoderImpl::DoGetTexParameterfv(
+ GLenum target, GLenum pname, GLfloat* params) {
+ InitTextureMaxAnisotropyIfNeeded(target, pname);
+ glGetTexParameterfv(target, pname, params);
+}
+
+void GLES2DecoderImpl::DoGetTexParameteriv(
+ GLenum target, GLenum pname, GLint* params) {
+ InitTextureMaxAnisotropyIfNeeded(target, pname);
+ glGetTexParameteriv(target, pname, params);
+}
+
+void GLES2DecoderImpl::InitTextureMaxAnisotropyIfNeeded(
+ GLenum target, GLenum pname) {
+ if (!workarounds().init_texture_max_anisotropy)
+ return;
+ if (pname != GL_TEXTURE_MAX_ANISOTROPY_EXT ||
+ !validators_->texture_parameter.IsValid(pname)) {
+ return;
+ }
+
+ TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
+ &state_, target);
+ if (!texture_ref) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_OPERATION,
+ "glGetTexParamter{fi}v", "unknown texture for target");
+ return;
+ }
+ Texture* texture = texture_ref->texture();
+ texture->InitTextureMaxAnisotropyIfNeeded(target);
+}
+
void GLES2DecoderImpl::DoGetVertexAttribfv(
GLuint index, GLenum pname, GLfloat* params) {
VertexAttrib* attrib = state_.vertex_attrib_manager->GetVertexAttrib(index);
« 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