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

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: more validations and fix gpu_unittests 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..4be94e390f78e61d8dcded09071ef85b146971ce 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,13 @@ 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()->target(), level, layer);
+ }
}
void GLES2DecoderImpl::DoGetFramebufferAttachmentParameteriv(

Powered by Google App Engine
This is Rietveld 408576698