diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-04-04 18:00:16 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-04 18:00:16 -0400 |
| commit | 68c7d5cda2d6f2eb7bfb3a7e15860eb3ded25424 (patch) | |
| tree | ac4e8384108e70109b084782b414296d015f92b8 /tools/gfx/vulkan | |
| parent | 7bb2de1bc40e535fae93940113db97b5ea44a6f2 (diff) | |
Preliminary support for realtime clock (#2772)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Initial support for realtime clock.
* Add realtime-clock render feature where seems appropriate.
* Fixes to make NVAPI compile properly.
Change realtime-clock.slang check to use maths that can't overflow.
Diffstat (limited to 'tools/gfx/vulkan')
| -rw-r--r-- | tools/gfx/vulkan/vk-api.h | 5 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-device.cpp | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/gfx/vulkan/vk-api.h b/tools/gfx/vulkan/vk-api.h index af2234f55..c34372f45 100644 --- a/tools/gfx/vulkan/vk-api.h +++ b/tools/gfx/vulkan/vk-api.h @@ -270,6 +270,11 @@ struct VulkanExtendedFeatureProperties // Robustness2 features VkPhysicalDeviceRobustness2FeaturesEXT robustness2Features = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT}; + + // Clock features + VkPhysicalDeviceShaderClockFeaturesKHR clockFeatures = { + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR + }; }; struct VulkanApi diff --git a/tools/gfx/vulkan/vk-device.cpp b/tools/gfx/vulkan/vk-device.cpp index b5eec0b72..488f39be6 100644 --- a/tools/gfx/vulkan/vk-device.cpp +++ b/tools/gfx/vulkan/vk-device.cpp @@ -424,6 +424,10 @@ Result DeviceImpl::initVulkanInstanceAndDevice( extendedFeatures.robustness2Features.pNext = deviceFeatures2.pNext; deviceFeatures2.pNext = &extendedFeatures.robustness2Features; + // clock features + extendedFeatures.clockFeatures.pNext = deviceFeatures2.pNext; + deviceFeatures2.pNext = &extendedFeatures.clockFeatures; + // Atomic Float // To detect atomic float we need // https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceShaderAtomicFloatFeaturesEXT.html @@ -575,6 +579,16 @@ Result DeviceImpl::initVulkanInstanceAndDevice( m_features.add("robustness2"); } + if (extendedFeatures.clockFeatures.shaderDeviceClock) + { + deviceExtensions.add(VK_KHR_SHADER_CLOCK_EXTENSION_NAME); + + extendedFeatures.clockFeatures.pNext = (void*)deviceCreateInfo.pNext; + deviceCreateInfo.pNext = &extendedFeatures.clockFeatures; + + m_features.add("realtime-clock"); + } + VkPhysicalDeviceProperties2 extendedProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 }; VkPhysicalDeviceRayTracingPipelinePropertiesKHR rtProps = { |
