Skip to content

Commit

Permalink
Renderer: Updates Vortice
Browse files Browse the repository at this point in the history
  • Loading branch information
SuRGeoNix committed Nov 18, 2021
1 parent c9a936d commit 57aa942
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions FlyleafLib/FlyleafLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<PackageReference Include="FFmpeg.AutoGen" Version="4.4.1" />
<PackageReference Include="NAudio.Core" Version="2.0.0" />
<PackageReference Include="NAudio.Wasapi" Version="2.0.0" />
<PackageReference Include="Vortice.D3DCompiler" Version="2.0.20-beta" />
<PackageReference Include="Vortice.Direct3D11" Version="2.0.20-beta" />
<PackageReference Include="Vortice.D3DCompiler" Version="2.1.0-beta4" />
<PackageReference Include="Vortice.Direct3D11" Version="2.1.0-beta4" />
<PackageReference Include="Vortice.Mathematics" Version="1.3.21" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions FlyleafLib/MediaFramework/MediaRenderer/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public Renderer(VideoDecoder videoDecoder, Config config, Control control = null
{
for (int adapterIndex = 0; factory.EnumAdapters1(adapterIndex, out adapter).Success; adapterIndex++)
{
if (adapter.Description1.Luid == Config.Video.GPUAdapteLuid)
if (adapter.Description1.AdapterLuid == Config.Video.GPUAdapteLuid)
break;

adapter.Dispose();
Expand Down Expand Up @@ -277,7 +277,7 @@ public Renderer(VideoDecoder videoDecoder, Config config, Control control = null
Width = Control.Width,
Height = Control.Height,
AlphaMode = AlphaMode.Ignore,
Usage = Usage.RenderTargetOutput,
BufferUsage = Usage.RenderTargetOutput,

SampleDescription = new SampleDescription(1, 0)
};
Expand Down Expand Up @@ -389,7 +389,7 @@ public static Dictionary<long, GPUAdapter> GetAdapters()
for (int adapterIndex = 0; factory.EnumAdapters1(adapterIndex, out IDXGIAdapter1 adapter).Success; adapterIndex++)
{
#if DEBUG
Utils.Log($"[#{adapterIndex+1}] {adapter.Description1.Description} (Id: {adapter.Description1.DeviceId} | Luid: {adapter.Description1.Luid}) | DVM: {adapter.Description1.DedicatedVideoMemory}");
Utils.Log($"[#{adapterIndex+1}] {adapter.Description1.Description} (Id: {adapter.Description1.DeviceId} | Luid: {adapter.Description1.AdapterLuid}) | DVM: {adapter.Description1.DedicatedVideoMemory}");
#endif

if ((adapter.Description1.Flags & AdapterFlags.Software) != AdapterFlags.None)
Expand All @@ -408,7 +408,7 @@ public static Dictionary<long, GPUAdapter> GetAdapters()
output.Dispose();
}

adapters[adapter.Description1.Luid] = new GPUAdapter() { Description = adapter.Description1.Description, Luid = adapter.Description1.Luid, HasOutput = hasOutput };
adapters[adapter.Description1.AdapterLuid] = new GPUAdapter() { Description = adapter.Description1.Description, Luid = adapter.Description1.AdapterLuid, HasOutput = hasOutput };

adapter.Dispose();
adapter = null;
Expand Down
12 changes: 6 additions & 6 deletions FlyleafLib/MediaFramework/MediaRenderer/RendererInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace FlyleafLib.MediaFramework.MediaRenderer
{
public unsafe class RendererInfo
{
public long Luid { get; set; }
public string AdapterDesc { get; set; }
public long AdapterLuid { get; set; }
public UInt64 SystemMemory { get; set; }
public UInt64 VideoMemory { get; set; }
public UInt64 SharedMemory { get; set; }
Expand All @@ -21,11 +21,11 @@ public static void Fill(Renderer renderer, IDXGIAdapter1 adapter)
{
RendererInfo ri = new RendererInfo();

ri.AdapterLuid = adapter.Description1.AdapterLuid;
ri.AdapterDesc = adapter.Description.Description;
ri.SystemMemory = (UInt64)((IntPtr)adapter.Description.DedicatedSystemMemory).ToPointer();
ri.VideoMemory = (UInt64)((IntPtr)adapter.Description.DedicatedVideoMemory).ToPointer();
ri.SharedMemory = (UInt64)((IntPtr)adapter.Description.SharedSystemMemory).ToPointer();
ri.Luid = adapter.Description1.Luid;
ri.SystemMemory = adapter.Description.DedicatedSystemMemory;
ri.VideoMemory = adapter.Description.DedicatedVideoMemory;
ri.SharedMemory = adapter.Description.SharedSystemMemory;

int maxVerticalResolution = 0;
for(int i=0; ; i++)
Expand Down Expand Up @@ -100,7 +100,7 @@ public string GetBytesReadable(UInt64 i)
public override string ToString()
{
var gcd = Utils.GCD(ScreenWidth, ScreenHeight);
return $"[Adapter-{Luid}] {AdapterDesc} System: {GetBytesReadable(SystemMemory)} Video: {GetBytesReadable(VideoMemory)} Shared: {GetBytesReadable(SharedMemory)}\r\n[Output ] {OutputName} (X={ScreenBounds.X}, Y={ScreenBounds.Y}) {ScreenWidth}x{ScreenHeight}" + (gcd > 0 ? $" [{ScreenWidth/gcd}:{ScreenHeight/gcd}]" : "");
return $"[Adapter-{AdapterLuid}] {AdapterDesc} System: {GetBytesReadable(SystemMemory)} Video: {GetBytesReadable(VideoMemory)} Shared: {GetBytesReadable(SharedMemory)}\r\n[Output ] {OutputName} (X={ScreenBounds.X}, Y={ScreenBounds.Y}) {ScreenWidth}x{ScreenHeight}" + (gcd > 0 ? $" [{ScreenWidth/gcd}:{ScreenHeight/gcd}]" : "");
}
}
}

0 comments on commit 57aa942

Please sign in to comment.