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

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

Issue 2080943002: gpu: Use a VAO as required by the core profile in ClearFramebuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_clear_framebuffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_clear_framebuffer.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_clear_framebuffer.cc b/gpu/command_buffer/service/gles2_cmd_clear_framebuffer.cc
index 6a21c49fd9a05c5f9b8afb82cb66e26a3efa1024..de5e47bb979373c08af7d4e418ec00cc678db5c0 100644
--- a/gpu/command_buffer/service/gles2_cmd_clear_framebuffer.cc
+++ b/gpu/command_buffer/service/gles2_cmd_clear_framebuffer.cc
@@ -73,6 +73,8 @@ void ClearFramebufferResourceManager::Initialize(
"kVertexPositionAttrib must be 0");
DCHECK(!buffer_id_);
+ glGenVertexArraysOES(1, &vao_);
Zhenyao Mo 2016/06/20 21:16:20 initialize vao_ to 0 in constructor. and dcheck it
+
glGenBuffersARB(1, &buffer_id_);
glBindBuffer(GL_ARRAY_BUFFER, buffer_id_);
const GLfloat kQuadVertices[] = {-1.0f, -1.0f,
@@ -90,6 +92,7 @@ void ClearFramebufferResourceManager::Destroy() {
return;
glDeleteProgram(program_);
+ glDeleteVertexArraysOES(1, &vao_);
Zhenyao Mo 2016/06/20 21:16:20 Also set vao_ to 0 like buffer_id_
glDeleteBuffersARB(1, &buffer_id_);
buffer_id_ = 0;
}
@@ -140,7 +143,7 @@ void ClearFramebufferResourceManager::ClearFramebuffer(
DLOG(ERROR) << "Invalid shader.";
#endif
- decoder->ClearAllAttributes();
+ glBindVertexArrayOES(vao_);
glEnableVertexAttribArray(kVertexPositionAttrib);
Zhenyao Mo 2016/06/20 21:16:20 Shouldn't you also set all the vao states up in In
glBindBuffer(GL_ARRAY_BUFFER, buffer_id_);
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_clear_framebuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698