diff options
| author | Yong He <yonghe@outlook.com> | 2017-11-20 05:28:22 -0500 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-11-20 05:28:22 -0500 |
| commit | d6130baa8528c0a5b2e1b10b87fe02d8fc1a1b1a (patch) | |
| tree | 6aa5b2fe3a0fbfd8d2a02b38da9ca96f9fbd10ef /tools/render-test/slang-support.cpp | |
| parent | 3dff5a53a21ab2404918e772962004767024c0f3 (diff) | |
fixup global generic parameters
1. simplify RoundUpToAlignment()
2. add new a render-compute test case to cover the situation where the entry-point interface (parameter/return types of an entry-point function) is dependent on the global generic type.
3. initial fixes to get this test case to compile (but is not producing correct HLSL output yet)
Diffstat (limited to 'tools/render-test/slang-support.cpp')
| -rw-r--r-- | tools/render-test/slang-support.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/render-test/slang-support.cpp b/tools/render-test/slang-support.cpp index 746967cb7..e26fccc34 100644 --- a/tools/render-test/slang-support.cpp +++ b/tools/render-test/slang-support.cpp @@ -82,12 +82,12 @@ struct SlangShaderCompilerWrapper : public ShaderCompiler spSetCompileFlags(slangRequest, SLANG_COMPILE_FLAG_NO_CHECKING); } ShaderProgram * result = nullptr; + Slang::List<const char*> rawTypeNames; + for (auto typeName : request.entryPointTypeArguments) + rawTypeNames.Add(typeName.Buffer()); if (request.computeShader.name) { - Slang::List<const char*> rawTypeNames; - for (auto typeName : request.entryPointTypeArguments) - rawTypeNames.Add(typeName.Buffer()); - int computeEntryPoint = spAddEntryPointEx(slangRequest, computeTranslationUnit, + int computeEntryPoint = spAddEntryPointEx(slangRequest, computeTranslationUnit, computeEntryPointName, spFindProfile(slangSession, request.computeShader.profile), (int)rawTypeNames.Count(), @@ -107,8 +107,8 @@ struct SlangShaderCompilerWrapper : public ShaderCompiler } else { - int vertexEntryPoint = spAddEntryPoint(slangRequest, vertexTranslationUnit, vertexEntryPointName, spFindProfile(slangSession, request.vertexShader.profile)); - int fragmentEntryPoint = spAddEntryPoint(slangRequest, fragmentTranslationUnit, fragmentEntryPointName, spFindProfile(slangSession, request.fragmentShader.profile)); + int vertexEntryPoint = spAddEntryPointEx(slangRequest, vertexTranslationUnit, vertexEntryPointName, spFindProfile(slangSession, request.vertexShader.profile), rawTypeNames.Count(), rawTypeNames.Buffer()); + int fragmentEntryPoint = spAddEntryPointEx(slangRequest, fragmentTranslationUnit, fragmentEntryPointName, spFindProfile(slangSession, request.fragmentShader.profile), rawTypeNames.Count(), rawTypeNames.Buffer()); int compileErr = spCompile(slangRequest); if (auto diagnostics = spGetDiagnosticOutput(slangRequest)) |
