public void DestroyResource(ID3D12PipelineState res) { if (res != null) { delayDestroy.Enqueue(new ResourceDelayDestroy { pipelineState = res, destroyFrame = executeCount }); } }
public void CreatePipeline() { InputElementDescription[] inputElementDescs = new InputElementDescription[] { new InputElementDescription("POSITION", 0, Format.R32G32B32_Float, 0, 0), new InputElementDescription("COLOR", 0, Format.R32G32B32A32_Float, 12, 0), }; var psoDesc = new GraphicsPipelineStateDescription() { RootSignature = RootSignature, InputLayout = new InputLayoutDescription(inputElementDescs), SampleMask = uint.MaxValue, PrimitiveTopologyType = PrimitiveTopologyType.Triangle, RasterizerState = RasterizerDescription.CullCounterClockwise, BlendState = BlendDescription.Opaque, DepthStencilState = DepthStencilDescription.None, RenderTargetFormats = new[] { Format.R8G8B8A8_UNorm }, DepthStencilFormat = Format.Unknown, SampleDescription = new SampleDescription(1, 0), //IndexBufferStripCutValue = IndexBufferStripCutValue.Value0xFFFF StreamOutput = new StreamOutputDescription() { //RasterizedStream = }, HullShader = PipelineStateDescription.HullShader == null ? null : PipelineStateDescription.HullShader.Data, GeometryShader = PipelineStateDescription.GeometryShader == null ? null : PipelineStateDescription.GeometryShader.Data, DomainShader = PipelineStateDescription.DomainShader == null ? null : PipelineStateDescription.DomainShader.Data, VertexShader = PipelineStateDescription.VertexShader == null ? null : PipelineStateDescription.VertexShader.Data, PixelShader = PipelineStateDescription.PixelShader == null ? null : PipelineStateDescription.PixelShader.Data, }; oldPipelineState = GraphicsDevice.NativeDevice.CreateGraphicsPipelineState <ID3D12PipelineState>(psoDesc); }
public ID3D12GraphicsCommandList CreateCommandList(int nodeMask, CommandListType type, ID3D12CommandAllocator commandAllocator, ID3D12PipelineState initialState = null) { Guard.NotNull(commandAllocator, nameof(commandAllocator)); var nativePtr = CreateCommandList(nodeMask, type, commandAllocator, initialState, typeof(ID3D12GraphicsCommandList).GUID); return(new ID3D12GraphicsCommandList(nativePtr)); }
public ID3D12GraphicsCommandList CreateCommandList(CommandListType type, ID3D12CommandAllocator commandAllocator, ID3D12PipelineState initialState = null) { return(CreateCommandList(0, type, commandAllocator, initialState)); }