diff options
| author | Yong He <yonghe@outlook.com> | 2023-09-18 06:12:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-18 21:12:30 +0800 |
| commit | 8bcffcc085b996babedfeaee674c6ad09c9b08cf (patch) | |
| tree | 8e1537aca0a637c6d2a3b626f43a03fb4b085805 /examples | |
| parent | 95b470f810a5cecffee165635996fa908a38707f (diff) | |
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 <yhe@nvidia.com>
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/hello-world/main.cpp | 3 | ||||
| -rw-r--r-- | examples/hello-world/vulkan-api.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
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[] = { |
