Exemple #1
0
        protected override void PlatformSetSamplerState(int slot, SamplerState samplerState)
        {
            OpenGLESSamplerState           glSampler = (OpenGLESSamplerState)samplerState;
            OpenGLESTextureBindingSlotInfo info      = ShaderResourceBindingSlots.GetSamplerBindingInfo(slot);

            _textureSamplerManager.SetSampler(info.RelativeIndex, glSampler);
        }
        public void SetSampler(int textureUnit, OpenGLESSamplerState samplerState)
        {
            if (_textureUnitSamplers[textureUnit].SamplerState != samplerState)
            {
                bool mipmapped = false;
                OpenGLESTextureBinding 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(OpenGLESSamplerState samplerState, bool mipmapped)
 {
     SamplerState = samplerState;
     Mipmapped    = mipmapped;
 }