From d0c9571be3a2167a9f019310aca8f7cd326972c0 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 22 Jun 2018 13:09:01 -0400 Subject: 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 --- tools/render-test/circular-resource-heap-d3d12.h | 4 ++-- tools/render-test/d3d-util.h | 8 +++++--- tools/render-test/descriptor-heap-d3d12.h | 4 ++-- tools/render-test/options.h | 4 ++-- tools/render-test/render-d3d11.cpp | 2 +- tools/render-test/render-d3d12.cpp | 2 +- tools/render-test/render.h | 5 +++-- tools/render-test/resource-d3d12.h | 4 ++-- tools/render-test/surface.cpp | 4 ++-- tools/render-test/vk-device-queue.cpp | 3 ++- tools/render-test/vk-module.cpp | 3 ++- tools/render-test/vk-module.h | 7 ++++--- 12 files changed, 28 insertions(+), 22 deletions(-) (limited to 'tools/render-test') 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 -#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 #include -#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 -#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 -#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 #include -#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 #include -#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 @@ -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 #include +#include 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 #include +#include #if SLANG_WINDOWS_FAMILY # include 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 -- cgit v1.2.3