Update samples on PhysicalDeviceMemoryProperties
This commit is contained in:
@@ -12,26 +12,24 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if(!MSVC)
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
|
||||
project(PhysicalDeviceMemoryProperties)
|
||||
project(PhysicalDeviceMemoryProperties)
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
PhysicalDeviceMemoryProperties.cpp
|
||||
)
|
||||
set(SOURCES
|
||||
PhysicalDeviceMemoryProperties.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(PhysicalDeviceMemoryProperties
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
add_executable(PhysicalDeviceMemoryProperties
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(PhysicalDeviceMemoryProperties PROPERTIES FOLDER "Samples")
|
||||
target_link_libraries(PhysicalDeviceMemoryProperties PRIVATE utils)
|
||||
endif(!MSVC)
|
||||
set_target_properties(PhysicalDeviceMemoryProperties PROPERTIES FOLDER "Samples")
|
||||
target_link_libraries(PhysicalDeviceMemoryProperties PRIVATE utils)
|
||||
|
||||
@@ -50,13 +50,14 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
{
|
||||
try
|
||||
{
|
||||
vk::UniqueInstance instance = vk::su::createInstance( AppName, EngineName, {}, {}, VK_API_VERSION_1_1 );
|
||||
vk::Instance instance = vk::su::createInstance( AppName, EngineName, {}, {}, VK_API_VERSION_1_1 );
|
||||
#if !defined( NDEBUG )
|
||||
vk::UniqueDebugUtilsMessengerEXT debugUtilsMessenger = vk::su::createDebugUtilsMessenger( instance );
|
||||
vk::DebugUtilsMessengerEXT debugUtilsMessenger =
|
||||
instance.createDebugUtilsMessengerEXT( vk::su::makeDebugUtilsMessengerCreateInfoEXT() );
|
||||
#endif
|
||||
|
||||
// enumerate the physicalDevices
|
||||
std::vector<vk::PhysicalDevice> physicalDevices = instance->enumeratePhysicalDevices();
|
||||
std::vector<vk::PhysicalDevice> physicalDevices = instance.enumeratePhysicalDevices();
|
||||
|
||||
/* VULKAN_KEY_START */
|
||||
|
||||
@@ -95,6 +96,11 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
}
|
||||
|
||||
/* VULKAN_KEY_END */
|
||||
|
||||
#if !defined( NDEBUG )
|
||||
instance.destroyDebugUtilsMessengerEXT( debugUtilsMessenger );
|
||||
#endif
|
||||
instance.destroy();
|
||||
}
|
||||
catch ( vk::SystemError & err )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user