Updated TerraFX, code refactoring
このコミットが含まれているのは:
1 親
af58c210c1
コミット
3cfec22d8c
7ファイル変更
+23
-43
検索条件に一致するファイルはありません
@@ -95,11 +95,9 @@ namespace ComputeSharp.Graphics.Helpers
|
||||
{
|
||||
this.isInitialized = true;
|
||||
|
||||
Guid dxgiFactory4Guid = FX.IID_IDXGIFactory4;
|
||||
|
||||
fixed (IDXGIFactory4** dxgiFactory4 = this.dxgiFactory4)
|
||||
{
|
||||
FX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, &dxgiFactory4Guid, (void**)dxgiFactory4).Assert();
|
||||
FX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, FX.__uuidof<IDXGIFactory4>(), (void**)dxgiFactory4).Assert();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,12 +122,10 @@ namespace ComputeSharp.Graphics.Helpers
|
||||
|
||||
if (dxgiDescription1.DedicatedVideoMemory == 0) continue;
|
||||
|
||||
Guid d3d12DeviceGuid = FX.IID_ID3D12Device;
|
||||
|
||||
HRESULT createDeviceResult = FX.D3D12CreateDevice(
|
||||
dxgiAdapter1.Upcast<IDXGIAdapter1, IUnknown>().Get(),
|
||||
D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_12_0,
|
||||
&d3d12DeviceGuid,
|
||||
FX.__uuidof<ID3D12Device>(),
|
||||
null);
|
||||
|
||||
if (FX.SUCCEEDED(createDeviceResult) &&
|
||||
@@ -140,7 +136,7 @@ namespace ComputeSharp.Graphics.Helpers
|
||||
FX.D3D12CreateDevice(
|
||||
dxgiAdapter1.Upcast<IDXGIAdapter1, IUnknown>().Get(),
|
||||
D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_12_0,
|
||||
&d3d12DeviceGuid,
|
||||
FX.__uuidof<ID3D12Device>(),
|
||||
d3d12device.GetVoidAddressOf()).Assert();
|
||||
|
||||
this.graphicsDevice = GetOrCreateDevice(d3d12device.Move(), &dxgiDescription1);
|
||||
|
||||
@@ -70,11 +70,9 @@ namespace ComputeSharp.Graphics.Helpers
|
||||
{
|
||||
using ComPtr<IDXGIFactory4> dxgiFactory4 = default;
|
||||
|
||||
Guid dxgiFactory4Guid = FX.IID_IDXGIFactory4;
|
||||
|
||||
EnableDebugMode();
|
||||
|
||||
FX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, &dxgiFactory4Guid, dxgiFactory4.GetVoidAddressOf()).Assert();
|
||||
FX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, FX.__uuidof<IDXGIFactory4>(), dxgiFactory4.GetVoidAddressOf()).Assert();
|
||||
|
||||
uint i = 0;
|
||||
|
||||
@@ -95,12 +93,10 @@ namespace ComputeSharp.Graphics.Helpers
|
||||
|
||||
if (dxgiDescription1->DedicatedVideoMemory == 0) continue;
|
||||
|
||||
Guid d3d12DeviceGuid = FX.IID_ID3D12Device;
|
||||
|
||||
HRESULT createDeviceResult = FX.D3D12CreateDevice(
|
||||
dxgiAdapter1.Upcast<IDXGIAdapter1, IUnknown>().Get(),
|
||||
D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_12_0,
|
||||
&d3d12DeviceGuid,
|
||||
FX.__uuidof<ID3D12Device>(),
|
||||
(void**)d3d12device);
|
||||
|
||||
if (FX.SUCCEEDED(createDeviceResult))
|
||||
@@ -129,14 +125,10 @@ namespace ComputeSharp.Graphics.Helpers
|
||||
using ComPtr<ID3D12Debug> d3D12Debug = default;
|
||||
using ComPtr<ID3D12Debug1> d3D12Debug1 = default;
|
||||
|
||||
Guid d3D12DebugGuid = FX.IID_ID3D12Debug;
|
||||
|
||||
FX.D3D12GetDebugInterface(&d3D12DebugGuid, d3D12Debug.GetVoidAddressOf()).Assert();
|
||||
FX.D3D12GetDebugInterface(FX.__uuidof<ID3D12Debug>(), d3D12Debug.GetVoidAddressOf()).Assert();
|
||||
|
||||
d3D12Debug.Get()->EnableDebugLayer();
|
||||
|
||||
Guid d3D12Debug1Guid = FX.IID_ID3D12Debug1;
|
||||
|
||||
if (FX.SUCCEEDED(d3D12Debug.CopyTo(d3D12Debug1.GetAddressOf())))
|
||||
{
|
||||
d3D12Debug1.Get()->SetEnableGPUBasedValidation(FX.TRUE);
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする