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

Function ApplyProgramSampler

engine/render/src/render/program_utils.cpp:184–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182 }
183
184 void ApplyProgramSampler(dmRender::HRenderContext render_context, HSampler sampler, uint8_t unit, dmGraphics::HTexture texture)
185 {
186 if (!sampler)
187 {
188 return;
189 }
190
191 Sampler* s = (Sampler*) sampler;
192 dmGraphics::HContext graphics_context = dmRender::GetGraphicsContext(render_context);
193
194 if (s->m_Location != -1)
195 {
196 dmGraphics::SetSampler(graphics_context, s->m_Location, unit);
197 dmGraphics::SetTextureParams(graphics_context, texture, s->m_MinFilter, s->m_MagFilter, s->m_UWrap, s->m_VWrap, s->m_MaxAnisotropy);
198 }
199 }
200
201 void GetProgramUniformCount(dmGraphics::HProgram program, uint32_t total_constants_count, uint32_t* constant_count_out, uint32_t* samplers_count_out)
202 {

Callers 2

DispatchComputeFunction · 0.85
DrawFunction · 0.85

Calls 3

GetGraphicsContextFunction · 0.85
SetTextureParamsFunction · 0.85
SetSamplerFunction · 0.50

Tested by

no test coverage detected