diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-06-12 10:48:36 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-06-12 12:12:20 -0700 |
| commit | 5fe2cf3279c279750d4821a9fa97bdbbe876e568 (patch) | |
| tree | b929d3d7f77da2ba538846f598e7eeb0a302b0cc /tools/render-test/slang-support.cpp | |
| parent | 4d63b6fe73018ae253bbef0075478f5989ad279a (diff) | |
GLSL: get GLSL limping in `render-test`
The test case that is there right now is nominally a cross-compilation test, but for right now it uses the preprocessor to present completely different code for HLSL and GLSL compilation.
This change is really just fleshing out the OpenGL side of `render-test` enough that it can produce images using OpenGL to enable further testing.
Diffstat (limited to 'tools/render-test/slang-support.cpp')
| -rw-r--r-- | tools/render-test/slang-support.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/render-test/slang-support.cpp b/tools/render-test/slang-support.cpp index 5aafc562e..06a11ad4c 100644 --- a/tools/render-test/slang-support.cpp +++ b/tools/render-test/slang-support.cpp @@ -20,6 +20,10 @@ struct SlangShaderCompilerWrapper : public ShaderCompiler spSetCodeGenTarget(slangRequest, target); + // Define a macro so that shader code in a test can detect when it is being + // compiled as Slang source code. + spAddPreprocessorDefine(slangRequest, "__SLANG__", "1"); + int translationUnitIndex = spAddTranslationUnit(slangRequest, SLANG_SOURCE_LANGUAGE_SLANG, nullptr); spAddTranslationUnitSourceString(slangRequest, translationUnitIndex, request.source.path, request.source.text); |
