Beispiel #1
0
        public void SetTexture(ShaderResourceView srv, int slot, ShaderType shaderType)
        {
            switch (shaderType)
            {
            case ShaderType.VertexShader:
                graphicsDevice.NatiDevice1.D3D11Device.ImmediateContext1.VertexShader.SetShaderResource(slot, srv);
                break;

            case ShaderType.PixelShader:
                graphicsDevice.NatiDevice1.D3D11Device.ImmediateContext1.PixelShader.SetShaderResource(slot, srv);
                break;

            case ShaderType.GeometryShader:
                graphicsDevice.NatiDevice1.D3D11Device.ImmediateContext1.GeometryShader.SetShaderResource(slot, srv);
                break;

            default:
                throw new Exception("ShaderStage not supporter yet");
            }

            currentShaderResourceView = srv.GetHashCode();
        }