summaryrefslogtreecommitdiffstats
path: root/source/core/slang-platform.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-01-24 15:06:08 -0500
committerGitHub <noreply@github.com>2020-01-24 15:06:08 -0500
commitb8f294445b998eadb9b09e2b91eb462b881eaf2e (patch)
tree8607e5d2f6c2c2b4b7545a721d6d58e6e557e5c0 /source/core/slang-platform.cpp
parent394983d61efa2bf99ba96aa68a47df8927a8a634 (diff)
Texture Sample available in CUDA (#1176)
* WIP: Trying to figure out how texturing will work with CUDA. * WIP: Fixes for CUDA layout. Initial CUDA texture test. * WIP: Outputs something compilable by CUDA for TextureND.Sample * 2d texture working with CUDA. * Fix how binding for SamplerState occurs in CUDA. * Small tidy up of comments.
Diffstat (limited to 'source/core/slang-platform.cpp')
-rw-r--r--source/core/slang-platform.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/core/slang-platform.cpp b/source/core/slang-platform.cpp
index e735216f4..d02951e0b 100644
--- a/source/core/slang-platform.cpp
+++ b/source/core/slang-platform.cpp
@@ -1,4 +1,7 @@
// slang-platform.cpp
+
+#define _CRT_SECURE_NO_WARNINGS
+
#include "slang-platform.h"
#include "slang-common.h"
@@ -197,6 +200,18 @@ SLANG_COMPILE_TIME_ASSERT(E_OUTOFMEMORY == SLANG_E_OUT_OF_MEMORY);
#endif // _WIN32
+
+/* static */SlangResult PlatformUtil::getEnvironmentVariable(const UnownedStringSlice& name, StringBuilder& out)
+{
+ const char* value = getenv(String(name).getBuffer());
+ if (value)
+ {
+ out.append(value);
+ return SLANG_OK;
+ }
+ return SLANG_E_NOT_FOUND;
+}
+
/* static */PlatformKind PlatformUtil::getPlatformKind()
{
#if SLANG_WINRT