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

Function GetProgramSamplerUnit

engine/render/src/render/program_utils.cpp:145–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143 }
144
145 uint32_t GetProgramSamplerUnit(const dmArray<Sampler>& samplers, dmhash_t name_hash)
146 {
147 uint32_t num_samplers = samplers.Size();
148 for (uint32_t i = 0; i < num_samplers; ++i)
149 {
150 if (samplers[i].m_NameHash == name_hash)
151 {
152 return i;
153 }
154 }
155 return INVALID_SAMPLER_UNIT;
156 }
157
158 HSampler GetProgramSampler(const dmArray<Sampler>& samplers, uint32_t unit)
159 {

Callers 2

GetMaterialSamplerUnitFunction · 0.85

Calls 1

SizeMethod · 0.45

Tested by

no test coverage detected