コード例 #1
0
        /// <inheritdoc/>
        public RentedCommandAllocator Copy()
        {
            var copy = this;

            copy._value = _value.Copy();
            return(copy);
        }
コード例 #2
0
ファイル: GpuAllocator.cs プロジェクト: AmusedNetwork/Voltium
        private GpuResource AllocateCommitted(GpuResourceDesc desc, D3D12_RESOURCE_ALLOCATION_INFO allocInfo)
        {
            using var device = _device.Copy();

            var heapProperties = GetHeapProperties(desc);

            var clearVal = desc.ClearValue.GetValueOrDefault();

            using ComPtr <ID3D12Resource> resource = default;

            Guard.ThrowIfFailed(device.Get()->CreateCommittedResource(
                                    &heapProperties,
                                    desc.HeapFlags,
                                    &desc.ResourceFormat.D3D12ResourceDesc,
                                    desc.InitialState,
                                    desc.ClearValue is null ? null : &clearVal,
                                    resource.Guid,
                                    ComPtr.GetVoidAddressOf(&resource)
                                    ));

            return(new GpuResource(
                       resource.Move(),
                       desc,
                       allocInfo.SizeInBytes,
                       0,
コード例 #3
0
        public AllocatorAndMarker Copy()
        {
            var copy = this;

            copy.Allocator = Allocator.Copy();
            return(copy);
        }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public GraphicsContext Copy()
        {
            var copy = this;

            copy._list      = _list.Copy();
            copy._allocator = _allocator.Copy();
            return(copy);
        }
コード例 #5
0
        public GpuCommandSet Copy()
        {
            var copy = this;

            copy.List      = List.Copy();
            copy.Allocator = Allocator.Copy();
            return(copy);
        }
コード例 #6
0
 internal GpuDispatchSynchronizer GetSynchronizer(FenceMarker fenceMarker)
 {
     return(new GpuDispatchSynchronizer(_fence.Copy(), fenceMarker));
 }