private void QueryControl(NvGpuVmm vmm, GpuMethodCall methCall) { WriteRegister(methCall); long position = MakeInt64From2xInt32(NvGpuEngine3dReg.QueryAddress); int seq = Registers[(int)NvGpuEngine3dReg.QuerySequence]; int ctrl = Registers[(int)NvGpuEngine3dReg.QueryControl]; QueryMode mode = (QueryMode)(ctrl & 3); switch (mode) { case QueryMode.WriteSeq: vmm.WriteInt32(position, seq); break; case QueryMode.WriteCounterAndTimestamp: { // TODO: Implement counters. long counter = 1; long timestamp = PerformanceCounter.ElapsedMilliseconds; vmm.WriteInt64(position + 0, counter); vmm.WriteInt64(position + 8, timestamp); break; } } }
private void QueryControl(NvGpuVmm Vmm, NvGpuPBEntry PBEntry) { WriteRegister(PBEntry); long Position = MakeInt64From2xInt32(NvGpuEngine3dReg.QueryAddress); int Seq = Registers[(int)NvGpuEngine3dReg.QuerySequence]; int Ctrl = Registers[(int)NvGpuEngine3dReg.QueryControl]; QueryMode Mode = (QueryMode)(Ctrl & 3); switch (Mode) { case QueryMode.WriteSeq: Vmm.WriteInt32(Position, Seq); break; case QueryMode.WriteCounterAndTimestamp: { //TODO: Implement counters. long Counter = 1; long Timestamp = (uint)Environment.TickCount; Timestamp = (long)(Timestamp * 615384.615385); Vmm.WriteInt64(Position + 0, Counter); Vmm.WriteInt64(Position + 8, Timestamp); break; } } }
private void QueryControl(NvGpuVmm Vmm, GpuMethodCall MethCall) { WriteRegister(MethCall); long Position = MakeInt64From2xInt32(NvGpuEngine3dReg.QueryAddress); int Seq = Registers[(int)NvGpuEngine3dReg.QuerySequence]; int Ctrl = Registers[(int)NvGpuEngine3dReg.QueryControl]; QueryMode Mode = (QueryMode)(Ctrl & 3); switch (Mode) { case QueryMode.WriteSeq: Vmm.WriteInt32(Position, Seq); break; case QueryMode.WriteCounterAndTimestamp: { //TODO: Implement counters. long Counter = 1; long Timestamp = PerformanceCounter.ElapsedMilliseconds; Timestamp = (long)(Timestamp * 615384.615385); Vmm.WriteInt64(Position + 0, Counter); Vmm.WriteInt64(Position + 8, Timestamp); break; } } }
private void CbData(NvGpuVmm vmm, GpuMethodCall methCall) { long position = MakeInt64From2xInt32(NvGpuEngine3dReg.ConstBufferAddress); int offset = ReadRegister(NvGpuEngine3dReg.ConstBufferOffset); vmm.WriteInt32(position + offset, methCall.Argument); WriteRegister(NvGpuEngine3dReg.ConstBufferOffset, offset + 4); _gpu.ResourceManager.ClearPbCache(NvGpuBufferType.ConstBuffer); }
private void CbData(NvGpuVmm Vmm, NvGpuPBEntry PBEntry) { long Position = MakeInt64From2xInt32(NvGpuEngine3dReg.ConstBufferAddress); int Offset = ReadRegister(NvGpuEngine3dReg.ConstBufferOffset); foreach (int Arg in PBEntry.Arguments) { Vmm.WriteInt32(Position + Offset, Arg); Offset += 4; } WriteRegister(NvGpuEngine3dReg.ConstBufferOffset, Offset); }
private void QueryControl(NvGpuVmm Vmm, NvGpuPBEntry PBEntry) { long Position = MakeInt64From2xInt32(NvGpuEngine3dReg.QueryAddress); int Seq = Registers[(int)NvGpuEngine3dReg.QuerySequence]; int Ctrl = Registers[(int)NvGpuEngine3dReg.QueryControl]; int Mode = Ctrl & 3; if (Mode == 0) { //Write mode. Vmm.WriteInt32(Position, Seq); } WriteRegister(PBEntry); }
private void Execute(NvGpuVmm Vmm, NvGpuPBEntry PBEntry) { //TODO: Some registers and copy modes are still not implemented. int Control = PBEntry.Arguments[0]; long DstAddress = MakeInt64From2xInt32(NvGpuEngineP2mfReg.DstAddress); int LineLengthIn = ReadRegister(NvGpuEngineP2mfReg.LineLengthIn); DataBuffer = null; Gpu.Fifo.Step(); for (int Offset = 0; Offset < LineLengthIn; Offset += 4) { Vmm.WriteInt32(DstAddress + Offset, DataBuffer[Offset >> 2]); } }