| 744 | } |
| 745 | |
| 746 | void 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 | |
| 772 | void GL46Engine::DisableSamplers(Shader const* shader, GLuint program) |
| 773 | { |
nothing calls this directly
no test coverage detected