示例#1
0
        public D3D12Swapchain(D3D12GraphicsDevice device, PresentationParameters presentationParameters)
            : base(device,
                   presentationParameters,
                   ((D3D12CommandQueue)device.GraphicsQueue).NativeQueue,
                   2, 2)
        {
            _backbufferTextures = new D3D12Texture[_frameCount];
            for (int i = 0; i < _frameCount; i++)
            {
                var backBufferTexture  = _swapChain.GetBackBuffer <Resource>(i);
                var d3dTextureDesc     = backBufferTexture.Description;
                var textureDescription = TextureDescription.Texture2D(
                    (int)d3dTextureDesc.Width,
                    d3dTextureDesc.Height,
                    d3dTextureDesc.MipLevels,
                    d3dTextureDesc.DepthOrArraySize,
                    D3DConvert.Convert(d3dTextureDesc.Format),
                    D3D12Convert.Convert(d3dTextureDesc.Flags),
                    (SampleCount)d3dTextureDesc.SampleDescription.Count);

                _backbufferTextures[i] = new D3D12Texture(device, textureDescription, backBufferTexture);
            }

            Initialize(_backbufferTextures);
        }
示例#2
0
 public D3D12Texture(D3D12GraphicsDevice device, in TextureDescription description, Resource nativeTexture)
示例#3
0
 public D3D12Buffer(D3D12GraphicsDevice device, in BufferDescriptor descriptor, IntPtr initialData)
示例#4
0
 public D3D12CommandQueue(D3D12GraphicsDevice device, CommandListType type)
     : base(device)
 {
     NativeQueue = device.Device.CreateCommandQueue(new CommandQueueDescription(type, CommandQueueFlags.None));
 }