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

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

Issue 1922633002: Implement TransformFeedbackManager in GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/context_state.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/context_state.cc
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc
index f91e8ccb9b1582e805a0ce9986b3954ba9768d96..6a2ae014b993626d98ab5a10b37c13eb73073b42 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -14,6 +14,7 @@
#include "gpu/command_buffer/service/framebuffer_manager.h"
#include "gpu/command_buffer/service/program_manager.h"
#include "gpu/command_buffer/service/renderbuffer_manager.h"
+#include "gpu/command_buffer/service/transform_feedback_manager.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_version_info.h"
@@ -293,6 +294,24 @@ void ContextState::RestoreProgramBindings() const {
glUseProgram(current_program.get() ? current_program->service_id() : 0);
}
+void ContextState::RestoreTransformFeedbackBindings(
+ const ContextState* prev_state) {
+ if (!feature_info_->IsES3Capable())
+ return;
+ if (prev_state) {
+ if (prev_state->bound_transform_feedback.get() &&
+ prev_state->bound_transform_feedback->active() &&
+ !prev_state->bound_transform_feedback->paused()) {
+ glPauseTransformFeedback();
+ }
+ }
+ if (bound_transform_feedback.get()) {
+ bound_transform_feedback->DoBindTransformFeedback(GL_TRANSFORM_FEEDBACK);
+ } else {
+ glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);
+ }
+}
+
void ContextState::RestoreActiveTexture() const {
glActiveTexture(GL_TEXTURE0 + active_texture_unit);
}
@@ -426,6 +445,7 @@ void ContextState::RestoreState(const ContextState* prev_state) {
RestoreBufferBindings();
RestoreRenderbufferBindings();
RestoreProgramBindings();
+ RestoreTransformFeedbackBindings(prev_state);
RestoreGlobalState(prev_state);
}
« no previous file with comments | « gpu/command_buffer/service/context_state.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698