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 T CreateCommittedResource2 <T>(
        HeapProperties heapProperties,
        HeapFlags heapFlags,
        ResourceDescription1 description,
        ResourceStates initialResourceState,
        ID3D12ProtectedResourceSession protectedSession) where T : ID3D12Resource
    {
        CreateCommittedResource2(
            ref heapProperties,
            heapFlags,
            ref description,
            initialResourceState,
            null,
            protectedSession,
            typeof(T).GUID, out IntPtr nativePtr).CheckError();

        return(MarshallingHelpers.FromPointer <T>(nativePtr));
    }
        public T CreateCommittedResource2 <T>(
            HeapProperties heapProperties,
            HeapFlags heapFlags,
            ResourceDescription1 description,
            ResourceStates initialResourceState,
            ClearValue?optimizedClearValue,
            ID3D12ProtectedResourceSession protectedSession) where T : ID3D12Resource
        {
            var result = CreateCommittedResource2(
                ref heapProperties,
                heapFlags,
                ref description,
                initialResourceState,
                optimizedClearValue,
                protectedSession,
                typeof(T).GUID, out var nativePtr);

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

            return(default);