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

Method DisableSamplers

GTE/Graphics/GL46/GL46Engine.cpp:772–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

770}
771
772void GL46Engine::DisableSamplers(Shader const* shader, GLuint program)
773{
774 int32_t const index = SamplerState::shaderDataLookup;
775 for (auto const& ts : shader->GetData(index))
776 {
777 if (ts.object)
778 {
779 auto gl4Sampler = static_cast<GL46SamplerState*>(Get(ts.object));
780
781 if (gl4Sampler)
782 {
783 auto const location = ts.bindPoint;
784 auto const unit = mTextureSamplerUnitMap.GetUnit(program, location);
785 glBindSampler(unit, 0);
786 mTextureSamplerUnitMap.ReleaseUnit(unit);
787 }
788 else
789 {
790 LogError("Failed to get sampler.");
791 }
792 }
793 else
794 {
795 LogError(ts.name + " is null sampler.");
796 }
797 }
798}
799
800int32_t GL46Engine::ProgramIndexUnitMap::AcquireUnit(GLint program, GLint index)
801{

Callers

nothing calls this directly

Calls 4

glBindSamplerFunction · 0.85
GetUnitMethod · 0.80
ReleaseUnitMethod · 0.80
GetDataMethod · 0.45

Tested by

no test coverage detected