summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-06-22 13:09:01 -0400
committerGitHub <noreply@github.com>2018-06-22 13:09:01 -0400
commitd0c9571be3a2167a9f019310aca8f7cd326972c0 (patch)
tree52aa2f14ec2c9d8d42bc6fcbd381ed9799c19533 /tools
parente66d66b88e1c6ef8499708952fcbe3ba873f6e4c (diff)
Expose macros/functionality for defining interfaces (#604)
* Added Result definitions to the slang.h * Removed slang-result.h and added slang-com-helper.h * Move slang-com-ptr.h to be publically available. * Add SLANG_IUNKNOWN macros to simplify implementing interfaces. Use the SLANG_IUNKNOWN macros to in slang.c * Removed slang-defines.h added outstanding defines to slang.h
Diffstat (limited to 'tools')
-rw-r--r--tools/render-test/circular-resource-heap-d3d12.h4
-rw-r--r--tools/render-test/d3d-util.h8
-rw-r--r--tools/render-test/descriptor-heap-d3d12.h4
-rw-r--r--tools/render-test/options.h4
-rw-r--r--tools/render-test/render-d3d11.cpp2
-rw-r--r--tools/render-test/render-d3d12.cpp2
-rw-r--r--tools/render-test/render.h5
-rw-r--r--tools/render-test/resource-d3d12.h4
-rw-r--r--tools/render-test/surface.cpp4
-rw-r--r--tools/render-test/vk-device-queue.cpp3
-rw-r--r--tools/render-test/vk-module.cpp3
-rw-r--r--tools/render-test/vk-module.h7
-rw-r--r--tools/slang-test/main.cpp5
-rw-r--r--tools/slang-test/render-api-util.cpp4
-rw-r--r--tools/slang-test/render-api-util.h4
15 files changed, 35 insertions, 28 deletions
diff --git a/tools/render-test/circular-resource-heap-d3d12.h b/tools/render-test/circular-resource-heap-d3d12.h
index 6f251c476..baa9a9b0c 100644
--- a/tools/render-test/circular-resource-heap-d3d12.h
+++ b/tools/render-test/circular-resource-heap-d3d12.h
@@ -1,6 +1,6 @@
-#pragma once
+#pragma once
-#include "../../source/core/slang-com-ptr.h"
+#include "../../slang-com-ptr.h"
#include "../../source/core/list.h"
#include "../../source/core/slang-free-list.h"
diff --git a/tools/render-test/d3d-util.h b/tools/render-test/d3d-util.h
index 51eefd151..b7a268fd8 100644
--- a/tools/render-test/d3d-util.h
+++ b/tools/render-test/d3d-util.h
@@ -1,9 +1,11 @@
-// d3d-util.h
+// d3d-util.h
#pragma once
#include <stdint.h>
-#include "../../source/core/slang-result.h"
-#include "../../source/core/slang-com-ptr.h"
+
+#include "../../slang-com-helper.h"
+
+#include "../../slang-com-ptr.h"
#include "../../source/core/list.h"
#include "render.h"
diff --git a/tools/render-test/descriptor-heap-d3d12.h b/tools/render-test/descriptor-heap-d3d12.h
index 11fb40810..1d0302d2c 100644
--- a/tools/render-test/descriptor-heap-d3d12.h
+++ b/tools/render-test/descriptor-heap-d3d12.h
@@ -1,10 +1,10 @@
-#pragma once
+#pragma once
#include <dxgi.h>
#include <d3d12.h>
-#include "../../source/core/slang-com-ptr.h"
+#include "../../slang-com-ptr.h"
namespace renderer_test {
diff --git a/tools/render-test/options.h b/tools/render-test/options.h
index 4c0f1098f..a14acec15 100644
--- a/tools/render-test/options.h
+++ b/tools/render-test/options.h
@@ -1,9 +1,9 @@
-// options.h
+// options.h
#pragma once
#include <stdint.h>
-#include "../../source/core/slang-result.h"
+#include "../../slang-com-helper.h"
#include "render.h"
diff --git a/tools/render-test/render-d3d11.cpp b/tools/render-test/render-d3d11.cpp
index 1ca293fad..109c5aca1 100644
--- a/tools/render-test/render-d3d11.cpp
+++ b/tools/render-test/render-d3d11.cpp
@@ -14,7 +14,7 @@
#include <slang.h>
-#include "../../source/core/slang-com-ptr.h"
+#include "../../slang-com-ptr.h"
// We will be rendering with Direct3D 11, so we need to include
// the Windows and D3D11 headers
diff --git a/tools/render-test/render-d3d12.cpp b/tools/render-test/render-d3d12.cpp
index 593991205..7603332b4 100644
--- a/tools/render-test/render-d3d12.cpp
+++ b/tools/render-test/render-d3d12.cpp
@@ -25,7 +25,7 @@
#include <d3d12.h>
#include <d3dcompiler.h>
-#include "../../source/core/slang-com-ptr.h"
+#include "../../slang-com-ptr.h"
#include "resource-d3d12.h"
#include "descriptor-heap-d3d12.h"
diff --git a/tools/render-test/render.h b/tools/render-test/render.h
index 2ad736c27..6a3c58a05 100644
--- a/tools/render-test/render.h
+++ b/tools/render-test/render.h
@@ -1,11 +1,12 @@
-// render.h
+// render.h
#pragma once
#include "window.h"
//#include "shader-input-layout.h"
-#include "../../source/core/slang-result.h"
+#include "../../slang-com-helper.h"
+
#include "../../source/core/smart-pointer.h"
#include "../../source/core/list.h"
diff --git a/tools/render-test/resource-d3d12.h b/tools/render-test/resource-d3d12.h
index 1de915489..1f0ba638b 100644
--- a/tools/render-test/resource-d3d12.h
+++ b/tools/render-test/resource-d3d12.h
@@ -1,4 +1,4 @@
-// resource-d3d12.h
+// resource-d3d12.h
#pragma once
#define WIN32_LEAN_AND_MEAN
@@ -10,7 +10,7 @@
#include <dxgi1_4.h>
#include <d3d12.h>
-#include "../../source/core/slang-com-ptr.h"
+#include "../../slang-com-ptr.h"
#include "d3d-util.h"
namespace renderer_test {
diff --git a/tools/render-test/surface.cpp b/tools/render-test/surface.cpp
index 4d761389a..eabe555c3 100644
--- a/tools/render-test/surface.cpp
+++ b/tools/render-test/surface.cpp
@@ -1,4 +1,4 @@
-// surface.cpp
+// surface.cpp
#include "surface.h"
#include <stdlib.h>
@@ -46,7 +46,7 @@ Slang::Result MallocSurfaceAllocator::allocate(int width, int height, Format for
uint8_t* data = (uint8_t*)::malloc(totalSize);
if (!data)
{
- return SLANG_E_MEM_OUT_OF_MEMORY;
+ return SLANG_E_OUT_OF_MEMORY;
}
surface.m_data = data;
diff --git a/tools/render-test/vk-device-queue.cpp b/tools/render-test/vk-device-queue.cpp
index 733ee6125..d40442c22 100644
--- a/tools/render-test/vk-device-queue.cpp
+++ b/tools/render-test/vk-device-queue.cpp
@@ -1,8 +1,9 @@
-// vk-device-queue.cpp
+// vk-device-queue.cpp
#include "vk-device-queue.h"
#include <stdlib.h>
#include <stdio.h>
+#include <assert.h>
namespace renderer_test {
using namespace Slang;
diff --git a/tools/render-test/vk-module.cpp b/tools/render-test/vk-module.cpp
index a10333584..e98bd08cd 100644
--- a/tools/render-test/vk-module.cpp
+++ b/tools/render-test/vk-module.cpp
@@ -1,8 +1,9 @@
-// module.cpp
+// module.cpp
#include "vk-module.h"
#include <stdlib.h>
#include <stdio.h>
+#include <assert.h>
#if SLANG_WINDOWS_FAMILY
# include <windows.h>
diff --git a/tools/render-test/vk-module.h b/tools/render-test/vk-module.h
index dd3c1eaa1..0aed2303f 100644
--- a/tools/render-test/vk-module.h
+++ b/tools/render-test/vk-module.h
@@ -1,8 +1,9 @@
-// vk-module.h
+// vk-module.h
#pragma once
-#include "../../source/core/slang-defines.h"
-#include "../../source/core/slang-result.h"
+#include "../../slang.h"
+
+#include "../../slang-com-helper.h"
#if SLANG_WINDOWS_FAMILY
# define VK_USE_PLATFORM_WIN32_KHR 1
diff --git a/tools/slang-test/main.cpp b/tools/slang-test/main.cpp
index 32f1c9d4c..12434301c 100644
--- a/tools/slang-test/main.cpp
+++ b/tools/slang-test/main.cpp
@@ -1,9 +1,10 @@
-// main.cpp
+// main.cpp
#include "../../source/core/slang-io.h"
#include "../../source/core/token-reader.h"
-#include "../../source/core/slang-result.h"
+#include "../../slang-com-helper.h"
+
#include "../../source/core/slang-string-util.h"
using namespace Slang;
diff --git a/tools/slang-test/render-api-util.cpp b/tools/slang-test/render-api-util.cpp
index b8697c54b..5f47f3b49 100644
--- a/tools/slang-test/render-api-util.cpp
+++ b/tools/slang-test/render-api-util.cpp
@@ -1,7 +1,7 @@
-
+
#include "render-api-util.h"
-#include "../../source/core/slang-defines.h"
+#include "../../slang.h"
#include "../../source/core/list.h"
#include "../../source/core/slang-string-util.h"
diff --git a/tools/slang-test/render-api-util.h b/tools/slang-test/render-api-util.h
index eec447af9..a44528faf 100644
--- a/tools/slang-test/render-api-util.h
+++ b/tools/slang-test/render-api-util.h
@@ -1,9 +1,9 @@
-#ifndef SLANG_RENDER_API_UTIL_H
+#ifndef SLANG_RENDER_API_UTIL_H
#define SLANG_RENDER_API_UTIL_H
#include "../../source/core/slang-string.h"
-#include "../../source/core/slang-result.h"
+#include "../../slang-com-helper.h"
enum class RenderApiType
{