public SwapchainD3D12( D3D12GraphicsDevice device, SwapChainDescriptor descriptor, int backbufferCount) : base(device, descriptor, device.DXGIFactory, device.GraphicsQueue, backbufferCount, backbufferCount) { _backbufferTextures = new TextureD3D12[backbufferCount]; for (int i = 0; i < backbufferCount; i++) { var backBufferTexture = _swapChain.GetBuffer <ID3D12Resource>(i); var d3dTextureDesc = backBufferTexture.Description; var textureDescriptor = TextureDescriptor.Texture2D( (int)d3dTextureDesc.Width, d3dTextureDesc.Height, d3dTextureDesc.MipLevels, d3dTextureDesc.DepthOrArraySize, d3dTextureDesc.Format.FromDirectXPixelFormat(), D3D12Convert.Convert(d3dTextureDesc.Flags), (SampleCount)d3dTextureDesc.SampleDescription.Count); _backbufferTextures[i] = new TextureD3D12(device, textureDescriptor, backBufferTexture); } // Configure base. Configure(descriptor); }
public CommandQueueD3D12(D3D12GraphicsDevice device, CommandQueueType queueType) : base(device, queueType) { switch (queueType) { case CommandQueueType.Graphics: CommandListType = CommandListType.Direct; break; case CommandQueueType.Compute: CommandListType = CommandListType.Compute; break; case CommandQueueType.Copy: CommandListType = CommandListType.Copy; break; default: CommandListType = CommandListType.Bundle; break; } D3D12CommandQueue = device.D3D12Device.CreateCommandQueue(CommandListType); D3D12CommandQueue.Name = $"{CommandListType} Command Queue"; }
public DescriptorAllocator(D3D12GraphicsDevice device, DescriptorHeapType type) { Device = device; Type = type; IsShaderVisible = type == DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView || type == DescriptorHeapType.Sampler; }
public TextureD3D12( D3D12GraphicsDevice device, in TextureDescriptor descriptor,
public FenceD3D12(D3D12GraphicsDevice device, long initialValue) { Device = device; _fence = device.D3D12Device.CreateFence(initialValue, FenceFlags.None); _fenceEvent = new AutoResetEvent(false); }
public PipelineStateD3D12(D3D12GraphicsDevice device, in RenderPipelineDescriptor descriptor)
public BufferD3D12(D3D12GraphicsDevice device, in BufferDescriptor descriptor, IntPtr initialData)
public ShaderD3D12(D3D12GraphicsDevice device, in ShaderBytecode bytecode)