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

Method createUniform

3rdparty/bgfx/src/renderer_gl.cpp:3561–3573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3559 }
3560
3561 void createUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name) override
3562 {
3563 if (NULL != m_uniforms[_handle.idx])
3564 {
3565 bx::free(g_allocator, m_uniforms[_handle.idx]);
3566 }
3567
3568 uint32_t size = g_uniformTypeSize[_type]*_num;
3569 void* data = bx::alloc(g_allocator, size);
3570 bx::memSet(data, 0, size);
3571 m_uniforms[_handle.idx] = data;
3572 m_uniformReg.add(_handle, _name);
3573 }
3574
3575 void destroyUniform(UniformHandle _handle) override
3576 {

Callers

nothing calls this directly

Calls 4

allocFunction · 0.85
memSetFunction · 0.85
freeFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected