OLD | NEW |
---|---|
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 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3001 | 3001 |
3002 void GLES2DecoderImpl::DoGenerateMipmap(GLenum target) { | 3002 void GLES2DecoderImpl::DoGenerateMipmap(GLenum target) { |
3003 TextureManager::TextureInfo* info = GetTextureInfoForTarget(target); | 3003 TextureManager::TextureInfo* info = GetTextureInfoForTarget(target); |
3004 if (!info || !texture_manager()->MarkMipmapsGenerated(feature_info_, info)) { | 3004 if (!info || !texture_manager()->MarkMipmapsGenerated(feature_info_, info)) { |
3005 SetGLError(GL_INVALID_OPERATION, | 3005 SetGLError(GL_INVALID_OPERATION, |
3006 "glGenerateMipmaps: Can not generate mips for npot textures"); | 3006 "glGenerateMipmaps: Can not generate mips for npot textures"); |
3007 return; | 3007 return; |
3008 } | 3008 } |
3009 // Workaround for Mac driver bug. In the large scheme of things setting | 3009 // Workaround for Mac driver bug. In the large scheme of things setting |
3010 // glTexParamter twice for glGenerateMipmap is probably not a lage performance | 3010 // glTexParamter twice for glGenerateMipmap is probably not a lage performance |
3011 // hit so there's probably no need to make this conditional. | 3011 // hit so there's probably no need to make this conditional. The bug appears |
3012 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR); | 3012 // to be that if the filtering mode is set to something that doesn't require |
3013 // mipmaps for rendering, or is never set to something other than the default, | |
3014 // then glGenerateMipmap misbehaves. | |
3015 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); | |
greggman
2011/10/20 23:27:37
It seems like there are 2 possibliies
1) The stat
Ken Russell (switch to Gerrit)
2011/10/20 23:36:24
I believe it's neither, but a third possibility: t
| |
3013 glGenerateMipmapEXT(target); | 3016 glGenerateMipmapEXT(target); |
3014 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, info->min_filter()); | 3017 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, info->min_filter()); |
3015 } | 3018 } |
3016 | 3019 |
3017 bool GLES2DecoderImpl::GetHelper( | 3020 bool GLES2DecoderImpl::GetHelper( |
3018 GLenum pname, GLint* params, GLsizei* num_written) { | 3021 GLenum pname, GLint* params, GLsizei* num_written) { |
3019 DCHECK(num_written); | 3022 DCHECK(num_written); |
3020 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { | 3023 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { |
3021 switch (pname) { | 3024 switch (pname) { |
3022 case GL_IMPLEMENTATION_COLOR_READ_FORMAT: | 3025 case GL_IMPLEMENTATION_COLOR_READ_FORMAT: |
(...skipping 4179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7202 return error::kNoError; | 7205 return error::kNoError; |
7203 } | 7206 } |
7204 | 7207 |
7205 // Include the auto-generated part of this file. We split this because it means | 7208 // Include the auto-generated part of this file. We split this because it means |
7206 // we can easily edit the non-auto generated parts right here in this file | 7209 // we can easily edit the non-auto generated parts right here in this file |
7207 // instead of having to edit some template or the code generator. | 7210 // instead of having to edit some template or the code generator. |
7208 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 7211 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
7209 | 7212 |
7210 } // namespace gles2 | 7213 } // namespace gles2 |
7211 } // namespace gpu | 7214 } // namespace gpu |
OLD | NEW |