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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2175673003: WebGL 2: Fix nits when check vertexAttrib type with variable type in vertex shader (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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 9105 matching lines...) Expand 10 before | Expand all | Expand 10 after
9116 glBindBuffer( 9116 glBindBuffer(
9117 GL_ARRAY_BUFFER, 9117 GL_ARRAY_BUFFER,
9118 state_.bound_array_buffer.get() ? state_.bound_array_buffer->service_id() 9118 state_.bound_array_buffer.get() ? state_.bound_array_buffer->service_id()
9119 : 0); 9119 : 0);
9120 } 9120 }
9121 9121
9122 bool GLES2DecoderImpl::AttribsTypeMatch() { 9122 bool GLES2DecoderImpl::AttribsTypeMatch() {
9123 for (uint32_t index = 0; index < group_->max_vertex_attribs(); index += 16) { 9123 for (uint32_t index = 0; index < group_->max_vertex_attribs(); index += 16) {
9124 uint32_t shader_attrib_written_mask = 9124 uint32_t shader_attrib_written_mask =
9125 state_.current_program->vertex_input_type_written_mask(index); 9125 state_.current_program->vertex_input_type_written_mask(index);
9126 uint32_t vao_attrib_written_mask = 9126 uint32_t vao_attrib_enabled_mask =
9127 state_.vertex_attrib_manager->attrib_type_written_mask(index); 9127 state_.vertex_attrib_manager->attrib_enabled_mask(index);
9128 9128
9129 uint32_t vertex_attrib_base_type_mask = 9129 uint32_t vertex_attrib_base_type_mask =
9130 (~vao_attrib_written_mask & 9130 (~vao_attrib_enabled_mask &
9131 state_.GetGenericVertexAttribBaseTypeMask(index)) | 9131 state_.GetGenericVertexAttribBaseTypeMask(index)) |
9132 (vao_attrib_written_mask & 9132 (vao_attrib_enabled_mask &
9133 state_.vertex_attrib_manager->attrib_base_type_mask(index)); 9133 state_.vertex_attrib_manager->attrib_base_type_mask(index));
9134 9134
9135 if ((state_.current_program->vertex_input_base_type_mask(index) 9135 if ((state_.current_program->vertex_input_base_type_mask(index)
9136 & shader_attrib_written_mask) != 9136 & shader_attrib_written_mask) !=
9137 (vertex_attrib_base_type_mask & shader_attrib_written_mask)) { 9137 (vertex_attrib_base_type_mask & shader_attrib_written_mask)) {
9138 return false; 9138 return false;
9139 } 9139 }
9140 } 9140 }
9141 return true; 9141 return true;
9142 } 9142 }
9143 9143
(...skipping 8470 matching lines...) Expand 10 before | Expand all | Expand 10 after
17614 } 17614 }
17615 17615
17616 // Include the auto-generated part of this file. We split this because it means 17616 // Include the auto-generated part of this file. We split this because it means
17617 // we can easily edit the non-auto generated parts right here in this file 17617 // we can easily edit the non-auto generated parts right here in this file
17618 // instead of having to edit some template or the code generator. 17618 // instead of having to edit some template or the code generator.
17619 #include "base/macros.h" 17619 #include "base/macros.h"
17620 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 17620 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
17621 17621
17622 } // namespace gles2 17622 } // namespace gles2
17623 } // namespace gpu 17623 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698