summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-10-03 04:14:03 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-10-03 04:14:03 +0000
commit2f344b7eb5527b2449f1ad0dc2a9e42ac2542b76 (patch)
treec913e8d0b7343cab19de6f1643564e30f89b77b9 /Graphics/GraphicsEngineD3D12
parentMetal interface: using id<> instead of void* (diff)
downloadDiligentCore-2f344b7eb5527b2449f1ad0dc2a9e42ac2542b76.tar.gz
DiligentCore-2f344b7eb5527b2449f1ad0dc2a9e42ac2542b76.zip
Added device features to indicate support of 16-bit types
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp
index 127abdfc..d5fc2bda 100644
--- a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp
@@ -251,8 +251,29 @@ RenderDeviceD3D12Impl::RenderDeviceD3D12Impl(IReferenceCounters* pRefCo
m_DeviceCaps.Features.MeshShaders = MeshShadersSupported ? DEVICE_FEATURE_STATE_ENABLED : DEVICE_FEATURE_STATE_DISABLED;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS4 d3d12Options4 = {};
+ m_pd3d12Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS4, &d3d12Options4, sizeof(d3d12Options4));
+
+ if (d3d12Options4.Native16BitShaderOpsSupported)
+ {
+ m_DeviceCaps.Features.ShaderFloat16 = DEVICE_FEATURE_STATE_ENABLED;
+ m_DeviceCaps.Features.ResourceBuffer16BitAccess = DEVICE_FEATURE_STATE_ENABLED;
+ m_DeviceCaps.Features.UniformBuffer16BitAccess = DEVICE_FEATURE_STATE_ENABLED;
+ m_DeviceCaps.Features.ShaderInputOutput16 = DEVICE_FEATURE_STATE_ENABLED;
+ }
+ else
+ {
+ if (EngineCI.Features.ShaderFloat16 == DEVICE_FEATURE_STATE_ENABLED ||
+ EngineCI.Features.ResourceBuffer16BitAccess == DEVICE_FEATURE_STATE_ENABLED ||
+ EngineCI.Features.UniformBuffer16BitAccess == DEVICE_FEATURE_STATE_ENABLED ||
+ EngineCI.Features.ShaderInputOutput16 == DEVICE_FEATURE_STATE_ENABLED)
+ {
+ LOG_ERROR_AND_THROW("This device/driver does not natively support 16-bit floats and ints.");
+ }
+ }
+
#if defined(_MSC_VER) && defined(_WIN64)
- static_assert(sizeof(DeviceFeatures) == 23, "Did you add a new feature to DeviceFeatures? Please handle its satus here.");
+ static_assert(sizeof(DeviceFeatures) == 27, "Did you add a new feature to DeviceFeatures? Please handle its satus here.");
#endif
auto& TexCaps = m_DeviceCaps.TexCaps;