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

Function IterateProgramResourceBindings

engine/graphics/src/graphics.cpp:1405–1428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1403 }
1404
1405 void IterateProgramResourceBindings(HProgram prog, ShaderResourceBindingFamily family, IterateProgramResourceBindingsCallback callback, void* user_data)
1406 {
1407 Program* program = (Program*) prog;
1408 ProgramResourceBindingIterator it(program);
1409
1410 const ProgramResourceBinding* binding;
1411 while ((binding = it.Next()))
1412 {
1413 if (!binding->m_Res || binding->m_Res->m_BindingFamily != family)
1414 {
1415 continue;
1416 }
1417
1418 const dmArray<ShaderResourceTypeInfo>& type_infos = *binding->m_TypeInfos;
1419 uint32_t root_type_index = binding->m_Res->m_Type.m_TypeIndex;
1420 if (root_type_index >= (uint32_t) type_infos.Size())
1421 {
1422 continue;
1423 }
1424
1425 const ShaderResourceTypeInfo* root_type = &type_infos[root_type_index];
1426 callback(binding->m_Res->m_Set, binding->m_Res->m_Binding, root_type, user_data);
1427 }
1428 }
1429
1430 void BuildUniforms(Program* program)
1431 {

Callers 1

Calls 2

NextMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected