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

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

Issue 2241593003: [Command buffer] CopyTexSubImage3D: emulate unsized format in desktop core profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [Command buffer] CopyTexSubImage3D: emulate unsized format in core profile Created 4 years, 4 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_copy_tex_image.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_copy_tex_image.cc b/gpu/command_buffer/service/gles2_cmd_copy_tex_image.cc
index b9e61300d46424e7b465aae098348904b062877d..5d4e20a05a439aa500b082dd409af0f89bf8c01b 100644
--- a/gpu/command_buffer/service/gles2_cmd_copy_tex_image.cc
+++ b/gpu/command_buffer/service/gles2_cmd_copy_tex_image.cc
@@ -162,13 +162,13 @@ void CopyTexImageResourceManager::DoCopyTexImage2DToLUMAComatabilityTexture(
feature_info_.get(), internal_format);
glTexImage2D(dest_target, level, adjusted_internal_format, width, height, 0,
adjusted_format, luma_type, nullptr);
- DoCopyTexSubImage2DToLUMAComatabilityTexture(
+ DoCopyTexSubImageToLUMAComatabilityTexture(
decoder, dest_texture, dest_texture_target, dest_target, luma_format,
- luma_type, level, 0, 0, x, y, width, height, source_framebuffer,
+ luma_type, level, 0, 0, 0, x, y, width, height, source_framebuffer,
source_framebuffer_internal_format);
}
-void CopyTexImageResourceManager::DoCopyTexSubImage2DToLUMAComatabilityTexture(
+void CopyTexImageResourceManager::DoCopyTexSubImageToLUMAComatabilityTexture(
const gles2::GLES2Decoder* decoder,
GLuint dest_texture,
GLenum dest_texture_target,
@@ -178,6 +178,7 @@ void CopyTexImageResourceManager::DoCopyTexSubImage2DToLUMAComatabilityTexture(
GLint level,
GLint xoffset,
GLint yoffset,
+ GLint zoffset,
GLint x,
GLint y,
GLsizei width,
@@ -241,8 +242,13 @@ void CopyTexImageResourceManager::DoCopyTexSubImage2DToLUMAComatabilityTexture(
// Finally, copy the swizzled texture to the destination texture
glBindTexture(dest_texture_target, dest_texture);
- glCopyTexSubImage2D(dest_target, level, xoffset, yoffset, 0, 0, width,
- height);
+ if (dest_target == GL_TEXTURE_3D || dest_target == GL_TEXTURE_2D_ARRAY) {
+ glCopyTexSubImage3D(dest_target, level, xoffset, yoffset, zoffset,
+ 0, 0, width, height);
+ } else {
+ glCopyTexSubImage2D(dest_target, level, xoffset, yoffset,
+ 0, 0, width, height);
+ }
// Restore state
decoder->RestoreAllAttributes();

Powered by Google App Engine
This is Rietveld 408576698