Skip to content

Commit

Permalink
Add quad control device extensions (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
fairywreath authored Jan 5, 2025
1 parent 655d955 commit ea12d66
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/vulkan/vk-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,16 @@ struct VulkanExtendedFeatureProperties
VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV
};

// Maximal reconvergence features.
VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR shaderMaximalReconvergenceFeatures{
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR
};

// Quad control features.
VkPhysicalDeviceShaderQuadControlFeaturesKHR shaderQuadControlFeatures{
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR
};
};

struct VulkanApi
Expand Down
21 changes: 21 additions & 0 deletions src/vulkan/vk-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ Result DeviceImpl::initVulkanInstanceAndDevice(const NativeHandle* handles, bool
extendedFeatures.formats4444Features.pNext = deviceFeatures2.pNext;
deviceFeatures2.pNext = &extendedFeatures.formats4444Features;

extendedFeatures.shaderMaximalReconvergenceFeatures.pNext = deviceFeatures2.pNext;
deviceFeatures2.pNext = &extendedFeatures.shaderMaximalReconvergenceFeatures;

extendedFeatures.shaderQuadControlFeatures.pNext = deviceFeatures2.pNext;
deviceFeatures2.pNext = &extendedFeatures.shaderQuadControlFeatures;

if (VK_MAKE_VERSION(majorVersion, minorVersion, 0) >= VK_API_VERSION_1_2)
{
extendedFeatures.vulkan12Features.pNext = deviceFeatures2.pNext;
Expand Down Expand Up @@ -773,6 +779,21 @@ Result DeviceImpl::initVulkanInstanceAndDevice(const NativeHandle* handles, bool
);
}

SIMPLE_EXTENSION_FEATURE(
extendedFeatures.shaderMaximalReconvergenceFeatures,
shaderMaximalReconvergence,
VK_KHR_SHADER_MAXIMAL_RECONVERGENCE_EXTENSION_NAME,
"shader-maximal-reconvergence"
);

SIMPLE_EXTENSION_FEATURE(
extendedFeatures.shaderQuadControlFeatures,
shaderQuadControl,
VK_KHR_SHADER_QUAD_CONTROL_EXTENSION_NAME,
"shader-quad-control"
);


#undef SIMPLE_EXTENSION_FEATURE

if (extendedFeatures.vulkan12Features.shaderBufferInt64Atomics)
Expand Down

0 comments on commit ea12d66

Please sign in to comment.