Refactor D3D12: remove ICommandQueue, IFence dependencies
This commit is contained in:
@@ -75,7 +75,7 @@ bool D3D12Device::Initialize(bool enableDebugLayer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QueryDeviceInfo();
|
||||
QueryAdapterInfo();
|
||||
m_initialized = true;
|
||||
return true;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ bool D3D12Device::CreateDevice(IDXGIAdapter1* adapter) {
|
||||
return SUCCEEDED(hr);
|
||||
}
|
||||
|
||||
void D3D12Device::QueryDeviceInfo() {
|
||||
void D3D12Device::QueryAdapterInfo() {
|
||||
if (!m_adapter) {
|
||||
return;
|
||||
}
|
||||
@@ -126,26 +126,20 @@ void D3D12Device::QueryDeviceInfo() {
|
||||
DXGI_ADAPTER_DESC1 desc;
|
||||
m_adapter->GetDesc1(&desc);
|
||||
|
||||
m_deviceInfo.vendorId = desc.VendorId;
|
||||
m_deviceInfo.deviceId = desc.DeviceId;
|
||||
m_deviceInfo.dedicatedVideoMemory = desc.DedicatedVideoMemory;
|
||||
m_deviceInfo.dedicatedSystemMemory = desc.DedicatedSystemMemory;
|
||||
m_deviceInfo.sharedSystemMemory = desc.SharedSystemMemory;
|
||||
m_deviceInfo.deviceName = desc.Description;
|
||||
|
||||
m_deviceInfo.supportsRaytracing = false;
|
||||
m_deviceInfo.supportsMeshShaders = false;
|
||||
m_deviceInfo.supportsSamplerFeedback = false;
|
||||
m_adapterInfo.vendorId = desc.VendorId;
|
||||
m_adapterInfo.deviceId = desc.DeviceId;
|
||||
m_adapterInfo.dedicatedVideoMemory = desc.DedicatedVideoMemory;
|
||||
m_adapterInfo.dedicatedSystemMemory = desc.DedicatedSystemMemory;
|
||||
m_adapterInfo.sharedSystemMemory = desc.SharedSystemMemory;
|
||||
m_adapterInfo.description = desc.Description;
|
||||
m_adapterInfo.isSoftware = (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) != 0;
|
||||
|
||||
D3D12_FEATURE_DATA_D3D12_OPTIONS5 options5 = {};
|
||||
if (SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &options5, sizeof(options5)))) {
|
||||
m_deviceInfo.supportsRaytracing = (options5.RaytracingTier != D3D12_RAYTRACING_TIER_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
D3D12_FEATURE_DATA_D3D12_OPTIONS7 options7 = {};
|
||||
if (SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &options7, sizeof(options7)))) {
|
||||
m_deviceInfo.supportsSamplerFeedback = (options7.SamplerFeedbackTier != D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED);
|
||||
m_deviceInfo.supportsMeshShaders = (options7.MeshShaderTier != D3D12_MESH_SHADER_TIER_NOT_SUPPORTED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,10 +181,6 @@ UINT D3D12Device::GetDescriptorHandleIncrementSize(DescriptorHeapType type) cons
|
||||
return m_device->GetDescriptorHandleIncrementSize(ToD3D12(type));
|
||||
}
|
||||
|
||||
void D3D12Device::GetDeviceInfo(DeviceInfo& info) const {
|
||||
info = m_deviceInfo;
|
||||
}
|
||||
|
||||
void* D3D12Device::GetNativeHandle() const {
|
||||
return m_device.Get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user