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

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: addressed zmo@'s feedback 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 aa3adba67e7b71a11b3ece250506d2d52e037fdd..b26d3353aaefac554784cbe5772ed6170c8dba29 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::DoCopyTexImage2DToLUMACompatibilityTexture(
feature_info_.get(), internal_format);
glTexImage2D(dest_target, level, adjusted_internal_format, width, height, 0,
adjusted_format, luma_type, nullptr);
- DoCopyTexSubImage2DToLUMACompatibilityTexture(
+ DoCopyTexSubImageToLUMACompatibilityTexture(
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::DoCopyTexSubImage2DToLUMACompatibilityTexture(
+void CopyTexImageResourceManager::DoCopyTexSubImageToLUMACompatibilityTexture(
const gles2::GLES2Decoder* decoder,
GLuint dest_texture,
GLenum dest_texture_target,
@@ -178,6 +178,7 @@ void CopyTexImageResourceManager::DoCopyTexSubImage2DToLUMACompatibilityTexture(
GLint level,
GLint xoffset,
GLint yoffset,
+ GLint zoffset,
GLint x,
GLint y,
GLsizei width,
@@ -241,8 +242,13 @@ void CopyTexImageResourceManager::DoCopyTexSubImage2DToLUMACompatibilityTexture(
// 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();
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_copy_tex_image.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698