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

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

Issue 139013008: Implement support for rendering to 32-bit float textures on ES3 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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/texture_manager.cc
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 72d3b4c9681a51c7830d1dc3f1d303298889618a..e2a7896a82da030006a823c2796f2eb156d1f25d 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -1336,10 +1336,10 @@ bool TextureManager::ValidateTexImage2D(
error_state, function_name, args.target, "target");
return false;
}
- if (!validators->texture_format.IsValid(args.internal_format)) {
+ if (!validators->texture_internal_format.IsValid(args.internal_format)) {
ERRORSTATE_SET_GL_ERROR_INVALID_ENUM(
error_state, function_name, args.internal_format,
- "internal_format");
+ "internalformat");
return false;
}
if (!validators->texture_format.IsValid(args.format)) {
@@ -1352,10 +1352,12 @@ bool TextureManager::ValidateTexImage2D(
error_state, function_name, args.type, "type");
return false;
}
- if (args.format != args.internal_format) {
+ if (args.format != args.internal_format &&
+ !((args.internal_format == GL_RGBA32F && args.format == GL_RGBA) ||
+ (args.internal_format == GL_RGB32F && args.format == GL_RGB))) {
ERRORSTATE_SET_GL_ERROR(
error_state, GL_INVALID_OPERATION, function_name,
- "format != internalFormat");
+ "format != internalformat");
return false;
}
if (!ValidateTextureParameters(
@@ -1396,7 +1398,7 @@ bool TextureManager::ValidateTexImage2D(
// They both use the same MemoryTracker, and this call just re-routes
// to it.
if (!memory_tracker_managed_->EnsureGPUMemoryAvailable(args.pixels_size)) {
- ERRORSTATE_SET_GL_ERROR(error_state, GL_OUT_OF_MEMORY, "glTexImage2D",
+ ERRORSTATE_SET_GL_ERROR(error_state, GL_OUT_OF_MEMORY, function_name,
"out of memory");
return false;
}

Powered by Google App Engine
This is Rietveld 408576698