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

Function SetConstantValues

engine/render/src/render/constant.cpp:52–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52Result SetConstantValues(HConstant constant, dmVMath::Vector4* values, uint32_t num_values)
53{
54 if (num_values > constant->m_NumValues)
55 {
56 dmVMath::Vector4* newmem = 0;
57 if (dmMemory::RESULT_OK != dmMemory::AlignedMalloc((void**)&newmem, 16, num_values * sizeof(dmVMath::Vector4)))
58 {
59 return RESULT_OUT_OF_RESOURCES;
60 }
61 if (constant->m_AllocatedValues)
62 dmMemory::AlignedFree(constant->m_Values);
63 constant->m_Values = newmem;
64 }
65
66 memcpy(constant->m_Values, values, num_values * sizeof(dmVMath::Vector4));
67 constant->m_NumValues = num_values;
68 constant->m_AllocatedValues = 1;
69
70 return dmRender::RESULT_OK;
71}
72
73Result SetConstantValuesRef(HConstant constant, dmVMath::Vector4* values, uint32_t num_values)
74{

Callers 4

TESTFunction · 0.85
SetProgramConstantValuesFunction · 0.85
FindOrCreateConstantFunction · 0.85
SetRenderConstantFunction · 0.85

Calls 2

AlignedMallocFunction · 0.85
AlignedFreeFunction · 0.85

Tested by 1

TESTFunction · 0.68