public unsafe void UpdateTileMappings(
     ID3D12Resource resource,
     ReadOnlySpan <TiledResourceCoordinate> resourceRegionStartCoordinates,
     ReadOnlySpan <TileRegionSize> resourceRegionSizes,
     ID3D12Heap heap,
     ReadOnlySpan <TileRangeFlags> rangeFlags,
     ReadOnlySpan <int> heapRangeStartOffsets,
     ReadOnlySpan <int> rangeTileCounts,
     TileMappingFlags flags = TileMappingFlags.None)
 {
     fixed(TiledResourceCoordinate *pResourceRegionStartCoordinates = resourceRegionStartCoordinates)
     fixed(TileRegionSize * pResourceRegionSizes = resourceRegionSizes)
     fixed(TileRangeFlags * pRangeFlags          = rangeFlags)
     fixed(int *pHeapRangeStartOffsets           = heapRangeStartOffsets)
     fixed(int *pRangeTileCounts = rangeTileCounts)
     UpdateTileMappings(resource,
                        resourceRegionStartCoordinates.Length,
                        pResourceRegionStartCoordinates,
                        pResourceRegionSizes,
                        heap,
                        rangeFlags.Length,
                        pRangeFlags,
                        pHeapRangeStartOffsets,
                        pRangeTileCounts,
                        flags);
 }
Пример #2
0
        public ID3D12Resource CreatePlacedResource(
            ID3D12Heap heap,
            ulong heapOffset,
            ResourceDescription resourceDescription,
            ResourceStates initialState,
            ClearValue?clearValue = null)
        {
            Guard.NotNull(heap, nameof(heap));

            return(CreatePlacedResource(heap, heapOffset, ref resourceDescription, initialState, clearValue, typeof(ID3D12Resource).GUID));
        }
    public T?CreatePlacedResource1 <T>(ID3D12Heap heap, ulong heapOffset, ResourceDescription1 description, ResourceStates initialState, ClearValue?optimizedClearValue = null) where T : ID3D12Resource
    {
        Result result = CreatePlacedResource1(
            heap,
            heapOffset,
            ref description,
            initialState,
            optimizedClearValue,
            typeof(T).GUID, out IntPtr nativePtr);

        if (result.Success)
        {
            return(MarshallingHelpers.FromPointer <T>(nativePtr));
        }

        return(default);
 public void UpdateTileMappings(
     ID3D12Resource resource,
     TiledResourceCoordinate[] resourceRegionStartCoordinates,
     TileRegionSize[] resourceRegionSizes,
     ID3D12Heap heap,
     TileRangeFlags[] rangeFlags,
     int[] heapRangeStartOffsets,
     int[] rangeTileCounts,
     TileMappingFlags flags = TileMappingFlags.None)
 {
     UpdateTileMappings(resource,
                        resourceRegionStartCoordinates.Length,
                        resourceRegionStartCoordinates,
                        resourceRegionSizes,
                        heap,
                        rangeFlags.Length,
                        rangeFlags,
                        heapRangeStartOffsets,
                        rangeTileCounts,
                        flags);
 }