diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-11-14 12:34:18 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-13 20:34:18 -0800 |
| commit | 7b570feed42976a6e787d79a70aaf8e667745e58 (patch) | |
| tree | 7f96139f9570de1e2c5747faf6ad489e029de535 /examples | |
| parent | fdf106b543c756eebca7e90fe839fdf1902cc381 (diff) | |
Correct include dir for libslang (#5539)
This stops adding the repo root to the include path for anything linking
with slang. This enabled a bunch of convenient includes, but might lead
to confusing behavior for anyone including slang. Not to mention
differences including it from an install vs source.
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | examples/autodiff-texture/main.cpp | 6 | ||||
| -rw-r--r-- | examples/example-base/example-base.cpp | 2 | ||||
| -rw-r--r-- | examples/example-base/example-base.h | 6 | ||||
| -rw-r--r-- | examples/example-base/test-base.h | 2 | ||||
| -rw-r--r-- | examples/gpu-printing/main.cpp | 4 | ||||
| -rw-r--r-- | examples/hello-world/main.cpp | 2 | ||||
| -rw-r--r-- | examples/model-viewer/main.cpp | 10 | ||||
| -rw-r--r-- | examples/nv-aftermath-example/main.cpp | 4 | ||||
| -rw-r--r-- | examples/platform-test/main.cpp | 2 | ||||
| -rw-r--r-- | examples/ray-tracing-pipeline/main.cpp | 6 | ||||
| -rw-r--r-- | examples/ray-tracing/main.cpp | 6 | ||||
| -rw-r--r-- | examples/shader-object/main.cpp | 2 | ||||
| -rw-r--r-- | examples/shader-toy/main.cpp | 8 | ||||
| -rw-r--r-- | examples/triangle/main.cpp | 4 |
15 files changed, 33 insertions, 32 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index ad2d6f319..960db6b39 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -64,6 +64,7 @@ if(SLANG_ENABLE_EXAMPLES) slang gfx platform + stb $<$<BOOL:${SLANG_ENABLE_CUDA}>:CUDA::cuda_driver> FOLDER examples ) diff --git a/examples/autodiff-texture/main.cpp b/examples/autodiff-texture/main.cpp index d09b7dbac..647929e70 100644 --- a/examples/autodiff-texture/main.cpp +++ b/examples/autodiff-texture/main.cpp @@ -1,11 +1,11 @@ +#include "core/slang-basic.h" #include "examples/example-base/example-base.h" #include "gfx-util/shader-cursor.h" +#include "platform/vector-math.h" +#include "platform/window.h" #include "slang-com-ptr.h" #include "slang-gfx.h" #include "slang.h" -#include "source/core/slang-basic.h" -#include "tools/platform/vector-math.h" -#include "tools/platform/window.h" using namespace gfx; using namespace Slang; diff --git a/examples/example-base/example-base.cpp b/examples/example-base/example-base.cpp index 9fee95dfe..9d5f1bcae 100644 --- a/examples/example-base/example-base.cpp +++ b/examples/example-base/example-base.cpp @@ -7,7 +7,7 @@ #endif #define STB_IMAGE_IMPLEMENTATION -#include "external/stb/stb_image.h" +#include "stb_image.h" using namespace Slang; using namespace gfx; diff --git a/examples/example-base/example-base.h b/examples/example-base/example-base.h index c10231c14..0cb3de7e9 100644 --- a/examples/example-base/example-base.h +++ b/examples/example-base/example-base.h @@ -1,10 +1,10 @@ #pragma once +#include "core/slang-basic.h" +#include "core/slang-io.h" +#include "platform/window.h" #include "slang-gfx.h" -#include "source/core/slang-basic.h" -#include "source/core/slang-io.h" #include "test-base.h" -#include "tools/platform/window.h" #ifdef _WIN32 void _Win32OutputDebugString(const char* str); diff --git a/examples/example-base/test-base.h b/examples/example-base/test-base.h index 3f600eae7..293c9f0d8 100644 --- a/examples/example-base/test-base.h +++ b/examples/example-base/test-base.h @@ -1,8 +1,8 @@ #pragma once +#include "core/slang-string-util.h" #include "slang-com-ptr.h" #include "slang.h" -#include "source/core/slang-string-util.h" using Slang::ComPtr; diff --git a/examples/gpu-printing/main.cpp b/examples/gpu-printing/main.cpp index fa9f919dc..bbc300dba 100644 --- a/examples/gpu-printing/main.cpp +++ b/examples/gpu-printing/main.cpp @@ -5,12 +5,12 @@ #include <string> using Slang::ComPtr; +#include "core/slang-basic.h" #include "examples/example-base/example-base.h" #include "gfx-util/shader-cursor.h" #include "gpu-printing.h" +#include "platform/window.h" #include "slang-gfx.h" -#include "source/core/slang-basic.h" -#include "tools/platform/window.h" using namespace gfx; diff --git a/examples/hello-world/main.cpp b/examples/hello-world/main.cpp index c6774b64f..7e84d83e5 100644 --- a/examples/hello-world/main.cpp +++ b/examples/hello-world/main.cpp @@ -7,11 +7,11 @@ // The goal is to demonstrate how to use the Slang API to cross compile // shader code. // +#include "core/slang-string-util.h" #include "examples/example-base/example-base.h" #include "examples/example-base/test-base.h" #include "slang-com-ptr.h" #include "slang.h" -#include "source/core/slang-string-util.h" #include "vulkan-api.h" using Slang::ComPtr; diff --git a/examples/model-viewer/main.cpp b/examples/model-viewer/main.cpp index 0b1167a11..8b75381be 100644 --- a/examples/model-viewer/main.cpp +++ b/examples/model-viewer/main.cpp @@ -25,12 +25,12 @@ // and parameter binding. // #include "examples/example-base/example-base.h" +#include "gfx-util/shader-cursor.h" +#include "platform/gui.h" +#include "platform/model.h" +#include "platform/vector-math.h" +#include "platform/window.h" #include "slang-gfx.h" -#include "tools/gfx-util/shader-cursor.h" -#include "tools/platform/gui.h" -#include "tools/platform/model.h" -#include "tools/platform/vector-math.h" -#include "tools/platform/window.h" #include <map> #include <sstream> diff --git a/examples/nv-aftermath-example/main.cpp b/examples/nv-aftermath-example/main.cpp index 67754a911..9d85f1ff4 100644 --- a/examples/nv-aftermath-example/main.cpp +++ b/examples/nv-aftermath-example/main.cpp @@ -3,13 +3,13 @@ #include "../../source/core/slang-io.h" #include "GFSDK_Aftermath.h" #include "GFSDK_Aftermath_GpuCrashDump.h" +#include "core/slang-basic.h" #include "examples/example-base/example-base.h" #include "gfx-util/shader-cursor.h" +#include "platform/window.h" #include "slang-com-ptr.h" #include "slang-gfx.h" #include "slang.h" -#include "source/core/slang-basic.h" -#include "tools/platform/window.h" using namespace gfx; using namespace Slang; diff --git a/examples/platform-test/main.cpp b/examples/platform-test/main.cpp index daa9bbc4b..373c15e09 100644 --- a/examples/platform-test/main.cpp +++ b/examples/platform-test/main.cpp @@ -1,6 +1,6 @@ #include "examples/example-base/example-base.h" +#include "platform/window.h" #include "slang.h" -#include "tools/platform/window.h" using namespace gfx; using namespace Slang; diff --git a/examples/ray-tracing-pipeline/main.cpp b/examples/ray-tracing-pipeline/main.cpp index d32130c6a..1e55c7eb1 100644 --- a/examples/ray-tracing-pipeline/main.cpp +++ b/examples/ray-tracing-pipeline/main.cpp @@ -3,14 +3,14 @@ // This file implements an example of hardware ray-tracing using // Slang shaders and the `gfx` graphics API. +#include "core/slang-basic.h" #include "examples/example-base/example-base.h" #include "gfx-util/shader-cursor.h" +#include "platform/vector-math.h" +#include "platform/window.h" #include "slang-com-ptr.h" #include "slang-gfx.h" #include "slang.h" -#include "source/core/slang-basic.h" -#include "tools/platform/vector-math.h" -#include "tools/platform/window.h" using namespace gfx; using namespace Slang; diff --git a/examples/ray-tracing/main.cpp b/examples/ray-tracing/main.cpp index aa1e42654..7878550f8 100644 --- a/examples/ray-tracing/main.cpp +++ b/examples/ray-tracing/main.cpp @@ -3,14 +3,14 @@ // This file implements an example of hardware ray-tracing using // Slang shaders and the `gfx` graphics API. +#include "core/slang-basic.h" #include "examples/example-base/example-base.h" #include "gfx-util/shader-cursor.h" +#include "platform/vector-math.h" +#include "platform/window.h" #include "slang-com-ptr.h" #include "slang-gfx.h" #include "slang.h" -#include "source/core/slang-basic.h" -#include "tools/platform/vector-math.h" -#include "tools/platform/window.h" using namespace gfx; using namespace Slang; diff --git a/examples/shader-object/main.cpp b/examples/shader-object/main.cpp index 74d81604b..f5c02141f 100644 --- a/examples/shader-object/main.cpp +++ b/examples/shader-object/main.cpp @@ -12,10 +12,10 @@ #include "slang.h" using Slang::ComPtr; +#include "core/slang-basic.h" #include "examples/example-base/example-base.h" #include "gfx-util/shader-cursor.h" #include "slang-gfx.h" -#include "source/core/slang-basic.h" using namespace gfx; diff --git a/examples/shader-toy/main.cpp b/examples/shader-toy/main.cpp index 38212099e..1ab85c0b2 100644 --- a/examples/shader-toy/main.cpp +++ b/examples/shader-toy/main.cpp @@ -19,12 +19,12 @@ using Slang::ComPtr; // this layer is *not* required or assumed when using the Slang language, // compiler, and API. // +#include "core/slang-basic.h" #include "examples/example-base/example-base.h" +#include "gfx-util/shader-cursor.h" +#include "platform/performance-counter.h" +#include "platform/window.h" #include "slang-gfx.h" -#include "source/core/slang-basic.h" -#include "tools/gfx-util/shader-cursor.h" -#include "tools/platform/performance-counter.h" -#include "tools/platform/window.h" #include <chrono> diff --git a/examples/triangle/main.cpp b/examples/triangle/main.cpp index d5f929bf2..e77f488cc 100644 --- a/examples/triangle/main.cpp +++ b/examples/triangle/main.cpp @@ -32,12 +32,12 @@ // with Slang may depend on an application/engine making certain // design choices in their abstraction layer. // +#include "core/slang-basic.h" #include "examples/example-base/example-base.h" #include "gfx-util/shader-cursor.h" +#include "platform/window.h" #include "slang-com-ptr.h" #include "slang-gfx.h" -#include "source/core/slang-basic.h" -#include "tools/platform/window.h" using namespace gfx; using namespace Slang; |
