protected override void PlatformSetSamplerState(int slot, SamplerState samplerState) { OpenGLSamplerState glSampler = (OpenGLSamplerState)samplerState; OpenGLTextureBindingSlotInfo info = ShaderResourceBindingSlots.GetSamplerBindingInfo(slot); _textureSamplerManager.SetSampler(info.RelativeIndex, glSampler); }
public void SetSampler(int textureUnit, OpenGLSamplerState samplerState) { if (_textureUnitSamplers[textureUnit].SamplerState != samplerState) { bool mipmapped = false; OpenGLTextureBinding texBinding = _textureUnitTextures[textureUnit]; if (texBinding != null) { mipmapped = texBinding.BoundTexture.MipLevels > 1; } samplerState.Apply(textureUnit, mipmapped); _textureUnitSamplers[textureUnit] = new BoundSamplerStateInfo(samplerState, mipmapped); } else if (_textureUnitTextures[textureUnit] != null) { EnsureSamplerMipmapState(textureUnit, _textureUnitTextures[textureUnit].BoundTexture.MipLevels > 1); } }
public BoundSamplerStateInfo(OpenGLSamplerState samplerState, bool mipmapped) { SamplerState = samplerState; Mipmapped = mipmapped; }