Exemple #1
0
        // Null if the resource is unmapped or not CPU accessible (default heap)

        /// <summary>
        /// If the resource is not currently mapped, maps the resource
        /// </summary>
        /// <param name="subresource">The subresource index to map</param>
        public unsafe void *Map(uint subresource)
        {
            // Apparently the range for map and unmap are for debugging purposes and yield no perf benefit. Maybe we could still support em
            void *pData;

            _device.ThrowIfFailed(GetResourcePointer()->Map(subresource, null, &pData));
            return(pData);
        }
Exemple #2
0
        protected override UniqueComPtr <ID3D12GraphicsCommandList> Create(ListCreationParams state)
        {
            using UniqueComPtr <ID3D12GraphicsCommandList> list = default;
            _device.ThrowIfFailed(_device.DevicePointer->CreateCommandList(
                                      0, // TODO: MULTI-GPU
                                      state.Type,
                                      state.Allocator,
                                      state.Pso,
                                      list.Iid,
                                      (void **)&list
                                      ));

            LogHelper.LogDebug($"New command list allocated (this is the #{_listCount++} list)");

            DebugHelpers.SetName(list.Ptr, $"Pooled list #{_listCount}");

            // 'ManageRent' expects closed list
            _device.ThrowIfFailed(list.Ptr->Close());

            return(list.Move());
        }
Exemple #3
0
        public void ReportDeviceLiveObjects(LiveObjectFlags flags = LiveObjectFlags.Summary)
        {
            if (!IsActive)
            {
                return;
            }

            if (!_d3d12DebugDevice.Exists)
            {
                ThrowHelper.ThrowInvalidOperationException("Cannot ReportDeviceLiveObjects because layer was not created with GraphicsLayerValidation. Try ReportLiveObjects instead");
            }
            _device.ThrowIfFailed(_d3d12DebugDevice.Ptr->ReportLiveDeviceObjects((D3D12_RLDO_FLAGS)flags));
        }