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

Function SetProgramSampler

engine/render/src/render/program_utils.cpp:124–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 bool SetProgramSampler(dmArray<Sampler>& samplers, dmHashTable64<dmGraphics::HUniformLocation>& name_hash_to_location, dmhash_t name_hash, uint32_t unit, dmGraphics::TextureWrap u_wrap, dmGraphics::TextureWrap v_wrap, dmGraphics::TextureFilter min_filter, dmGraphics::TextureFilter mag_filter, float max_anisotropy)
125 {
126 if (unit < samplers.Size() && name_hash != 0)
127 {
128 dmGraphics::HUniformLocation* location = name_hash_to_location.Get(name_hash);
129 if (location)
130 {
131 Sampler& s = samplers[unit];
132 s.m_NameHash = name_hash;
133 s.m_Location = *location;
134 s.m_UWrap = u_wrap;
135 s.m_VWrap = v_wrap;
136 s.m_MinFilter = min_filter;
137 s.m_MagFilter = mag_filter;
138 s.m_MaxAnisotropy = max_anisotropy;
139 return true;
140 }
141 }
142 return false;
143 }
144
145 uint32_t GetProgramSamplerUnit(const dmArray<Sampler>& samplers, dmhash_t name_hash)
146 {

Callers 2

SetMaterialSamplerFunction · 0.85
SetComputeProgramSamplerFunction · 0.85

Calls 2

SizeMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected