From b8f294445b998eadb9b09e2b91eb462b881eaf2e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 24 Jan 2020 15:06:08 -0500 Subject: 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. --- source/core/slang-platform.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/core/slang-platform.cpp') 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 -- cgit v1.2.3