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

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

Issue 1610613002: command_buffer: Fix setting samplers with bound uniforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clarification Created 4 years, 11 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
Index: gpu/command_buffer/service/program_manager.cc
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index f90c39d50962122ba4444eb8838fd4b0b64d9929..5825b74839617df685c024dbc5dc9f44dcd6f8bf 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -1405,16 +1405,12 @@ const Program::UniformInfo*
bool Program::SetSamplers(
GLint num_texture_units, GLint fake_location,
GLsizei count, const GLint* value) {
- if (fake_location < 0) {
- return true;
- }
+ // The caller has checked that the location is active and valid.
+ DCHECK(fake_location >= 0);
size_t location_index =
GetUniformLocationIndexFromFakeLocation(fake_location);
- if (location_index >= uniform_infos_.size())
- return false;
-
- if (!uniform_locations_[location_index].IsActive())
- return false;
+ DCHECK(location_index < uniform_locations_.size());
+ DCHECK(uniform_locations_[location_index].IsActive());
UniformInfo* info = uniform_locations_[location_index].shader_variable();
« no previous file with comments | « gpu/command_buffer/service/program_manager.h ('k') | gpu/command_buffer/tests/gl_bind_uniform_location_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698