示例#1
0
        public void Apply(InputElement[] elements)
        {
            if (!Layouts.TryGetValue(elements, out var layout))
            {
                layout = new InputLayout(Device.NativeDevice, Signature, elements);
                Layouts.Add(elements, layout);
            }

            Device.NativeDeviceContext.InputAssembler.InputLayout = layout;
            Device.NativeDeviceContext.VertexShader.Set(VertexShader);
            Device.NativeDeviceContext.PixelShader.Set(PixelShader);
            Device.NativeDeviceContext.GeometryShader.Set(GeometryShader);
            Device.NativeDeviceContext.DomainShader.Set(null);
            Device.NativeDeviceContext.HullShader.Set(null);
        }