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

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

Issue 2410023002: Revert of Add gl tests to make sure when a buffer is unmapped, all access path generates an ... (Closed)
Patch Set: Created 4 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
« no previous file with comments | « gpu/BUILD.gn ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4992b1248d0340f8b8770fc24223270c959b91c5..eff0f4c45ca9c601fc3678e146d1ac459cbf0c5d 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3923,6 +3923,7 @@
if (buffer && !buffer->IsDeleted()) {
buffer->RemoveMappedRange();
state_.RemoveBoundBuffer(buffer);
+ transform_feedback_manager_->RemoveBoundBuffer(buffer);
RemoveBuffer(client_id);
}
}
@@ -5701,46 +5702,13 @@
void GLES2DecoderImpl::DoBeginTransformFeedback(GLenum primitive_mode) {
const char* function_name = "glBeginTransformFeedback";
- TransformFeedback* transform_feedback = state_.bound_transform_feedback.get();
- DCHECK(transform_feedback);
- if (transform_feedback->active()) {
+ DCHECK(state_.bound_transform_feedback.get());
+ if (state_.bound_transform_feedback->active()) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
"transform feedback is already active");
return;
}
- if (!CheckCurrentProgram(function_name)) {
- return;
- }
- Program* program = state_.current_program.get();
- DCHECK(program);
- size_t required_buffer_count =
- program->effective_transform_feedback_varyings().size();
- if (required_buffer_count == 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
- "no active transform feedback varyings");
- return;
- }
- if (required_buffer_count > 1 &&
- GL_INTERLEAVED_ATTRIBS ==
- program->effective_transform_feedback_buffer_mode()) {
- required_buffer_count = 1;
- }
- for (size_t ii = 0; ii < required_buffer_count; ++ii) {
- Buffer* buffer = transform_feedback->GetBufferBinding(ii);
- if (!buffer) {
- std::string msg = base::StringPrintf("missing buffer bound at index %i",
- static_cast<int>(ii));
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, msg.c_str());
- return;
- }
- if (buffer->GetMappedRange()) {
- std::string msg = base::StringPrintf(
- "bound buffer bound at index %i is mapped", static_cast<int>(ii));
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, msg.c_str());
- return;
- }
- }
- transform_feedback->DoBeginTransformFeedback(primitive_mode);
+ state_.bound_transform_feedback->DoBeginTransformFeedback(primitive_mode);
}
void GLES2DecoderImpl::DoEndTransformFeedback() {
@@ -9528,18 +9496,10 @@
return error::kNoError;
}
- if (feature_info_->IsWebGL2OrES3Context()) {
- if (!AttribsTypeMatch()) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
- "vertexAttrib function must match shader attrib type");
- return error::kNoError;
- }
- if (state_.bound_array_buffer.get() &&
- state_.bound_array_buffer->GetMappedRange()) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
- "bound ARRAY_BUFFER is mapped");
- return error::kNoError;
- }
+ if (feature_info_->IsWebGL2OrES3Context() && !AttribsTypeMatch()) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
+ "vertexAttrib function must match shader attrib type");
+ return error::kNoError;
}
base::CheckedNumeric<GLuint> checked_max_vertex = first;
@@ -9674,25 +9634,10 @@
return error::kNoError;
}
- if (feature_info_->IsWebGL2OrES3Context()) {
- if (!AttribsTypeMatch()) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
- "vertexAttrib function must match shader attrib type");
- return error::kNoError;
- }
- if (state_.bound_array_buffer.get() &&
- state_.bound_array_buffer->GetMappedRange()) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
- "bound ARRAY_BUFFER is mapped");
- return error::kNoError;
- }
- if (state_.vertex_attrib_manager->element_array_buffer() &&
- state_.vertex_attrib_manager->element_array_buffer()
- ->GetMappedRange()) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
- "bound ELEMENT_ARRAY_BUFFER is mapped");
- return error::kNoError;
- }
+ if (feature_info_->IsWebGL2OrES3Context() && !AttribsTypeMatch()) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
+ "vertexAttrib function must match shader attrib type");
+ return error::kNoError;
}
GLuint max_vertex_accessed;
@@ -16979,12 +16924,6 @@
"MAP_FLUSH_EXPLICIT_BIT set without MAP_WRITE_BIT");
return error::kNoError;
}
- if (target == GL_TRANSFORM_FEEDBACK_BUFFER &&
- state_.bound_transform_feedback->active()) {
- LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name,
- "transform feedback is active");
- return error::kNoError;
- }
if (AllBitsSet(access, GL_MAP_INVALIDATE_BUFFER_BIT)) {
// To be on the safe side, always map GL_MAP_INVALIDATE_BUFFER_BIT to
// GL_MAP_INVALIDATE_RANGE_BIT.
« no previous file with comments | « gpu/BUILD.gn ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698