|
1 | 1 | /* |
2 | | - * Copyright 2019-2025 Diligent Graphics LLC |
| 2 | + * Copyright 2019-2026 Diligent Graphics LLC |
3 | 3 | * Copyright 2015-2019 Egor Yusov |
4 | 4 | * |
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -1856,6 +1856,17 @@ struct DeviceFeatures |
1856 | 1856 | /// Indicates if device supports formatted buffers. |
1857 | 1857 | DEVICE_FEATURE_STATE FormattedBuffers DEFAULT_INITIALIZER(DEVICE_FEATURE_STATE_DISABLED); |
1858 | 1858 |
|
| 1859 | + /// Indicates if device supports pipeline specialization constants. |
| 1860 | + |
| 1861 | + /// When this feature is enabled, applications can provide specialization |
| 1862 | + /// constants when creating a pipeline state to set constant values at |
| 1863 | + /// pipeline creation time. The driver may use these values to optimize |
| 1864 | + /// the compiled shader code. |
| 1865 | + /// |
| 1866 | + /// Vulkan and WebGPU backends support this feature. |
| 1867 | + /// D3D11, D3D12, OpenGL, and Metal backends do not. |
| 1868 | + DEVICE_FEATURE_STATE SpecializationConstants DEFAULT_INITIALIZER(DEVICE_FEATURE_STATE_DISABLED); |
| 1869 | + |
1859 | 1870 | #if DILIGENT_CPP_INTERFACE |
1860 | 1871 | constexpr DeviceFeatures() noexcept {} |
1861 | 1872 |
|
@@ -1906,11 +1917,12 @@ struct DeviceFeatures |
1906 | 1917 | Handler(TextureSubresourceViews) \ |
1907 | 1918 | Handler(NativeMultiDraw) \ |
1908 | 1919 | Handler(AsyncShaderCompilation) \ |
1909 | | - Handler(FormattedBuffers) |
| 1920 | + Handler(FormattedBuffers) \ |
| 1921 | + Handler(SpecializationConstants) |
1910 | 1922 |
|
1911 | 1923 | explicit constexpr DeviceFeatures(DEVICE_FEATURE_STATE State) noexcept |
1912 | 1924 | { |
1913 | | - static_assert(sizeof(*this) == 47, "Did you add a new feature to DeviceFeatures? Please add it to ENUMERATE_DEVICE_FEATURES."); |
| 1925 | + static_assert(sizeof(*this) == 48, "Did you add a new feature to DeviceFeatures? Please add it to ENUMERATE_DEVICE_FEATURES."); |
1914 | 1926 | #define INIT_FEATURE(Feature) Feature = State; |
1915 | 1927 | ENUMERATE_DEVICE_FEATURES(INIT_FEATURE) |
1916 | 1928 | #undef INIT_FEATURE |
|
0 commit comments