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

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

Issue 1412613004: Set attachment for bound framebuffer in FramebufferTextureLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix WebGLTextureAttachment::attach Created 5 years, 2 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 c8ffe3aefc86438c5095093c8539a25325b3e31b..774eb0b388be8c29e0bd4c404e1c835de83f63c1 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -6445,9 +6445,16 @@ void GLES2DecoderImpl::DoFramebufferTexture2DCommon(
void GLES2DecoderImpl::DoFramebufferTextureLayer(
GLenum target, GLenum attachment, GLuint client_texture_id,
GLint level, GLint layer) {
- // TODO(zmo): Unsafe ES3 API, missing states update.
+ // TODO(zmo): Add full validation.
GLuint service_id = 0;
TextureRef* texture_ref = NULL;
+ Framebuffer* framebuffer = GetFramebufferInfoForTarget(target);
+ if (!framebuffer) {
+ LOCAL_SET_GL_ERROR(
+ GL_INVALID_OPERATION,
+ "glFramebufferTextureLayer", "no framebuffer bound.");
+ return;
+ }
if (client_texture_id) {
texture_ref = GetTexture(client_texture_id);
if (!texture_ref) {
@@ -6458,7 +6465,14 @@ void GLES2DecoderImpl::DoFramebufferTextureLayer(
}
service_id = texture_ref->service_id();
}
+ LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glFramebufferTextureLayer");
glFramebufferTextureLayer(target, attachment, service_id, level, layer);
+ GLenum error = LOCAL_PEEK_GL_ERROR("glFramebufferTextureLayer");
+ if (error == GL_NO_ERROR) {
+ framebuffer->AttachTextureLayer(attachment, texture_ref,
+ texture_ref ? texture_ref->texture()->target() : 0,
+ level, layer);
+ }
}
void GLES2DecoderImpl::DoGetFramebufferAttachmentParameteriv(
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698