summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-02-19 10:11:01 -0800
committerGitHub <noreply@github.com>2021-02-19 10:11:01 -0800
commit5f7dc28a6d139487bab4ce61a60f12b3c53b6265 (patch)
tree6a018f40e1c8aef26b08965cc93f545803318517
parent22fe1dfed3ee6e1d0d00f0cb08b6549f771ef5cf (diff)
Make gfx library visible to external user. (#1719)
* Make gfx library visible to external user. * Fixup
-rw-r--r--.github/workflows/release-linux.yml4
-rw-r--r--.github/workflows/release-windows.yml3
-rw-r--r--build/visual-studio/gfx/gfx.vcxproj2
-rw-r--r--build/visual-studio/gfx/gfx.vcxproj.filters6
-rw-r--r--examples/gpu-printing/main.cpp2
-rw-r--r--examples/hello-world/main.cpp2
-rw-r--r--examples/heterogeneous-hello-world/main.cpp2
-rw-r--r--examples/model-viewer/main.cpp2
-rw-r--r--examples/shader-object/main.cpp2
-rw-r--r--examples/shader-toy/main.cpp2
-rw-r--r--premake5.lua2
-rw-r--r--slang-gfx.h (renamed from tools/gfx/render.h)0
-rw-r--r--tools/gfx-util/shader-cursor.h2
-rw-r--r--tools/gfx/cuda/render-cuda.cpp2
-rw-r--r--tools/gfx/d3d/d3d-util.h2
-rw-r--r--tools/gfx/renderer-shared.h2
-rw-r--r--tools/gfx/slang-context.h2
-rw-r--r--tools/gfx/vulkan/vk-swap-chain.h2
-rw-r--r--tools/gfx/vulkan/vk-util.h2
-rw-r--r--tools/graphics-app-framework/gui.h2
-rw-r--r--tools/graphics-app-framework/model.h2
-rw-r--r--tools/render-test/options.h2
-rw-r--r--tools/render-test/render-test-main.cpp2
-rw-r--r--tools/render-test/shader-input-layout.cpp2
-rw-r--r--tools/render-test/shader-input-layout.h2
-rw-r--r--tools/render-test/shader-renderer-util.h2
-rw-r--r--tools/render-test/slang-support.h2
-rw-r--r--tools/render-test/surface.h2
28 files changed, 33 insertions, 28 deletions
diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml
index d07100721..ec9dd54b1 100644
--- a/.github/workflows/release-linux.yml
+++ b/.github/workflows/release-linux.yml
@@ -34,9 +34,9 @@ jobs:
export SLANG_BINARY_ARCHIVE=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}.zip
export SLANG_BINARY_ARCHIVE_TAR=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}.tar.gz
echo "creating zip"
- zip -r ${SLANG_BINARY_ARCHIVE} bin/*/*/slangc bin/*/*/libslang.so bin/*/*/libslang-glslang.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h prelude/*.h
+ zip -r ${SLANG_BINARY_ARCHIVE} bin/*/*/slangc bin/*/*/libslang.so bin/*/*/libslang-glslang.so bin/*/*/libgfx.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h slang-gfx.h prelude/*.h
echo "creating tar"
- tar -czf ${SLANG_BINARY_ARCHIVE_TAR} bin/*/*/slangc bin/*/*/libslang.so bin/*/*/libslang-glslang.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h prelude/*.h
+ tar -czf ${SLANG_BINARY_ARCHIVE_TAR} bin/*/*/slangc bin/*/*/libslang.so bin/*/*/libslang-glslang.so bin/*/*/libgfx.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h slang-gfx.h prelude/*.h
echo "::set-output name=SLANG_BINARY_ARCHIVE::${SLANG_BINARY_ARCHIVE}"
echo "::set-output name=SLANG_BINARY_ARCHIVE_TAR::${SLANG_BINARY_ARCHIVE_TAR}"
- name: UploadBinary
diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml
index ac0d90ee6..9d8ee94ca 100644
--- a/.github/workflows/release-windows.yml
+++ b/.github/workflows/release-windows.yml
@@ -50,10 +50,12 @@ jobs:
7z a "$binArchive" slang-com-helper.h
7z a "$binArchive" slang-com-ptr.h
7z a "$binArchive" slang-tag-version.h
+ 7z a "$srcArchive" slang-gfx.h
7z a "$binArchive" prelude\*.h
7z a "$binArchive" bin\*\*\slang.dll
7z a "$binArchive" bin\*\*\slang.lib
7z a "$binArchive" bin\*\*\slang-glslang.dll
+ 7z a "$binArchive" bin\*\*\gfx.dll
7z a "$binArchive" bin\*\*\slangc.exe
7z a "$binArchive" docs\*.md
@@ -64,6 +66,7 @@ jobs:
7z a "$srcArchive" slang-com-helper.h
7z a "$srcArchive" slang-com-ptr.h
7z a "$srcArchive" slang-tag-version.h
+ 7z a "$srcArchive" slang-gfx.h
7z a "$srcArchive" prelude\*.h
7z a "$srcArchive" source\*\*.h
7z a "$srcArchive" source\*\*.cpp
diff --git a/build/visual-studio/gfx/gfx.vcxproj b/build/visual-studio/gfx/gfx.vcxproj
index 09555f45c..91c6a9441 100644
--- a/build/visual-studio/gfx/gfx.vcxproj
+++ b/build/visual-studio/gfx/gfx.vcxproj
@@ -179,6 +179,7 @@
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClInclude Include="..\..\..\slang-gfx.h" />
<ClInclude Include="..\..\..\tools\gfx\cuda\render-cuda.h" />
<ClInclude Include="..\..\..\tools\gfx\d3d\d3d-util.h" />
<ClInclude Include="..\..\..\tools\gfx\d3d11\render-d3d11.h" />
@@ -191,7 +192,6 @@
<ClInclude Include="..\..\..\tools\gfx\nvapi\nvapi-util.h" />
<ClInclude Include="..\..\..\tools\gfx\open-gl\render-gl.h" />
<ClInclude Include="..\..\..\tools\gfx\render-graphics-common.h" />
- <ClInclude Include="..\..\..\tools\gfx\render.h" />
<ClInclude Include="..\..\..\tools\gfx\renderer-shared.h" />
<ClInclude Include="..\..\..\tools\gfx\slang-context.h" />
<ClInclude Include="..\..\..\tools\gfx\vulkan\render-vk.h" />
diff --git a/build/visual-studio/gfx/gfx.vcxproj.filters b/build/visual-studio/gfx/gfx.vcxproj.filters
index d034fc847..cf800961a 100644
--- a/build/visual-studio/gfx/gfx.vcxproj.filters
+++ b/build/visual-studio/gfx/gfx.vcxproj.filters
@@ -9,6 +9,9 @@
</Filter>
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="..\..\..\slang-gfx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\..\..\tools\gfx\cuda\render-cuda.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -45,9 +48,6 @@
<ClInclude Include="..\..\..\tools\gfx\render-graphics-common.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\..\..\tools\gfx\render.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\..\..\tools\gfx\renderer-shared.h">
<Filter>Header Files</Filter>
</ClInclude>
diff --git a/examples/gpu-printing/main.cpp b/examples/gpu-printing/main.cpp
index 8dc0b0f3d..63b1939a6 100644
--- a/examples/gpu-printing/main.cpp
+++ b/examples/gpu-printing/main.cpp
@@ -5,7 +5,7 @@
#include <slang-com-ptr.h>
using Slang::ComPtr;
-#include "gfx/render.h"
+#include "slang-gfx.h"
#include "tools/graphics-app-framework/window.h"
#include "source/core/slang-basic.h"
using namespace gfx;
diff --git a/examples/hello-world/main.cpp b/examples/hello-world/main.cpp
index 91c9c0627..49fe2ec67 100644
--- a/examples/hello-world/main.cpp
+++ b/examples/hello-world/main.cpp
@@ -32,7 +32,7 @@
// with Slang may depend on an application/engine making certain
// design choices in their abstraction layer.
//
-#include "gfx/render.h"
+#include "slang-gfx.h"
#include "gfx-util/shader-cursor.h"
#include "tools/graphics-app-framework/window.h"
#include "slang-com-ptr.h"
diff --git a/examples/heterogeneous-hello-world/main.cpp b/examples/heterogeneous-hello-world/main.cpp
index 163b17deb..ff44ecc45 100644
--- a/examples/heterogeneous-hello-world/main.cpp
+++ b/examples/heterogeneous-hello-world/main.cpp
@@ -33,7 +33,7 @@
// design choices in their abstraction layer.
//
#include "slang-com-ptr.h"
-#include "gfx/render.h"
+#include "slang-gfx.h"
#include "tools/graphics-app-framework/window.h"
#include "../../prelude/slang-cpp-types.h"
#include "source/core/slang-basic.h"
diff --git a/examples/model-viewer/main.cpp b/examples/model-viewer/main.cpp
index f830d4044..f18a2cc58 100644
--- a/examples/model-viewer/main.cpp
+++ b/examples/model-viewer/main.cpp
@@ -17,7 +17,7 @@
// layer, just to keep the examples short and to the point.
//
#include "graphics-app-framework/model.h"
-#include "gfx/render.h"
+#include "slang-gfx.h"
#include "graphics-app-framework/vector-math.h"
#include "graphics-app-framework/window.h"
#include "graphics-app-framework/gui.h"
diff --git a/examples/shader-object/main.cpp b/examples/shader-object/main.cpp
index 88ae24393..b61cf30e4 100644
--- a/examples/shader-object/main.cpp
+++ b/examples/shader-object/main.cpp
@@ -12,7 +12,7 @@
#include <slang-com-ptr.h>
using Slang::ComPtr;
-#include "gfx/render.h"
+#include "slang-gfx.h"
#include "gfx-util/shader-cursor.h"
#include "source/core/slang-basic.h"
diff --git a/examples/shader-toy/main.cpp b/examples/shader-toy/main.cpp
index 2bbc59113..89aa74ccb 100644
--- a/examples/shader-toy/main.cpp
+++ b/examples/shader-toy/main.cpp
@@ -19,7 +19,7 @@ using Slang::ComPtr;
// this layer is *not* required or assumed when using the Slang language,
// compiler, and API.
//
-#include "gfx/render.h"
+#include "slang-gfx.h"
#include "tools/graphics-app-framework/window.h"
#include "source/core/slang-basic.h"
diff --git a/premake5.lua b/premake5.lua
index e3ae76fc2..b9176a7e1 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -750,6 +750,8 @@ tool "gfx"
includedirs { ".", "external", "source" }
+ files {"slang-gfx.h"}
+
-- Will compile across targets
addSourceDir "tools/gfx/nvapi"
diff --git a/tools/gfx/render.h b/slang-gfx.h
index 7b77650e8..7b77650e8 100644
--- a/tools/gfx/render.h
+++ b/slang-gfx.h
diff --git a/tools/gfx-util/shader-cursor.h b/tools/gfx-util/shader-cursor.h
index 04dddc3aa..24008cf24 100644
--- a/tools/gfx-util/shader-cursor.h
+++ b/tools/gfx-util/shader-cursor.h
@@ -1,6 +1,6 @@
#pragma once
-#include "tools/gfx/render.h"
+#include "slang-gfx.h"
namespace gfx
{
diff --git a/tools/gfx/cuda/render-cuda.cpp b/tools/gfx/cuda/render-cuda.cpp
index a64c354b5..4673cda6e 100644
--- a/tools/gfx/cuda/render-cuda.cpp
+++ b/tools/gfx/cuda/render-cuda.cpp
@@ -1358,7 +1358,7 @@ private:
return SLANG_OK;
}
- virtual SLANG_NO_THROW Result SLANG_MCALL createShaderObject(
+ virtual Result createShaderObject(
ShaderObjectLayoutBase* layout,
IShaderObject** outObject) override
{
diff --git a/tools/gfx/d3d/d3d-util.h b/tools/gfx/d3d/d3d-util.h
index 69d42418e..63a897206 100644
--- a/tools/gfx/d3d/d3d-util.h
+++ b/tools/gfx/d3d/d3d-util.h
@@ -10,7 +10,7 @@
#include "../flag-combiner.h"
-#include "../render.h"
+#include "slang-gfx.h"
#include <D3Dcommon.h>
#include <DXGIFormat.h>
diff --git a/tools/gfx/renderer-shared.h b/tools/gfx/renderer-shared.h
index 7b7a6d757..c9f2b3340 100644
--- a/tools/gfx/renderer-shared.h
+++ b/tools/gfx/renderer-shared.h
@@ -1,6 +1,6 @@
#pragma once
-#include "tools/gfx/render.h"
+#include "slang-gfx.h"
#include "slang-context.h"
#include "core/slang-basic.h"
diff --git a/tools/gfx/slang-context.h b/tools/gfx/slang-context.h
index e6168deed..909bcaa1c 100644
--- a/tools/gfx/slang-context.h
+++ b/tools/gfx/slang-context.h
@@ -1,6 +1,6 @@
#pragma once
-#include "tools/gfx/render.h"
+#include "slang-gfx.h"
namespace gfx
{
diff --git a/tools/gfx/vulkan/vk-swap-chain.h b/tools/gfx/vulkan/vk-swap-chain.h
index 893910ea6..e5162d63b 100644
--- a/tools/gfx/vulkan/vk-swap-chain.h
+++ b/tools/gfx/vulkan/vk-swap-chain.h
@@ -4,7 +4,7 @@
#include "vk-api.h"
#include "vk-device-queue.h"
-#include "../render.h"
+#include "slang-gfx.h"
#include "core/slang-list.h"
diff --git a/tools/gfx/vulkan/vk-util.h b/tools/gfx/vulkan/vk-util.h
index c8194789d..723c3fde5 100644
--- a/tools/gfx/vulkan/vk-util.h
+++ b/tools/gfx/vulkan/vk-util.h
@@ -2,7 +2,7 @@
#pragma once
#include "vk-api.h"
-#include "../render.h"
+#include "slang-gfx.h"
// Macros to make testing vulkan return codes simpler
diff --git a/tools/graphics-app-framework/gui.h b/tools/graphics-app-framework/gui.h
index 4fd1ca150..3ef2b0ba5 100644
--- a/tools/graphics-app-framework/gui.h
+++ b/tools/graphics-app-framework/gui.h
@@ -1,7 +1,7 @@
// gui.h
#pragma once
-#include "tools/gfx/render.h"
+#include "slang-gfx.h"
#include "vector-math.h"
#include "window.h"
#include "slang-com-ptr.h"
diff --git a/tools/graphics-app-framework/model.h b/tools/graphics-app-framework/model.h
index 44c8f0aab..412f10a1d 100644
--- a/tools/graphics-app-framework/model.h
+++ b/tools/graphics-app-framework/model.h
@@ -1,7 +1,7 @@
// model.h
#pragma once
-#include "tools/gfx/render.h"
+#include "slang-gfx.h"
#include "vector-math.h"
#include "slang-com-ptr.h"
#include <vector>
diff --git a/tools/render-test/options.h b/tools/render-test/options.h
index 646cf3a76..9d39e35b3 100644
--- a/tools/render-test/options.h
+++ b/tools/render-test/options.h
@@ -12,7 +12,7 @@
#include "../../source/core/slang-process-util.h"
-#include "render.h"
+#include "../../slang-gfx.h"
namespace renderer_test {
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index 8f62d8a50..7bf7dd369 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -3,7 +3,7 @@
#define _CRT_SECURE_NO_WARNINGS 1
#include "options.h"
-#include "render.h"
+#include "slang-gfx.h"
#include "tools/gfx-util/shader-cursor.h"
#include "slang-support.h"
#include "surface.h"
diff --git a/tools/render-test/shader-input-layout.cpp b/tools/render-test/shader-input-layout.cpp
index 5f43b254d..2f7162f35 100644
--- a/tools/render-test/shader-input-layout.cpp
+++ b/tools/render-test/shader-input-layout.cpp
@@ -5,7 +5,7 @@
#include "core/slang-token-reader.h"
#include "core/slang-type-text-util.h"
-#include "render.h"
+#include "slang-gfx.h"
namespace renderer_test
{
diff --git a/tools/render-test/shader-input-layout.h b/tools/render-test/shader-input-layout.h
index 51463eca6..2c8dbe821 100644
--- a/tools/render-test/shader-input-layout.h
+++ b/tools/render-test/shader-input-layout.h
@@ -9,7 +9,7 @@
#include "bind-location.h"
-#include "render.h"
+#include "slang-gfx.h"
namespace renderer_test {
diff --git a/tools/render-test/shader-renderer-util.h b/tools/render-test/shader-renderer-util.h
index 045f501c3..815bf2248 100644
--- a/tools/render-test/shader-renderer-util.h
+++ b/tools/render-test/shader-renderer-util.h
@@ -1,7 +1,7 @@
// shader-renderer-util.h
#pragma once
-#include "render.h"
+#include "slang-gfx.h"
#include "shader-input-layout.h"
namespace renderer_test {
diff --git a/tools/render-test/slang-support.h b/tools/render-test/slang-support.h
index c08d18567..6fa850874 100644
--- a/tools/render-test/slang-support.h
+++ b/tools/render-test/slang-support.h
@@ -1,7 +1,7 @@
// slang-support.h
#pragma once
-#include "render.h"
+#include "slang-gfx.h"
#include <slang.h>
diff --git a/tools/render-test/surface.h b/tools/render-test/surface.h
index 3e0f6f0aa..f6e888745 100644
--- a/tools/render-test/surface.h
+++ b/tools/render-test/surface.h
@@ -1,7 +1,7 @@
// surface.h
#pragma once
-#include "render.h"
+#include "slang-gfx.h"
namespace gfx {