Skip to content

Commit 3abbdf8

Browse files
authored
dynamic_blending: fix uninitialized eds_feature_support (KhronosGroup#1485)
Capture REQUEST_OPTIONAL_FEATURE return values into eds_feature_support so the sample correctly knows which dynamic state features are available.
1 parent a89b6f8 commit 3abbdf8

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

samples/extensions/dynamic_blending/dynamic_blending.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,15 @@ void DynamicBlending::request_gpu_features(vkb::core::PhysicalDeviceC &gpu)
153153
VkPhysicalDeviceExtendedDynamicState3FeaturesEXT,
154154
extendedDynamicState3ColorBlendEnable);
155155

156-
// Only request the features that we support
157-
REQUEST_OPTIONAL_FEATURE(gpu, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, extendedDynamicState3ColorWriteMask);
158-
REQUEST_OPTIONAL_FEATURE(gpu, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, extendedDynamicState3ColorBlendEnable);
159-
REQUEST_OPTIONAL_FEATURE(gpu, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, extendedDynamicState3ColorBlendAdvanced);
160-
REQUEST_OPTIONAL_FEATURE(gpu, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, extendedDynamicState3ColorBlendEquation);
156+
// Only request the features that we support, and record which ones are available
157+
eds_feature_support.extendedDynamicState3ColorWriteMask =
158+
REQUEST_OPTIONAL_FEATURE(gpu, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, extendedDynamicState3ColorWriteMask);
159+
eds_feature_support.extendedDynamicState3ColorBlendEnable =
160+
REQUEST_OPTIONAL_FEATURE(gpu, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, extendedDynamicState3ColorBlendEnable);
161+
eds_feature_support.extendedDynamicState3ColorBlendAdvanced =
162+
REQUEST_OPTIONAL_FEATURE(gpu, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, extendedDynamicState3ColorBlendAdvanced);
163+
eds_feature_support.extendedDynamicState3ColorBlendEquation =
164+
REQUEST_OPTIONAL_FEATURE(gpu, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, extendedDynamicState3ColorBlendEquation);
161165

162166
REQUEST_REQUIRED_FEATURE(gpu, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT, advancedBlendCoherentOperations);
163167
}

samples/extensions/dynamic_blending/dynamic_blending.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2023-2025, Mobica
1+
/* Copyright (c) 2023-2026, Mobica
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*
@@ -118,7 +118,7 @@ class DynamicBlending : public ApiVulkanSample
118118
VkDescriptorSet descriptor_set;
119119
VkPipeline pipeline;
120120

121-
VkPhysicalDeviceExtendedDynamicState3FeaturesEXT eds_feature_support;
121+
VkPhysicalDeviceExtendedDynamicState3FeaturesEXT eds_feature_support{};
122122

123123
std::array<float, 4> clear_color = {0.5f, 0.5f, 0.5f, 1.0f};
124124
int32_t current_blend_color_operator_index;

0 commit comments

Comments
 (0)