MCPcopy Create free account
hub / github.com/defold/defold / CreateGraphicsProgram

Function CreateGraphicsProgram

engine/graphics/src/vulkan/graphics_vulkan.cpp:3550–3573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3548 }
3549
3550 static void CreateGraphicsProgram(VulkanContext* context, VulkanProgram* program, ShaderModule* vertex_module, ShaderModule* fragment_module)
3551 {
3552 program->m_Hash = 0;
3553 program->m_UniformData = 0;
3554 program->m_VertexModule = vertex_module;
3555 program->m_FragmentModule = fragment_module;
3556
3557 HashState64 program_hash;
3558 dmHashInit64(&program_hash, false);
3559
3560 for (uint32_t i=0; i < program->m_BaseProgram.m_ShaderMeta.m_Inputs.Size(); i++)
3561 {
3562 if (program->m_BaseProgram.m_ShaderMeta.m_Inputs[i].m_StageFlags & SHADER_STAGE_FLAG_VERTEX)
3563 {
3564 dmHashUpdateBuffer64(&program_hash, &program->m_BaseProgram.m_ShaderMeta.m_Inputs[i].m_Binding, sizeof(program->m_BaseProgram.m_ShaderMeta.m_Inputs[i].m_Binding));
3565 }
3566 }
3567
3568 dmHashUpdateBuffer64(&program_hash, &vertex_module->m_Hash, sizeof(vertex_module->m_Hash));
3569 dmHashUpdateBuffer64(&program_hash, &fragment_module->m_Hash, sizeof(fragment_module->m_Hash));
3570 program->m_Hash = dmHashFinal64(&program_hash);
3571
3572 CreateProgramResourceBindings(context, program);
3573 }
3574
3575 static void DestroyProgram(HContext _context, VulkanProgram* program)
3576 {

Callers 2

VulkanNewProgramFunction · 0.85
VulkanReloadProgramFunction · 0.85

Calls 5

dmHashInit64Function · 0.85
dmHashUpdateBuffer64Function · 0.85
dmHashFinal64Function · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected