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

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

Issue 1988303002: Fix depth texture sampling on compatibility profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | 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) 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 <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 5221 matching lines...) Expand 10 before | Expand all | Expand 10 after
5232 if (texture_ref) { 5232 if (texture_ref) {
5233 Texture* texture = texture_ref->texture(); 5233 Texture* texture = texture_ref->texture();
5234 // Check that we are not trying to bind it to a different target. 5234 // Check that we are not trying to bind it to a different target.
5235 if (texture->target() != 0 && texture->target() != target) { 5235 if (texture->target() != 0 && texture->target() != target) {
5236 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, 5236 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
5237 "glBindTexture", 5237 "glBindTexture",
5238 "texture bound to more than 1 target."); 5238 "texture bound to more than 1 target.");
5239 return; 5239 return;
5240 } 5240 }
5241 LogClientServiceForInfo(texture, client_id, "glBindTexture"); 5241 LogClientServiceForInfo(texture, client_id, "glBindTexture");
5242 glBindTexture(target, texture->service_id());
5242 if (texture->target() == 0) { 5243 if (texture->target() == 0) {
5243 texture_manager()->SetTarget(texture_ref, target); 5244 texture_manager()->SetTarget(texture_ref, target);
5245 if (!feature_info_->gl_version_info().BehavesLikeGLES()) {
5246 // We only need to do it for DEPTH textures on GL with compatibility
5247 // profile, but this is simpler.
5248 glTexParameteri(target, GL_DEPTH_TEXTURE_MODE, GL_RED);
5249 }
piman 2016/05/18 21:00:15 Can you explain to me why this is needed and what
5244 } 5250 }
5245 glBindTexture(target, texture->service_id());
5246 } else { 5251 } else {
5247 glBindTexture(target, 0); 5252 glBindTexture(target, 0);
5248 } 5253 }
5249 5254
5250 TextureUnit& unit = state_.texture_units[state_.active_texture_unit]; 5255 TextureUnit& unit = state_.texture_units[state_.active_texture_unit];
5251 unit.bind_target = target; 5256 unit.bind_target = target;
5252 unit.GetInfoForTarget(target) = texture_ref; 5257 unit.GetInfoForTarget(target) = texture_ref;
5253 } 5258 }
5254 5259
5255 void GLES2DecoderImpl::DoBindSampler(GLuint unit, GLuint client_id) { 5260 void GLES2DecoderImpl::DoBindSampler(GLuint unit, GLuint client_id) {
(...skipping 11529 matching lines...) Expand 10 before | Expand all | Expand 10 after
16785 } 16790 }
16786 16791
16787 // Include the auto-generated part of this file. We split this because it means 16792 // Include the auto-generated part of this file. We split this because it means
16788 // we can easily edit the non-auto generated parts right here in this file 16793 // we can easily edit the non-auto generated parts right here in this file
16789 // instead of having to edit some template or the code generator. 16794 // instead of having to edit some template or the code generator.
16790 #include "base/macros.h" 16795 #include "base/macros.h"
16791 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 16796 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
16792 16797
16793 } // namespace gles2 16798 } // namespace gles2
16794 } // namespace gpu 16799 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698