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

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

Issue 2475793002: Fix crash when drawing without a program (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8685 matching lines...) Expand 10 before | Expand all | Expand 10 after
8696 fragment_output_type_mask, fragment_output_written_mask)) { 8696 fragment_output_type_mask, fragment_output_written_mask)) {
8697 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, 8697 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name,
8698 "buffer format and fragment output variable type incompatible"); 8698 "buffer format and fragment output variable type incompatible");
8699 return false; 8699 return false;
8700 } 8700 }
8701 return true; 8701 return true;
8702 } 8702 }
8703 8703
8704 bool GLES2DecoderImpl::ValidateUniformBlockBackings(const char* func_name) { 8704 bool GLES2DecoderImpl::ValidateUniformBlockBackings(const char* func_name) {
8705 DCHECK(feature_info_->IsWebGL2OrES3Context()); 8705 DCHECK(feature_info_->IsWebGL2OrES3Context());
8706 DCHECK(state_.current_program.get()); 8706 if (!state_.current_program.get())
8707 return true;
8707 int32_t max_index = -1; 8708 int32_t max_index = -1;
8708 for (auto info : state_.current_program->uniform_block_size_info()) { 8709 for (auto info : state_.current_program->uniform_block_size_info()) {
8709 int32_t index = static_cast<int32_t>(info.binding); 8710 int32_t index = static_cast<int32_t>(info.binding);
8710 if (index > max_index) 8711 if (index > max_index)
8711 max_index = index; 8712 max_index = index;
8712 } 8713 }
8713 if (max_index < 0) 8714 if (max_index < 0)
8714 return true; 8715 return true;
8715 std::vector<GLsizeiptr> uniform_block_sizes(max_index + 1); 8716 std::vector<GLsizeiptr> uniform_block_sizes(max_index + 1);
8716 for (int32_t ii = 0; ii <= max_index; ++ii) 8717 for (int32_t ii = 0; ii <= max_index; ++ii)
(...skipping 10078 matching lines...) Expand 10 before | Expand all | Expand 10 after
18795 } 18796 }
18796 18797
18797 // Include the auto-generated part of this file. We split this because it means 18798 // Include the auto-generated part of this file. We split this because it means
18798 // we can easily edit the non-auto generated parts right here in this file 18799 // we can easily edit the non-auto generated parts right here in this file
18799 // instead of having to edit some template or the code generator. 18800 // instead of having to edit some template or the code generator.
18800 #include "base/macros.h" 18801 #include "base/macros.h"
18801 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 18802 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
18802 18803
18803 } // namespace gles2 18804 } // namespace gles2
18804 } // namespace gpu 18805 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_drawing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698