summaryrefslogtreecommitdiffstats
path: root/slang.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-01-16 13:31:42 -0500
committerGitHub <noreply@github.com>2019-01-16 13:31:42 -0500
commit86e11e0e111fab60b9517056ac049bfac6e3bd25 (patch)
treef34a8343fb6a949235f1973dc873814f408987ef /slang.h
parentc260e6aa3a7dc3e6794442daacde3ae23f029e0b (diff)
Feature/external compiler reporting (#776)
* Added support for converting SlangResult to string in PlatformUtil. * * Added reportExternalCompilerError * Made external compilers use this * Made DiagnosticSink accept UnownedStringSlice * Made emitXXX compiler functions return SlangError * Use smart pointers to handle life of Com interfaces * * Make SlangResult compatible with HRESULT for some common cases. * Make PlatformUtil::appendResult return SlangResult * Compile check SLANG_RESULT. * Add tests for checking diagnostics from external compilers. * * Make external compiler tests only run on windows for now. * Added 'windows' and 'unix' categories * Added categories based on what backends are available. Will make more tests run on linux and handle case where dxcompiler is not available on appveyor. * * Added spSessionCheckPassThroughSupport * Use to determine whats available for categories for tests * Add support for outputting source filename/s when using pass through.
Diffstat (limited to 'slang.h')
-rw-r--r--slang.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/slang.h b/slang.h
index 23bc830e7..63438891b 100644
--- a/slang.h
+++ b/slang.h
@@ -615,17 +615,16 @@ extern "C"
//! SLANG_OK indicates success, and is equivalent to SLANG_MAKE_SUCCESS(SLANG_FACILITY_WIN_GENERAL, 0)
#define SLANG_OK 0
//! SLANG_FAIL is the generic failure code - meaning a serious error occurred and the call couldn't complete
-#define SLANG_FAIL SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_INTERFACE, 5)
+#define SLANG_FAIL SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_GENERAL, 0x4005)
-#define SLANG_MAKE_WIN_INTERFACE_ERROR(code) SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_INTERFACE, code)
-#define SLANG_MAKE_WIN_API_ERROR(code) SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_API, code)
+#define SLANG_MAKE_WIN_GENERAL_ERROR(code) SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_GENERAL, code)
//! Functionality is not implemented
-#define SLANG_E_NOT_IMPLEMENTED SLANG_MAKE_WIN_INTERFACE_ERROR(1)
+#define SLANG_E_NOT_IMPLEMENTED SLANG_MAKE_WIN_GENERAL_ERROR(0x4001)
//! Interface not be found
-#define SLANG_E_NO_INTERFACE SLANG_MAKE_WIN_INTERFACE_ERROR(2)
+#define SLANG_E_NO_INTERFACE SLANG_MAKE_WIN_GENERAL_ERROR(0x4002)
//! Operation was aborted (did not correctly complete)
-#define SLANG_E_ABORT SLANG_MAKE_WIN_INTERFACE_ERROR(4)
+#define SLANG_E_ABORT SLANG_MAKE_WIN_GENERAL_ERROR(0x4004)
//! Indicates that a handle passed in as parameter to a method is invalid.
#define SLANG_E_INVALID_HANDLE SLANG_MAKE_ERROR(SLANG_FACILITY_WIN_API, 6)
@@ -929,6 +928,19 @@ extern "C"
SlangCompileTarget target);
/*!
+ @brief Returns SLANG_OK if a the pass through support is supported for this session
+ @param session Session
+ @param target The compilation target to test
+ @return SLANG_OK if the target is available
+ SLANG_E_NOT_IMPLEMENTED if not implemented in this build
+ SLANG_E_NOT_FOUND if other resources (such as shared libraries) required to make target work could not be found
+ SLANG_FAIL other kinds of failures */
+ SLANG_API SlangResult spSessionCheckPassThroughSupport(
+ SlangSession* session,
+ SlangPassThrough passThrough
+ );
+
+ /*!
@brief Add new builtin declarations to be used in subsequent compiles.
*/
SLANG_API void spAddBuiltins(