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

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

Issue 2181193002: Revert of current program can be null in ES2/ES3 contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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.cc ('k') | gpu/command_buffer/service/program_manager.h » ('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 2b5a562407f831e678338f617335d971489b1108..542d3776531a4dd1212291ca54b655899a919831 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3078,7 +3078,8 @@
state_.indexed_uniform_buffer_bindings = new IndexedBufferBindingHost(
group_->max_uniform_buffer_bindings(), needs_emulation);
- state_.InitGenericAttribs(group_->max_vertex_attribs());
+ state_.InitGenericAttribBaseType(group_->max_vertex_attribs());
+ state_.attrib_values.resize(group_->max_vertex_attribs());
vertex_array_manager_.reset(new VertexArrayManager());
GLuint default_vertex_attrib_service_id = 0;
@@ -9136,34 +9137,21 @@
}
bool GLES2DecoderImpl::AttribsTypeMatch() {
- if (!state_.current_program.get())
- return true;
- const std::vector<uint32_t>& shader_attrib_active_mask =
- state_.current_program->vertex_input_active_mask();
- const std::vector<uint32_t>& shader_attrib_type_mask =
- state_.current_program->vertex_input_base_type_mask();
- const std::vector<uint32_t>& generic_vertex_attrib_type_mask =
- state_.generic_attrib_base_type_mask();
- const std::vector<uint32_t>& vertex_attrib_array_enabled_mask =
- state_.vertex_attrib_manager->attrib_enabled_mask();
- const std::vector<uint32_t>& vertex_attrib_array_type_mask =
- state_.vertex_attrib_manager->attrib_base_type_mask();
- DCHECK_EQ(shader_attrib_active_mask.size(),
- shader_attrib_type_mask.size());
- DCHECK_EQ(shader_attrib_active_mask.size(),
- generic_vertex_attrib_type_mask.size());
- DCHECK_EQ(shader_attrib_active_mask.size(),
- vertex_attrib_array_enabled_mask.size());
- DCHECK_EQ(shader_attrib_active_mask.size(),
- vertex_attrib_array_type_mask.size());
- for (size_t ii = 0; ii < shader_attrib_active_mask.size(); ++ii) {
- uint32_t vertex_attrib_source_type_mask =
- (~vertex_attrib_array_enabled_mask[ii] &
- generic_vertex_attrib_type_mask[ii]) |
- (vertex_attrib_array_enabled_mask[ii] &
- vertex_attrib_array_type_mask[ii]);
- if ((shader_attrib_type_mask[ii] & shader_attrib_active_mask[ii]) !=
- (vertex_attrib_source_type_mask & shader_attrib_active_mask[ii])) {
+ for (uint32_t index = 0; index < group_->max_vertex_attribs(); index += 16) {
+ uint32_t shader_attrib_written_mask =
+ state_.current_program->vertex_input_type_written_mask(index);
+ uint32_t vao_attrib_enabled_mask =
+ state_.vertex_attrib_manager->attrib_enabled_mask(index);
+
+ uint32_t vertex_attrib_base_type_mask =
+ (~vao_attrib_enabled_mask &
+ state_.GetGenericVertexAttribBaseTypeMask(index)) |
+ (vao_attrib_enabled_mask &
+ state_.vertex_attrib_manager->attrib_base_type_mask(index));
+
+ if ((state_.current_program->vertex_input_base_type_mask(index)
+ & shader_attrib_written_mask) !=
+ (vertex_attrib_base_type_mask & shader_attrib_written_mask)) {
return false;
}
}
« no previous file with comments | « gpu/command_buffer/service/context_state.cc ('k') | gpu/command_buffer/service/program_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698