public CommandBuffer(Device graphicsDevice, CommandBufferType type) : base(graphicsDevice) { Type = type; Recreate(); WaitFence = new(NativeDevice, true); }
/// <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; }
/// <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 }); }
/// <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 }); }
/// <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 }); }
public CommandBuffer(Device graphicsDevice, CommandBufferType type) : base(graphicsDevice) { Type = type; //Recreate(); }