Exemplo n.º 1
0
 /// <summary>
 /// Clear the render target
 /// </summary>
 /// <param name="rtv">The render target to clear</param>
 /// <param name="color">The RGBA color to clear it to</param>
 /// <param name="rect">The rectangles representing the sections to clear</param>
 public void ClearRenderTarget(CpuHandle rtv, RgbaColor color, ReadOnlySpan <Rectangle> rect)
 {
     fixed(Rectangle *p = rect)
     {
         _list.Get()->ClearRenderTargetView(rtv.Value, &color.R, (uint)rect.Length, (RECT *)p);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Sets a range of continuous render targets
        /// </summary>
        /// <param name="renderTargetHandle">The handle to the start of the continuous array of render targets</param>
        /// <param name="renderTargetCount">The number of render targets pointed to be <paramref name="renderTargetHandle"/></param>
        /// <param name="depthStencilHandle">The handle to the depth stencil descriptor</param>
        public void SetRenderTarget(CpuHandle renderTargetHandle, uint renderTargetCount, CpuHandle?depthStencilHandle = null)
        {
            var depthStencil = depthStencilHandle.GetValueOrDefault();

            _list.Get()->OMSetRenderTargets(
                renderTargetCount,
                &renderTargetHandle.Value,
                Windows.TRUE,
                depthStencilHandle is null ? null : &depthStencil.Value
                );
        }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new <see cref="DescriptorHandle"/>
 /// </summary>
 public DescriptorHandle(CpuHandle cpuHandle, GpuHandle gpuHandle, D3D12_DESCRIPTOR_HEAP_TYPE type)
 {
     CpuHandle     = cpuHandle;
     GpuHandle     = gpuHandle;
     IncrementSize = DeviceManager.Manager.GetDescriptorSizeForType(type);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Clear the render target
 /// </summary>
 /// <param name="rtv">The render target to clear</param>
 /// <param name="color">The RGBA color to clear it to</param>
 /// <param name="rect">The rectangle representing the section to clear</param>
 public void ClearRenderTarget(CpuHandle rtv, RgbaColor color, Rectangle rect)
 {
     _list.Get()->ClearRenderTargetView(rtv.Value, &color.R, 1, (RECT *)&rect);
 }