MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / EnableSamplers

Method EnableSamplers

GTE/Graphics/GL46/GL46Engine.cpp:746–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

744}
745
746void GL46Engine::EnableSamplers(Shader const* shader, GLuint program)
747{
748 int32_t const index = SamplerState::shaderDataLookup;
749 for (auto const& ts : shader->GetData(index))
750 {
751 if (ts.object)
752 {
753 auto gl4Sampler = static_cast<GL46SamplerState*>(Bind(ts.object));
754 if (gl4Sampler)
755 {
756 auto const location = ts.bindPoint;
757 auto const unit = mTextureSamplerUnitMap.AcquireUnit(program, location);
758 glBindSampler(unit, gl4Sampler->GetGLHandle());
759 }
760 else
761 {
762 LogError("Failed to bind sampler.");
763 }
764 }
765 else
766 {
767 LogError(ts.name + " is null sampler.");
768 }
769 }
770}
771
772void GL46Engine::DisableSamplers(Shader const* shader, GLuint program)
773{

Callers

nothing calls this directly

Calls 4

glBindSamplerFunction · 0.85
AcquireUnitMethod · 0.80
GetGLHandleMethod · 0.80
GetDataMethod · 0.45

Tested by

no test coverage detected