internal DeviceContext(Device device) : base(device) { _device = device; _inputAssembler = new InputAssemblerStage(device); _vertexShader = new VertexShaderStage(device); _geometryShader = new GeometryShaderStage(device); _rasterizer = new RasterizerStage(device); _pixelShader = new PixelShaderStage(device); _outputMerger = new OutputMergerStage(device); }
protected void PrepareShader(SharpDevice device, string shaderPath) { //init shader Shader = new SharpShader(device, shaderPath, new SharpShaderDescription( ) { VertexShaderFunction = "VS", PixelShaderFunction = "PS" }, new InputElement[] { new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0), new InputElement("NORMAL", 0, Format.R32G32B32_Float, 12, 0), new InputElement("TEXCOORD", 0, Format.R32G32_Float, 24, 0) }); VertexShader = device.DeviceContext.VertexShader; PixelShader = device.DeviceContext.PixelShader; GPUDataBuffer = Shader.CreateBuffer <GPUData>( ); }