Esempio n. 1
0
        public CommandBuffer(Device graphicsDevice, CommandBufferType type) : base(graphicsDevice)
        {
            Type = type;


            Recreate();

            WaitFence = new(NativeDevice, true);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new instance of the GPU DMA pusher.
        /// </summary>
        /// <param name="context">GPU context that the pusher belongs to</param>
        internal DmaPusher(GpuContext context)
        {
            _context = context;

            _ibEnable = true;

            _currentCommandBuffer = new CommandBuffer();

            _commandBufferQueue = new ConcurrentQueue <CommandBuffer>();

            _event = new AutoResetEvent(false);

            _forcePrefetchOnNext = false;

            _previousCommandBufferType = CommandBufferType.Unknown;
        }
Esempio n. 3
0
        /// <summary>
        /// Create a CommandBuffer from a GPFIFO entry.
        /// </summary>
        /// <param name="entry">The GPFIFO entry</param>
        /// <returns>A new CommandBuffer based on the GPFIFO entry</returns>
        private CommandBuffer CreateCommandBuffer(GPEntry entry)
        {
            CommandBufferType type = CommandBufferType.Prefetch;

            if (entry.Entry1Sync == Entry1Sync.Wait)
            {
                type = CommandBufferType.NoPrefetch;
            }

            ulong startAddress = ((ulong)entry.Entry0Get << 2) | ((ulong)entry.Entry1GetHi << 32);

            return(new CommandBuffer
            {
                Type = type,
                Words = null,
                EntryAddress = startAddress,
                EntryCount = (uint)entry.Entry1Length
            });
        }
Esempio n. 4
0
        /// <summary>
        /// Create a CommandBuffer from a GPFIFO entry.
        /// </summary>
        /// <param name="entry">The GPFIFO entry</param>
        /// <returns>A new CommandBuffer based on the GPFIFO entry</returns>
        private CommandBuffer CreateCommandBuffer(ulong entry)
        {
            ulong length       = (entry >> 42) & 0x1fffff;
            ulong startAddress = entry & 0xfffffffffc;

            bool noPrefetch = (entry & (1UL << 63)) != 0;

            CommandBufferType type = CommandBufferType.Prefetch;

            if (noPrefetch)
            {
                type = CommandBufferType.NoPrefetch;
            }

            return(new CommandBuffer
            {
                Type = type,
                Words = null,
                EntryAddress = startAddress,
                EntryCount = (uint)length
            });
        }
Esempio n. 5
0
        /// <summary>
        /// Pushes a GPFIFO entry.
        /// </summary>
        /// <param name="entry">GPFIFO entry</param>
        private void Push(ulong entry)
        {
            ulong length      = (entry >> 42) & 0x1fffff;
            ulong startAddres = entry & 0xfffffffffc;

            bool noPrefetch = (entry & (1UL << 63)) != 0;

            CommandBufferType type = CommandBufferType.Prefetch;

            //CommandBufferType type = CommandBufferType.NoPrefetch;

            if (noPrefetch)
            {
                type = CommandBufferType.NoPrefetch;
            }

            _commandBufferQueue.Enqueue(new CommandBuffer
            {
                Type            = type,
                WordsPrefetched = null,
                EntryAddress    = startAddres,
                EntryCount      = (uint)length
            });
        }
Esempio n. 6
0
        public CommandBuffer(Device graphicsDevice, CommandBufferType type) : base(graphicsDevice)
        {
            Type = type;

            //Recreate();
        }