示例#1
0
        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++;
        }
示例#2
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++;
        }