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

Unified Diff: gpu/command_buffer/service/texture_manager.cc

Issue 2865233002: Generate INVALID_OPERATION when depth/stencil textures are specified using targets other than TEXTU… (Closed)
Patch Set: Created 3 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
« no previous file with comments | « content/test/gpu/gpu_tests/webgl_conformance_revision.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_manager.cc
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index b4fa9fc48bcd7a14fcbc495f263f0eef5a450311..aeaf9717109cd35331ade99119d7159d2ecdbf2f 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -2455,6 +2455,21 @@ bool TextureManager::ValidateTexImage(
error_state, function_name, args.target, "target");
return false;
}
+ if (feature_info_->IsWebGL1OrES2Context()) {
+ switch (args.format) {
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_STENCIL:
+ if (args.target != GL_TEXTURE_2D) {
+ ERRORSTATE_SET_GL_ERROR(
+ error_state, GL_INVALID_OPERATION, function_name,
+ "invalid target for depth/stencil textures");
+ return false;
+ }
+ break;
+ default:
+ break;
+ }
+ }
if (!ValidateTextureParameters(
error_state, function_name, true, args.format, args.type,
args.internal_format, args.level)) {
« no previous file with comments | « content/test/gpu/gpu_tests/webgl_conformance_revision.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698