From 8bcffcc085b996babedfeaee674c6ad09c9b08cf Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 18 Sep 2023 06:12:30 -0700 Subject: Use direct spirv in hello-world example. (#3207) * Use direct spirv in hello-world example. * Use vulkan 1.1 * Use vulkan 1.2. * fix. * Fix test. --------- Co-authored-by: Yong He --- examples/hello-world/main.cpp | 3 ++- examples/hello-world/vulkan-api.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/hello-world') diff --git a/examples/hello-world/main.cpp b/examples/hello-world/main.cpp index db243749b..95c3daa72 100644 --- a/examples/hello-world/main.cpp +++ b/examples/hello-world/main.cpp @@ -115,7 +115,8 @@ int HelloWorldExample::createComputePipelineFromShader() slang::TargetDesc targetDesc = {}; targetDesc.format = SLANG_SPIRV; targetDesc.profile = slangGlobalSession->findProfile("glsl440"); - + targetDesc.flags = SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY; + sessionDesc.targets = &targetDesc; sessionDesc.targetCount = 1; diff --git a/examples/hello-world/vulkan-api.cpp b/examples/hello-world/vulkan-api.cpp index d2d8aefa6..cc52956ce 100644 --- a/examples/hello-world/vulkan-api.cpp +++ b/examples/hello-world/vulkan-api.cpp @@ -74,7 +74,7 @@ int initializeVulkanDevice(VulkanAPI& api) VkApplicationInfo applicationInfo = {VK_STRUCTURE_TYPE_APPLICATION_INFO}; applicationInfo.pApplicationName = "slang-hello-world"; applicationInfo.pEngineName = "slang-hello-world"; - applicationInfo.apiVersion = VK_API_VERSION_1_0; + applicationInfo.apiVersion = VK_API_VERSION_1_2; applicationInfo.engineVersion = 1; applicationInfo.applicationVersion = 1; const char* instanceExtensions[] = { -- cgit v1.2.3