MCPcopy Create free account
hub / github.com/crownengine/crown / offline

Method offline

src/world/shader_manager.cpp:164–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164void ShaderManager::offline(StringId64 id, ResourceManager &rm)
165{
166 const ShaderResource *shader = (ShaderResource *)rm.get(RESOURCE_TYPE_SHADER, id);
167
168 for (u32 i = 0; i < array::size(shader->_data); ++i) {
169 const ShaderResource::Data &data = shader->_data[i];
170
171 ShaderData sd;
172 sd.state = BGFX_STATE_DEFAULT;
173 sd.stencil_front = BGFX_STENCIL_NONE;
174 sd.stencil_back = BGFX_STENCIL_NONE;
175 sd.num_samplers = 0;
176 sd.program = BGFX_INVALID_HANDLE;
177 sd = hash_map::get(_shader_map, data.name, sd);
178
179 bgfx::destroy(sd.program);
180
181 hash_map::remove(_shader_map, data.name);
182 }
183
184 bgfx::frame();
185 bgfx::frame();
186}
187
188void ShaderManager::unload(Allocator &a, void *res)
189{

Callers 2

offlineFunction · 0.45
offlineFunction · 0.45

Calls 6

getFunction · 0.85
frameFunction · 0.85
destroyFunction · 0.70
removeFunction · 0.70
sizeFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected