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

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

Issue 153173002: Add a gpu driver bug workaround to count in all varyings in packing check. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 6 years, 10 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 | Annotate | Revision Log
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 15 matching lines...) Expand all
26 class ShaderManager; 26 class ShaderManager;
27 class ShaderTranslator; 27 class ShaderTranslator;
28 28
29 // This is used to track which attributes a particular program needs 29 // This is used to track which attributes a particular program needs
30 // so we can verify at glDrawXXX time that every attribute is either disabled 30 // so we can verify at glDrawXXX time that every attribute is either disabled
31 // or if enabled that it points to a valid source. 31 // or if enabled that it points to a valid source.
32 class GPU_EXPORT Program : public base::RefCounted<Program> { 32 class GPU_EXPORT Program : public base::RefCounted<Program> {
33 public: 33 public:
34 static const int kMaxAttachedShaders = 2; 34 static const int kMaxAttachedShaders = 2;
35 35
36 enum VaryingsPackingOption {
37 kCountOnlyStaticallyUsed,
38 kCountAll
39 };
40
36 struct UniformInfo { 41 struct UniformInfo {
37 UniformInfo(); 42 UniformInfo();
38 UniformInfo( 43 UniformInfo(
39 GLsizei _size, GLenum _type, GLint _fake_location_base, 44 GLsizei _size, GLenum _type, GLint _fake_location_base,
40 const std::string& _name); 45 const std::string& _name);
41 ~UniformInfo(); 46 ~UniformInfo();
42 47
43 bool IsValid() const { 48 bool IsValid() const {
44 return size != 0; 49 return size != 0;
45 } 50 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 154
150 bool AttachShader(ShaderManager* manager, Shader* shader); 155 bool AttachShader(ShaderManager* manager, Shader* shader);
151 bool DetachShader(ShaderManager* manager, Shader* shader); 156 bool DetachShader(ShaderManager* manager, Shader* shader);
152 157
153 bool CanLink() const; 158 bool CanLink() const;
154 159
155 // Performs glLinkProgram and related activities. 160 // Performs glLinkProgram and related activities.
156 bool Link(ShaderManager* manager, 161 bool Link(ShaderManager* manager,
157 ShaderTranslator* vertex_translator, 162 ShaderTranslator* vertex_translator,
158 ShaderTranslator* fragment_shader, 163 ShaderTranslator* fragment_shader,
164 VaryingsPackingOption varyings_packing_option,
159 const ShaderCacheCallback& shader_callback); 165 const ShaderCacheCallback& shader_callback);
160 166
161 // Performs glValidateProgram and related activities. 167 // Performs glValidateProgram and related activities.
162 void Validate(); 168 void Validate();
163 169
164 const std::string* log_info() const { 170 const std::string* log_info() const {
165 return log_info_.get(); 171 return log_info_.get();
166 } 172 }
167 173
168 bool InUse() const { 174 bool InUse() const {
(...skipping 23 matching lines...) Expand all
192 198
193 // Return true if a varying is statically used in fragment shader, but it 199 // Return true if a varying is statically used in fragment shader, but it
194 // is not declared in vertex shader. 200 // is not declared in vertex shader.
195 bool DetectVaryingsMismatch(std::string* conflicting_name) const; 201 bool DetectVaryingsMismatch(std::string* conflicting_name) const;
196 202
197 // Return true if an uniform and an attribute share the same name. 203 // Return true if an uniform and an attribute share the same name.
198 bool DetectGlobalNameConflicts(std::string* conflicting_name) const; 204 bool DetectGlobalNameConflicts(std::string* conflicting_name) const;
199 205
200 // Return false if varyings can't be packed into the max available 206 // Return false if varyings can't be packed into the max available
201 // varying registers. 207 // varying registers.
202 bool CheckVaryingsPacking() const; 208 bool CheckVaryingsPacking(VaryingsPackingOption option) const;
203 209
204 // Visible for testing 210 // Visible for testing
205 const LocationMap& bind_attrib_location_map() const { 211 const LocationMap& bind_attrib_location_map() const {
206 return bind_attrib_location_map_; 212 return bind_attrib_location_map_;
207 } 213 }
208 214
209 private: 215 private:
210 friend class base::RefCounted<Program>; 216 friend class base::RefCounted<Program>;
211 friend class ProgramManager; 217 friend class ProgramManager;
212 218
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 421
416 uint32 max_varying_vectors_; 422 uint32 max_varying_vectors_;
417 423
418 DISALLOW_COPY_AND_ASSIGN(ProgramManager); 424 DISALLOW_COPY_AND_ASSIGN(ProgramManager);
419 }; 425 };
420 426
421 } // namespace gles2 427 } // namespace gles2
422 } // namespace gpu 428 } // namespace gpu
423 429
424 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ 430 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc ('k') | gpu/command_buffer/service/program_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698