Ejemplo n.º 1
0
 private void SetSampler(CommonShaderStage stage, ShaderStageCache cache, int slot, SamplerState sampler)
 {
     if (cache.Samplers[slot] != sampler)
     {
         stage.SetSampler(slot, sampler);
         cache.Samplers[slot] = sampler;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets and gets sampler state to given shader stage.
 /// </summary>
 /// <param name="index"></param>
 /// <returns></returns>
 public SamplerState this[int index] {
     set {
         states[index] = value;
         stage.SetSampler(index, (value == null) ? null : value.Apply(device));
     }
     get {
         return(states[index]);
     }
 }
Ejemplo n.º 3
0
        internal void SetSampler(int slot, ISamplerState sampler)
        {
            SamplerState dxObject = null;

            if (sampler != null)
            {
                ISamplerStateInternal samplerInternal = (ISamplerStateInternal)sampler;
                dxObject = samplerInternal.Resource;
            }

            if (dxObject == m_samplers[slot])
            {
                return;
            }
            m_samplers[slot] = dxObject;
            m_shaderStage.SetSampler(slot, dxObject);
            m_statistics.SetSamplers++;
        }