public static GalTextureSampler MakeSampler(NvGpu Gpu, NvGpuVmm Vmm, long TscPosition) { int[] Tsc = ReadWords(Vmm, TscPosition, 8); GalTextureWrap AddressU = (GalTextureWrap)((Tsc[0] >> 0) & 7); GalTextureWrap AddressV = (GalTextureWrap)((Tsc[0] >> 3) & 7); GalTextureWrap AddressP = (GalTextureWrap)((Tsc[0] >> 6) & 7); GalTextureFilter MagFilter = (GalTextureFilter)((Tsc[1] >> 0) & 3); GalTextureFilter MinFilter = (GalTextureFilter)((Tsc[1] >> 4) & 3); GalTextureMipFilter MipFilter = (GalTextureMipFilter)((Tsc[1] >> 6) & 3); GalColorF BorderColor = new GalColorF( BitConverter.Int32BitsToSingle(Tsc[4]), BitConverter.Int32BitsToSingle(Tsc[5]), BitConverter.Int32BitsToSingle(Tsc[6]), BitConverter.Int32BitsToSingle(Tsc[7])); return(new GalTextureSampler( AddressU, AddressV, AddressP, MinFilter, MagFilter, MipFilter, BorderColor)); }
public Switch(IGalRenderer Renderer, IAalOutput AudioOut) { if (Renderer == null) { throw new ArgumentNullException(nameof(Renderer)); } if (AudioOut == null) { throw new ArgumentNullException(nameof(AudioOut)); } this.AudioOut = AudioOut; Log = new Logger(); Gpu = new NvGpu(Renderer); VFs = new VirtualFileSystem(); Os = new Horizon(this); Settings = new SystemSettings(); Statistics = new PerformanceStatistics(); Hid = new Hid(Log); Os.HidSharedMem.MemoryMapped += Hid.ShMemMap; Os.HidSharedMem.MemoryUnmapped += Hid.ShMemUnmap; }
public Switch(IGalRenderer Renderer, IAalOutput AudioOut) { if (Renderer == null) { throw new ArgumentNullException(nameof(Renderer)); } if (AudioOut == null) { throw new ArgumentNullException(nameof(AudioOut)); } this.AudioOut = AudioOut; Log = new Logger(); Memory = new DeviceMemory(); Gpu = new NvGpu(Renderer); FileSystem = new VirtualFileSystem(); System = new Horizon(this); Statistics = new PerformanceStatistics(); Hid = new Hid(this, System.HidSharedMem.PA); }
public Switch(IGalRenderer Renderer, IAalOutput AudioOut) { if (Renderer == null) { throw new ArgumentNullException(nameof(Renderer)); } if (AudioOut == null) { throw new ArgumentNullException(nameof(AudioOut)); } this.AudioOut = AudioOut; Memory = new DeviceMemory(); Gpu = new NvGpu(Renderer); FileSystem = new VirtualFileSystem(); System = new Horizon(this); Statistics = new PerformanceStatistics(); Hid = new Hid(this, System.HidBaseAddress); VsyncEvent = new AutoResetEvent(true); }
public VideoDecoder(NvGpu gpu) { _gpu = gpu; _h264Decoder = new H264Decoder(); _vp9Decoder = new Vp9Decoder(); }
public NvGpuEngine3d(NvGpu Gpu) { this.Gpu = Gpu; Registers = new int[0xe00]; Methods = new Dictionary <int, NvGpuMethod>(); void AddMethod(int Meth, int Count, int Stride, NvGpuMethod Method) { while (Count-- > 0) { Methods.Add(Meth, Method); Meth += Stride; } } AddMethod(0x585, 1, 1, VertexEndGl); AddMethod(0x674, 1, 1, ClearBuffers); AddMethod(0x6c3, 1, 1, QueryControl); AddMethod(0x8e4, 16, 1, CbData); AddMethod(0x904, 5, 8, CbBind); ConstBuffers = new ConstBuffer[6][]; for (int Index = 0; Index < ConstBuffers.Length; Index++) { ConstBuffers[Index] = new ConstBuffer[18]; } FrameBuffers = new HashSet <long>(); }
public static GalTextureSampler MakeSampler(NvGpu gpu, NvGpuVmm vmm, long tscPosition) { int[] tsc = ReadWords(vmm, tscPosition, 8); GalTextureWrap addressU = (GalTextureWrap)((tsc[0] >> 0) & 7); GalTextureWrap addressV = (GalTextureWrap)((tsc[0] >> 3) & 7); GalTextureWrap addressP = (GalTextureWrap)((tsc[0] >> 6) & 7); bool depthCompare = ((tsc[0] >> 9) & 1) == 1; DepthCompareFunc depthCompareFunc = (DepthCompareFunc)((tsc[0] >> 10) & 7); GalTextureFilter magFilter = (GalTextureFilter)((tsc[1] >> 0) & 3); GalTextureFilter minFilter = (GalTextureFilter)((tsc[1] >> 4) & 3); GalTextureMipFilter mipFilter = (GalTextureMipFilter)((tsc[1] >> 6) & 3); GalColorF borderColor = new GalColorF( BitConverter.Int32BitsToSingle(tsc[4]), BitConverter.Int32BitsToSingle(tsc[5]), BitConverter.Int32BitsToSingle(tsc[6]), BitConverter.Int32BitsToSingle(tsc[7])); return(new GalTextureSampler( addressU, addressV, addressP, minFilter, magFilter, mipFilter, borderColor, depthCompare, depthCompareFunc)); }
public VideoDecoder(NvGpu Gpu) { this.Gpu = Gpu; H264Decoder = new H264Decoder(); Vp9Decoder = new Vp9Decoder(); }
public NvHostChannelDeviceFile(ServiceCtx context) : base(context) { _gpu = context.Device.Gpu; _memory = context.Memory; _timeout = 3000; _submitTimeout = 0; _timeslice = 0; }
public NvGpuFifo(NvGpu Gpu) { this.Gpu = Gpu; SubChannels = new NvGpuEngine[8]; Macros = new CachedMacro[MacrosCount]; Mme = new int[MmeWords]; }
public NvGpuFifo(NvGpu gpu) { _gpu = gpu; _subChannels = new NvGpuEngine[8]; _macros = new CachedMacro[MacrosCount]; _mme = new int[MmeWords]; }
public NvGpuEngine3d(NvGpu gpu) { _gpu = gpu; Registers = new int[0xe00]; _methods = new Dictionary <int, NvGpuMethod>(); void AddMethod(int meth, int count, int stride, NvGpuMethod method) { while (count-- > 0) { _methods.Add(meth, method); meth += stride; } } AddMethod(0x585, 1, 1, VertexEndGl); AddMethod(0x674, 1, 1, ClearBuffers); AddMethod(0x6c3, 1, 1, QueryControl); AddMethod(0x8e4, 16, 1, CbData); AddMethod(0x904, 5, 8, CbBind); _constBuffers = new ConstBuffer[6][]; for (int index = 0; index < _constBuffers.Length; index++) { _constBuffers[index] = new ConstBuffer[18]; } // Ensure that all components are enabled by default. // FIXME: Is this correct? WriteRegister(NvGpuEngine3dReg.ColorMaskN, 0x1111); WriteRegister(NvGpuEngine3dReg.FrameBufferSrgb, 1); WriteRegister(NvGpuEngine3dReg.FrontFace, (int)GalFrontFace.Cw); for (int index = 0; index < GalPipelineState.RenderTargetsCount; index++) { WriteRegister(NvGpuEngine3dReg.IBlendNEquationRgb + index * 8, (int)GalBlendEquation.FuncAdd); WriteRegister(NvGpuEngine3dReg.IBlendNFuncSrcRgb + index * 8, (int)GalBlendFactor.One); WriteRegister(NvGpuEngine3dReg.IBlendNFuncDstRgb + index * 8, (int)GalBlendFactor.Zero); WriteRegister(NvGpuEngine3dReg.IBlendNEquationAlpha + index * 8, (int)GalBlendEquation.FuncAdd); WriteRegister(NvGpuEngine3dReg.IBlendNFuncSrcAlpha + index * 8, (int)GalBlendFactor.One); WriteRegister(NvGpuEngine3dReg.IBlendNFuncDstAlpha + index * 8, (int)GalBlendFactor.Zero); } }
public List <NvGpu> GetGpus() { List <NvGpu> results = new List <NvGpu>(); try { if (NvmlInit()) { _nvmlDevices.Clear(); uint deviceCount = 0; var r = NvmlNativeMethods.nvmlDeviceGetCount(ref deviceCount); CheckResult(r, () => $"{nameof(NvmlNativeMethods.nvmlDeviceGetCount)} {r.ToString()}"); for (int i = 0; i < deviceCount; i++) { NvGpu gpu = new NvGpu { GpuIndex = i }; nvmlDevice nvmlDevice = new nvmlDevice(); r = NvmlNativeMethods.nvmlDeviceGetHandleByIndex((uint)i, ref nvmlDevice); _nvmlDevices.Add(nvmlDevice); CheckResult(r, () => $"{nameof(NvmlNativeMethods.nvmlDeviceGetHandleByIndex)}({((uint)i).ToString()}) {r.ToString()}"); r = NvmlNativeMethods.nvmlDeviceGetName(nvmlDevice, out string name); CheckResult(r, () => $"{nameof(NvmlNativeMethods.nvmlDeviceGetName)} {r.ToString()}"); nvmlMemory memory = new nvmlMemory(); r = NvmlNativeMethods.nvmlDeviceGetMemoryInfo(nvmlDevice, ref memory); CheckResult(r, () => $"{nameof(NvmlNativeMethods.nvmlDeviceGetMemoryInfo)} {r.ToString()}"); // short gpu name if (!string.IsNullOrEmpty(name)) { name = name.Replace("GeForce GTX ", string.Empty); name = name.Replace("GeForce ", string.Empty); } nvmlPciInfo pci = new nvmlPciInfo(); r = NvmlNativeMethods.nvmlDeviceGetPciInfo(nvmlDevice, ref pci); CheckResult(r, () => $"{nameof(NvmlNativeMethods.nvmlDeviceGetPciInfo)} {r.ToString()}"); gpu.Name = name; gpu.BusId = (int)pci.bus; gpu.TotalMemory = memory.total; results.Add(gpu); } } } catch { } return(results); }
public NvGpuEngineM2mf(NvGpu gpu) { _gpu = gpu; Registers = new int[0x1d6]; _methods = new Dictionary <int, NvGpuMethod>(); void AddMethod(int meth, int count, int stride, NvGpuMethod method) { while (count-- > 0) { _methods.Add(meth, method); meth += stride; } } AddMethod(0xc0, 1, 1, Execute); }
public NvGpuEngine2d(NvGpu Gpu) { this.Gpu = Gpu; Registers = new int[0xe00]; Methods = new Dictionary <int, NvGpuMethod>(); void AddMethod(int Meth, int Count, int Stride, NvGpuMethod Method) { while (Count-- > 0) { Methods.Add(Meth, Method); Meth += Stride; } } AddMethod(0xb5, 1, 1, TextureCopy); }
public NvGpuEngineM2mf(NvGpu Gpu) { this.Gpu = Gpu; Registers = new int[0x1d6]; Methods = new Dictionary <int, NvGpuMethod>(); void AddMethod(int Meth, int Count, int Stride, NvGpuMethod Method) { while (Count-- > 0) { Methods.Add(Meth, Method); Meth += Stride; } } AddMethod(0xc0, 1, 1, Execute); }
public NvGpuEngine2d(NvGpu Gpu) { this.Gpu = Gpu; Registers = new int[0x238]; }
public VideoImageComposer(NvGpu gpu) { _gpu = gpu; }
public VideoImageComposer(NvGpu Gpu) { this.Gpu = Gpu; }
public NvGpuEngine2d(NvGpu gpu) { _gpu = gpu; Registers = new int[0x238]; }