Enable VK_EXT_conditional_rendering

This commit is contained in:
Marcin Mikołajczyk 2025-05-26 21:43:01 +01:00
parent e0309a4b01
commit 5eda82bbab
2 changed files with 15 additions and 1 deletions

View File

@ -212,7 +212,8 @@ bool Instance::CreateDevice() {
vk::PhysicalDeviceExtendedDynamicState3FeaturesEXT,
vk::PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT,
vk::PhysicalDevicePortabilitySubsetFeaturesKHR,
vk::PhysicalDeviceShaderAtomicFloat2FeaturesEXT>();
vk::PhysicalDeviceShaderAtomicFloat2FeaturesEXT,
vk::PhysicalDeviceConditionalRenderingFeaturesEXT>();
features = feature_chain.get().features;
const vk::StructureChain properties_chain = physical_device.getProperties2<
@ -283,6 +284,7 @@ bool Instance::CreateDevice() {
LOG_INFO(Render_Vulkan, "- shaderImageFloat32AtomicMinMax: {}",
shader_atomic_float2_features.shaderImageFloat32AtomicMinMax);
}
conditional_rendering = add_extension(VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME);
const bool calibrated_timestamps =
TRACY_GPU_ENABLED ? add_extension(VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME) : false;
@ -420,6 +422,9 @@ bool Instance::CreateDevice() {
.shaderImageFloat32AtomicMinMax =
shader_atomic_float2_features.shaderImageFloat32AtomicMinMax,
},
vk::PhysicalDeviceConditionalRenderingFeaturesEXT{
.conditionalRendering = true,
}
#ifdef __APPLE__
portability_features,
#endif
@ -452,6 +457,9 @@ bool Instance::CreateDevice() {
if (!shader_atomic_float2) {
device_chain.unlink<vk::PhysicalDeviceShaderAtomicFloat2FeaturesEXT>();
}
if (!conditional_rendering) {
device_chain.unlink<vk::PhysicalDeviceConditionalRenderingFeaturesEXT>();
}
auto [device_result, dev] = physical_device.createDeviceUnique(device_chain.get());
if (device_result != vk::Result::eSuccess) {

View File

@ -191,6 +191,11 @@ public:
return !portability_subset || portability_features.tessellationPointMode;
}
/// Returns true when VK_EXT_conditional_rendering is supported by the device
bool IsConditionalRenderingSupported() const {
return conditional_rendering;
}
/// Returns the vendor ID of the physical device
u32 GetVendorID() const {
return properties.vendorID;
@ -374,6 +379,7 @@ private:
bool amd_gcn_shader{};
bool amd_shader_trinary_minmax{};
bool shader_atomic_float2{};
bool conditional_rendering{};
bool portability_subset{};
};