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

Side by Side Diff: gpu/command_buffer/service/program_manager.h

Issue 619723008: Switch to use ANGLE's new APIs to query shader variables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win build fix Created 6 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 unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/mocks.h ('k') | gpu/command_buffer/service/program_manager.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 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 GLenum type; 72 GLenum type;
73 uint32 accepts_api_type; 73 uint32 accepts_api_type;
74 GLint fake_location_base; 74 GLint fake_location_base;
75 bool is_array; 75 bool is_array;
76 std::string name; 76 std::string name;
77 std::vector<GLint> element_locations; 77 std::vector<GLint> element_locations;
78 std::vector<GLuint> texture_units; 78 std::vector<GLuint> texture_units;
79 }; 79 };
80 struct VertexAttrib { 80 struct VertexAttrib {
81 VertexAttrib(GLsizei _size, GLenum _type, const std::string& _name, 81 VertexAttrib(GLsizei _size, GLenum _type, const std::string& _name,
82 GLint _location) 82 GLint _location)
83 : size(_size), 83 : size(_size),
84 type(_type), 84 type(_type),
85 location(_location), 85 location(_location),
86 name(_name) { 86 name(_name) {
87 } 87 }
88 GLsizei size; 88 GLsizei size;
89 GLenum type; 89 GLenum type;
90 GLint location; 90 GLint location;
91 std::string name; 91 std::string name;
92 }; 92 };
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 // glBindAttribLocation() again with the mapped names. 274 // glBindAttribLocation() again with the mapped names.
275 // This is called right before the glLink() call, but after shaders are 275 // This is called right before the glLink() call, but after shaders are
276 // translated. 276 // translated.
277 void ExecuteBindAttribLocationCalls(); 277 void ExecuteBindAttribLocationCalls();
278 278
279 bool AddUniformInfo( 279 bool AddUniformInfo(
280 GLsizei size, GLenum type, GLint location, GLint fake_base_location, 280 GLsizei size, GLenum type, GLint location, GLint fake_base_location,
281 const std::string& name, const std::string& original_name, 281 const std::string& name, const std::string& original_name,
282 size_t* next_available_index); 282 size_t* next_available_index);
283 283
284 void GetCorrectedVariableInfo( 284 // Query uniform data returned by ANGLE translator by the mapped name.
285 bool use_uniforms, const std::string& name, std::string* corrected_name, 285 // Some drivers incorrectly return an uniform name of size-1 array without
286 std::string* original_name, GLsizei* size, GLenum* type) const; 286 // "[0]". In this case, we correct the name by appending "[0]" to it.
287 void GetCorrectedUniformData(
288 const std::string& name,
289 std::string* corrected_name, std::string* original_name,
290 GLsizei* size, GLenum* type) const;
291
292 // Query VertexAttrib data returned by ANGLE translator by the mapped name.
293 void GetVertexAttribData(
294 const std::string& name, std::string* original_name, GLenum* type) const;
287 295
288 void DetachShaders(ShaderManager* manager); 296 void DetachShaders(ShaderManager* manager);
289 297
290 static inline GLint GetUniformInfoIndexFromFakeLocation( 298 static inline GLint GetUniformInfoIndexFromFakeLocation(
291 GLint fake_location) { 299 GLint fake_location) {
292 return fake_location & 0xFFFF; 300 return fake_location & 0xFFFF;
293 } 301 }
294 302
295 static inline GLint GetArrayElementIndexFromFakeLocation( 303 static inline GLint GetArrayElementIndexFromFakeLocation(
296 GLint fake_location) { 304 GLint fake_location) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 434
427 uint32 max_varying_vectors_; 435 uint32 max_varying_vectors_;
428 436
429 DISALLOW_COPY_AND_ASSIGN(ProgramManager); 437 DISALLOW_COPY_AND_ASSIGN(ProgramManager);
430 }; 438 };
431 439
432 } // namespace gles2 440 } // namespace gles2
433 } // namespace gpu 441 } // namespace gpu
434 442
435 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ 443 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/mocks.h ('k') | gpu/command_buffer/service/program_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698