diff options
| author | venkataram-nv <vedavamadath@nvidia.com> | 2024-07-01 10:08:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-01 10:08:04 -0700 |
| commit | 0e71a6d40d2ccdc9e6bb861e7bbdb9479dbec636 (patch) | |
| tree | 4d43b38d7c1de52caba5e48e118021dced1ac7a8 /examples/hello-world | |
| parent | d276ea3558e2ac0672a3340301d2dec6d5cf321b (diff) | |
Resource searching for examples (#4518)
Diffstat (limited to 'examples/hello-world')
| -rw-r--r-- | examples/hello-world/main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/hello-world/main.cpp b/examples/hello-world/main.cpp index d1db6008a..cdae6e92b 100644 --- a/examples/hello-world/main.cpp +++ b/examples/hello-world/main.cpp @@ -15,6 +15,8 @@ using Slang::ComPtr; +static const ExampleResources resourceBase("hello-world"); + struct HelloWorldExample { // The Vulkan functions pointers result from loading the vulkan library. @@ -137,7 +139,8 @@ int HelloWorldExample::createComputePipelineFromShader() slang::IModule* slangModule = nullptr; { ComPtr<slang::IBlob> diagnosticBlob; - slangModule = session->loadModule("hello-world", diagnosticBlob.writeRef()); + Slang::String path = resourceBase.resolveResource("hello-world.slang"); + slangModule = session->loadModule(path.getBuffer(), diagnosticBlob.writeRef()); diagnoseIfNeeded(diagnosticBlob); if (!slangModule) return -1; |
