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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.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_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 35f446c720f89f2752691a06f5e8eb770fafe581..a41e41cd6866523232dec1a32cbd5f6f25d57919 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -13023,9 +13023,9 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
GLint destX = dx;
GLint destY = dy;
if (requires_luma_blit) {
- copy_tex_image_blit_->DoCopyTexSubImage2DToLUMAComatabilityTexture(
+ copy_tex_image_blit_->DoCopyTexSubImageToLUMAComatabilityTexture(
this, texture->service_id(), texture->target(), target, format,
- type, level, destX, destY, copyX, copyY, copyWidth, copyHeight,
+ type, level, destX, destY, 0, copyX, copyY, copyWidth, copyHeight,
framebuffer_state_.bound_read_framebuffer->service_id(),
framebuffer_state_.bound_read_framebuffer
->GetReadBufferInternalFormat());
@@ -13199,9 +13199,10 @@ void GLES2DecoderImpl::DoCopyTexSubImage2D(
if (!InitializeCopyTexImageBlitter("glCopyTexSubImage2D")) {
return;
}
- copy_tex_image_blit_->DoCopyTexSubImage2DToLUMAComatabilityTexture(
+ copy_tex_image_blit_->DoCopyTexSubImageToLUMAComatabilityTexture(
this, texture->service_id(), texture->target(), target,
- internal_format, type, level, xoffset, yoffset, x, y, width, height,
+ internal_format, type, level, xoffset, yoffset, 0,
+ x, y, width, height,
framebuffer_state_.bound_read_framebuffer->service_id(),
framebuffer_state_.bound_read_framebuffer
->GetReadBufferInternalFormat());
@@ -13289,12 +13290,23 @@ void GLES2DecoderImpl::DoCopyTexSubImage3D(
DCHECK(texture->IsLevelCleared(target, level));
}
- // TODO(yunchao): Follow-up CLs are necessary. For instance:
- // 1. emulation of unsized formats in core profile
-
if (copyHeight > 0 && copyWidth > 0) {
- glCopyTexSubImage3D(target, level, destX, destY, zoffset,
- copyX, copyY, copyWidth, copyHeight);
+ if (CopyTexImageResourceManager::CopyTexImageRequiresBlit(
+ feature_info_.get(), internal_format)) {
+ if (!InitializeCopyTexImageBlitter(func_name)) {
+ return;
+ }
+ copy_tex_image_blit_->DoCopyTexSubImageToLUMAComatabilityTexture(
+ this, texture->service_id(), texture->target(), target,
+ internal_format, type, level, xoffset, yoffset, zoffset,
+ x, y, width, height,
piman 2016/08/17 16:47:27 Should this be destX/destY/copyX/copyY/copyWidth/c
yunchao 2016/08/22 14:57:20 Done.
+ framebuffer_state_.bound_read_framebuffer->service_id(),
+ framebuffer_state_.bound_read_framebuffer
+ ->GetReadBufferInternalFormat());
+ } else {
+ glCopyTexSubImage3D(target, level, destX, destY, zoffset,
+ copyX, copyY, copyWidth, copyHeight);
+ }
}
// This may be a slow command. Exit command processing to allow for

Powered by Google App Engine
This is Rietveld 408576698