From 54d53bb63c92b75e81b41a4f2d89cb5e75df2bd4 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 7 Dec 2021 18:03:31 +0100 Subject: [PATCH] Add GraphicsDevice.IsDoublePrecisionSupportAvailable() API --- src/ComputeSharp/Graphics/GraphicsDevice.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ComputeSharp/Graphics/GraphicsDevice.cs b/src/ComputeSharp/Graphics/GraphicsDevice.cs index fb303d28..dfd55438 100644 --- a/src/ComputeSharp/Graphics/GraphicsDevice.cs +++ b/src/ComputeSharp/Graphics/GraphicsDevice.cs @@ -188,6 +188,20 @@ public sealed unsafe class GraphicsDevice : NativeObject /// internal bool IsCacheCoherentUMA { get; } + /// + /// Checks whether the current device supports double precision floating point operations in shaders. + /// + /// Whether the current device supports double precision floating point operations in shaders. + [Pure] + public bool IsDoublePrecisionSupportAvailable() + { + ThrowIfDisposed(); + + var d3D12OptionsData = this.d3D12Device.Get()->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS); + + return d3D12OptionsData.DoublePrecisionFloatShaderOps; + } + /// /// Checks whether the current device supports the creation of /// resources for a specified type .