protected override void PlatformSetSamplerState(int slot, SamplerState samplerState)
        {
            OpenGLSamplerState           glSampler = (OpenGLSamplerState)samplerState;
            OpenGLTextureBindingSlotInfo info      = ShaderResourceBindingSlots.GetSamplerBindingInfo(slot);

            _textureSamplerManager.SetSampler(info.RelativeIndex, glSampler);
        }
示例#2
0
        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);
            }
        }
示例#3
0
 public BoundSamplerStateInfo(OpenGLSamplerState samplerState, bool mipmapped)
 {
     SamplerState = samplerState;
     Mipmapped    = mipmapped;
 }