internal void SetSamplers(int startSlot, params ISamplerState[] samplers) { if (m_tmpSamplers == null) { m_tmpSamplers = new SamplerState[6]; } for (int i = 0; i < samplers.Length; i++) { ISamplerState sampler = samplers[i]; SamplerState dxObject = null; if (sampler != null) { ISamplerStateInternal samplerInternal = (ISamplerStateInternal)sampler; dxObject = samplerInternal.Resource; } int slot = startSlot + i; if (dxObject == m_samplers[slot]) { continue; } m_samplers[slot] = dxObject; m_tmpSamplers[i] = dxObject; } m_shaderStage.SetSamplers(startSlot, samplers.Length, m_tmpSamplers); m_statistics.SetSamplers++; }
public void Apply(CommonShaderStage stage) { stage.SetSamplers(0, samplers); }