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

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

Issue 6749014: Workground for glGenerateMipmap bug in some drivers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after
2849 } 2849 }
2850 } 2850 }
2851 2851
2852 void GLES2DecoderImpl::DoGenerateMipmap(GLenum target) { 2852 void GLES2DecoderImpl::DoGenerateMipmap(GLenum target) {
2853 TextureManager::TextureInfo* info = GetTextureInfoForTarget(target); 2853 TextureManager::TextureInfo* info = GetTextureInfoForTarget(target);
2854 if (!info || !texture_manager()->MarkMipmapsGenerated(feature_info_, info)) { 2854 if (!info || !texture_manager()->MarkMipmapsGenerated(feature_info_, info)) {
2855 SetGLError(GL_INVALID_OPERATION, 2855 SetGLError(GL_INVALID_OPERATION,
2856 "glGenerateMipmaps: Can not generate mips for npot textures"); 2856 "glGenerateMipmaps: Can not generate mips for npot textures");
2857 return; 2857 return;
2858 } 2858 }
2859 // Workaround for Mac driver bug. Since glGenerateMipmap is not a high
apatrick_chromium 2011/03/25 21:53:26 I might expect it to be high performance if I was
2860 // performance function there's no need to make this conditional.
2861 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR);
2859 glGenerateMipmapEXT(target); 2862 glGenerateMipmapEXT(target);
2863 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, info->min_filter());
2860 } 2864 }
2861 2865
2862 bool GLES2DecoderImpl::GetHelper( 2866 bool GLES2DecoderImpl::GetHelper(
2863 GLenum pname, GLint* params, GLsizei* num_written) { 2867 GLenum pname, GLint* params, GLsizei* num_written) {
2864 DCHECK(num_written); 2868 DCHECK(num_written);
2865 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { 2869 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) {
2866 switch (pname) { 2870 switch (pname) {
2867 case GL_IMPLEMENTATION_COLOR_READ_FORMAT: 2871 case GL_IMPLEMENTATION_COLOR_READ_FORMAT:
2868 *num_written = 1; 2872 *num_written = 1;
2869 if (params) { 2873 if (params) {
(...skipping 3514 matching lines...) Expand 10 before | Expand all | Expand 10 after
6384 return error::kNoError; 6388 return error::kNoError;
6385 } 6389 }
6386 6390
6387 // Include the auto-generated part of this file. We split this because it means 6391 // Include the auto-generated part of this file. We split this because it means
6388 // we can easily edit the non-auto generated parts right here in this file 6392 // we can easily edit the non-auto generated parts right here in this file
6389 // instead of having to edit some template or the code generator. 6393 // instead of having to edit some template or the code generator.
6390 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 6394 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
6391 6395
6392 } // namespace gles2 6396 } // namespace gles2
6393 } // namespace gpu 6397 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698