Skip to content

Commit f0989c8

Browse files
authored
Use Vulkan API 1.0 support funcs for Vulkan API 1.0 samples memory_budget & dynamic_blending (#1124)
* Use Vulkan API 1.0 support funcs for Vulkan API 1.0 samples memory_budet & dynamic_blending * Update copyright dates for memory_budget.h and vulkan_stats_provider.cpp
1 parent 0957cfa commit f0989c8

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

framework/stats/vulkan_stats_provider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2020-2023, Broadcom Inc. and Contributors
1+
/* Copyright (c) 2020-2024, Broadcom Inc. and Contributors
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*
@@ -308,7 +308,7 @@ bool VulkanStatsProvider::is_supported(const CounterSamplingConfig &sampling_con
308308
device_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
309309
device_features.pNext = &perf_query_features;
310310

311-
vkGetPhysicalDeviceFeatures2(device.get_gpu().get_handle(), &device_features);
311+
vkGetPhysicalDeviceFeatures2KHR(device.get_gpu().get_handle(), &device_features);
312312
if (!perf_query_features.performanceCounterQueryPools)
313313
{
314314
return false;

samples/extensions/dynamic_blending/dynamic_blending.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ void DynamicBlending::request_gpu_features(vkb::PhysicalDevice &gpu)
153153
eds_feature_support = {};
154154
eds_feature_support.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT;
155155

156-
VkPhysicalDeviceFeatures2 features2{};
157-
features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
156+
VkPhysicalDeviceFeatures2KHR features2{};
157+
features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
158158
features2.pNext = &eds_feature_support;
159-
vkGetPhysicalDeviceFeatures2(gpu.get_handle(), &features2);
159+
vkGetPhysicalDeviceFeatures2KHR(gpu.get_handle(), &features2);
160160

161161
{
162162
// Only request the features that we support

samples/extensions/memory_budget/memory_budget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void MemoryBudget::initialize_device_memory_properties()
147147
physical_device_memory_budget_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT;
148148
physical_device_memory_budget_properties.pNext = nullptr;
149149
// Initialize physical device memory properties structure variables
150-
device_memory_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
150+
device_memory_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR;
151151
device_memory_properties.pNext = &physical_device_memory_budget_properties;
152152
}
153153

@@ -197,7 +197,7 @@ std::string MemoryBudget::read_memoryHeap_flags(VkMemoryHeapFlags inputVkMemoryH
197197

198198
void MemoryBudget::update_device_memory_properties()
199199
{
200-
vkGetPhysicalDeviceMemoryProperties2(get_device().get_gpu().get_handle(), &device_memory_properties);
200+
vkGetPhysicalDeviceMemoryProperties2KHR(get_device().get_gpu().get_handle(), &device_memory_properties);
201201
device_memory_heap_count = device_memory_properties.memoryProperties.memoryHeapCount;
202202

203203
device_memory_total_usage = 0;

samples/extensions/memory_budget/memory_budget.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* Copyright (c) 2019-2023, Sascha Willems
2-
* Copyright (c) 2023, Holochip Corporation
1+
/* Copyright (c) 2019-2024, Sascha Willems
2+
* Copyright (c) 2023-2024, Holochip Corporation
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -33,7 +33,7 @@ class MemoryBudget : public ApiVulkanSample
3333
private:
3434
// Memory budget extension related variables
3535
VkPhysicalDeviceMemoryBudgetPropertiesEXT physical_device_memory_budget_properties{};
36-
VkPhysicalDeviceMemoryProperties2 device_memory_properties{};
36+
VkPhysicalDeviceMemoryProperties2KHR device_memory_properties{};
3737

3838
struct ConvertedMemory
3939
{

0 commit comments

Comments
 (0)