Пример #1
0
        /// <inheritdoc/>
        public RentedCommandAllocator Copy()
        {
            var copy = this;

            copy._value = _value.Copy();
            return(copy);
        }
Пример #2
0
        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);
        }
 internal GpuDispatchSynchronizer GetSynchronizer(FenceMarker fenceMarker)
 {
     return(new GpuDispatchSynchronizer(_fence.Copy(), fenceMarker));
 }