Skip to content

Fix erroneous extension_features initialization #6936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions backends/vulkan/runtime/vk_api/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ PhysicalDevice::PhysicalDevice(VkPhysicalDevice physical_device_handle)
properties{},
memory_properties{},
#ifdef VK_KHR_16bit_storage
extension_features(&shader_16bit_storage),
shader_16bit_storage{
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES},
#else
extension_features{nullptr},
#endif /* VK_KHR_16bit_storage */
#ifdef VK_KHR_8bit_storage
shader_8bit_storage{
Expand All @@ -37,6 +34,7 @@ PhysicalDevice::PhysicalDevice(VkPhysicalDevice physical_device_handle)
shader_float16_int8_types{
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR},
#endif /* VK_KHR_shader_float16_int8 */
extension_features{nullptr},
queue_families{},
num_compute_queues(0),
supports_int16_shader_types(false),
Expand All @@ -53,10 +51,13 @@ PhysicalDevice::PhysicalDevice(VkPhysicalDevice physical_device_handle)
// Create linked list to query availability of extensions

#ifdef VK_KHR_16bit_storage
extension_features = &shader_16bit_storage;
features2.pNext = &shader_16bit_storage;
#elif defined(VK_KHR_8bit_storage)
extension_features = &shader_8bit_storage;
features2.pNext = &shader_8bit_storage;
#elif defined(VK_KHR_shader_float16_int8)
extension_features = &shader_float16_int8_types;
features2.pNext = &shader_float16_int8_types;
#endif /* VK_KHR_16bit_storage */

Expand Down
6 changes: 3 additions & 3 deletions backends/vulkan/runtime/vk_api/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ struct PhysicalDevice final {
VkPhysicalDeviceProperties properties;
VkPhysicalDeviceMemoryProperties memory_properties;

// Head of the linked list of extensions to be requested
void* extension_features;

// Additional features available from extensions
#ifdef VK_KHR_16bit_storage
VkPhysicalDevice16BitStorageFeatures shader_16bit_storage;
Expand All @@ -40,6 +37,9 @@ struct PhysicalDevice final {
VkPhysicalDeviceShaderFloat16Int8Features shader_float16_int8_types;
#endif /* VK_KHR_shader_float16_int8 */

// Head of the linked list of extensions to be requested
void* extension_features;

// Available GPU queues
std::vector<VkQueueFamilyProperties> queue_families;

Expand Down
Loading