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

Unified 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 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 a97879bdcc9443059501158ada04331afbb4e510..23eebecef9b4794ead34c3ac77bd982a0352b8bf 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -5239,10 +5239,20 @@ void GLES2DecoderImpl::DoBindTexture(GLenum target, GLuint client_id) {
return;
}
LogClientServiceForInfo(texture, client_id, "glBindTexture");
+ glBindTexture(target, texture->service_id());
if (texture->target() == 0) {
texture_manager()->SetTarget(texture_ref, target);
+ if (!feature_info_->gl_version_info().BehavesLikeGLES() &&
+ feature_info_->gl_version_info().IsAtLeastGL(3, 2)) {
+ // In Desktop GL core profile and GL ES, depth textures are always
+ // sampled to the RED channel, whereas on Desktop GL compatibility
+ // proifle, they are sampled to RED, LUMINANCE, INTENSITY, or ALPHA
+ // channel, depending on the DEPTH_TEXTURE_MODE value.
+ // In theory we only need to apply this for depth textures, but it is
+ // simpler to apply to all textures.
+ glTexParameteri(target, GL_DEPTH_TEXTURE_MODE, GL_RED);
+ }
}
- glBindTexture(target, texture->service_id());
} else {
glBindTexture(target, 0);
}
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698