// platform-specific implementations (methods)
        public Boolean RequestAllocator(H1CommandContext commandContext)
        {
            commandContext.Allocator = m_CommandAllocatorPool.RequestCommandAllocator();
            if (commandContext.Allocator == null)
            {
                return(false);
            }

            return(true);
        }
        public Boolean CreateCommandList(H1CommandListType type, H1CommandContext commandContext)
        {
            H1CommandContext commandContextDX12 = commandContext;

            if (commandContextDX12 == null)
            {
                return(false); // inappropriate type for command context DX12
            }
            // request command allocator from command queue and create command list
            switch (type)
            {
            case H1CommandListType.Direct:
            {
                H1CommandQueue graphicsQueueDX12 = m_GraphicsQueue;
                graphicsQueueDX12.RequestAllocator(commandContextDX12);
                commandContextDX12.CommandList = m_DeviceRef.CreateCommandList(CommandListType.Direct, commandContextDX12.Allocator, null);
                break;
            }

            case H1CommandListType.Bundle:
            {
                commandContextDX12.CommandList = m_DeviceRef.CreateCommandList(CommandListType.Bundle, null, null);
                break;
            }

            case H1CommandListType.Compute:
            {
                H1CommandQueue computeQueueDX12 = m_ComputeQueue;
                computeQueueDX12.RequestAllocator(commandContextDX12);
                commandContextDX12.CommandList = m_DeviceRef.CreateCommandList(CommandListType.Compute, commandContextDX12.Allocator, null);
                break;
            }

            case H1CommandListType.Copy:
            {
                H1CommandQueue copyQueueDX12 = m_ComputeQueue;
                copyQueueDX12.RequestAllocator(commandContextDX12);
                commandContextDX12.CommandList = m_DeviceRef.CreateCommandList(CommandListType.Copy, commandContextDX12.Allocator, null);
                break;
            }
            }

            return(true);
        }
        public Boolean UploadDirect(CpuDescriptorHandle handle, ref GpuDescriptorHandle result)
        {
            if (!HasSpace(1))
            {
                // @TODO - currently just return and make it false
                return(false);
            }

            H1CommandContext commandContextDX12 = m_CommandContextRef;

            commandContextDX12.SetDescriptorHeap(DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView, GetHeap());

            H1DescriptorHandle destHandle = m_FirstDescriptor + m_CurrOffset * GetDescriptorSize();

            m_CurrOffset += 1;

            H1Global <H1ManagedRenderer> .Instance.Device.CopyDescriptorsSimple(1, destHandle.CpuHandle, handle, DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView);

            result = destHandle.GpuHandle;

            return(true);
        }