Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_MEMORY_program_cache_H_ | |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_MEMORY_program_cache_H_ | |
| 7 | |
| 8 #include "base/hash_tables.h" | |
| 9 #include "gpu/command_buffer/service/program_cache.h" | |
| 10 #include "gpu/command_buffer/service/shader_translator.h" | |
| 11 #include "net/disk_cache/disk_cache.h" | |
| 12 | |
| 13 namespace gpu { | |
| 14 namespace gles2 { | |
| 15 | |
| 16 struct StoreValue { | |
| 17 StoreValue() : length(0), format(0), data(NULL) { } | |
| 18 StoreValue(GLsizei _length, | |
| 19 GLenum _format, | |
| 20 GLvoid* _data, | |
|
greggman
2012/06/19 22:27:50
const?
dmurph
2012/06/23 01:37:28
Done.
| |
| 21 ShaderTranslator::VariableMap& _attrib_map_0, | |
|
greggman
2012/06/19 22:27:50
const?
dmurph
2012/06/23 01:37:28
Done.
| |
| 22 ShaderTranslator::VariableMap& _uniform_map_0, | |
| 23 ShaderTranslator::VariableMap& _attrib_map_1, | |
| 24 ShaderTranslator::VariableMap& _uniform_map_1) | |
| 25 : length(_length), | |
| 26 format(_format), | |
| 27 data(_data), | |
| 28 attrib_map_0(_attrib_map_0), | |
| 29 uniform_map_0(_uniform_map_0), | |
| 30 attrib_map_1(_attrib_map_1), | |
| 31 uniform_map_1(_uniform_map_1) { } | |
| 32 GLsizei length; | |
| 33 GLenum format; | |
| 34 GLvoid* data; | |
| 35 ShaderTranslator::VariableMap attrib_map_0; | |
| 36 ShaderTranslator::VariableMap uniform_map_0; | |
| 37 ShaderTranslator::VariableMap attrib_map_1; | |
| 38 ShaderTranslator::VariableMap uniform_map_1; | |
| 39 }; | |
| 40 | |
| 41 // Program cache that stores binaries completely in-memory | |
| 42 class GPU_EXPORT MemoryProgramCache : public ProgramCache { | |
| 43 public: | |
| 44 typedef base::hash_map<CachedProgramKey, | |
| 45 StoreValue, | |
| 46 CachedProgramKeyHash, | |
| 47 CachedProgramKeyEquals> store_map; | |
|
greggman
2012/06/19 22:27:50
style: types are CamelCase
dmurph
2012/06/23 01:37:28
Done.
| |
| 48 | |
| 49 MemoryProgramCache(); | |
| 50 virtual ~MemoryProgramCache(); | |
| 51 | |
| 52 void LoadLinkedProgram( | |
| 53 GLuint program, | |
| 54 ShaderManager::ShaderInfo* shader_a, | |
| 55 ShaderManager::ShaderInfo* shader_b, | |
| 56 std::map<std::string, GLint>* bind_attrib_location_map) const; | |
| 57 void SaveLinkedProgram( | |
| 58 GLuint program, | |
| 59 ShaderManager::ShaderInfo* shader_a, | |
|
greggman
2012/06/19 22:27:50
const?
dmurph
2012/06/23 01:37:28
Done.
| |
| 60 ShaderManager::ShaderInfo* shader_b, | |
| 61 std::map<std::string, GLint>* bind_attrib_location_map); | |
|
greggman
2012/06/19 22:27:50
const?
dmurph
2012/06/23 01:37:28
Done.
| |
| 62 | |
| 63 private: | |
| 64 store_map store_; | |
| 65 | |
| 66 DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache); | |
| 67 }; | |
| 68 | |
| 69 } // namespace gles2 | |
| 70 } // namespace gpu | |
| 71 | |
| 72 #endif /* GPU_COMMAND_BUFFER_SERVICE_MEMORY_program_cache_H_ */ | |
| OLD | NEW |