diff options
| author | Yong He <yonghe@outlook.com> | 2025-02-27 16:57:52 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-27 16:57:52 -0800 |
| commit | 6f2ce72b038b34e84819ddfc5d658166ed879eaa (patch) | |
| tree | 486a85523114a428ccf4deee05bcbab0d4b9528b /source/slang/slang-compiler.cpp | |
| parent | 90b3817498d9cf664346f04dcea71f48ce81993e (diff) | |
Map `SV_InstanceID` to `gl_InstanceIndex-gl_BaseInstance` (#6468)
* Map `SV_InstanceID` to `gl_InstanceIndex-gl_BaseInstance`
* Fix ci.
Diffstat (limited to 'source/slang/slang-compiler.cpp')
| -rw-r--r-- | source/slang/slang-compiler.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 04ebb753c..58cc55e71 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -16,6 +16,8 @@ #include "slang-check-impl.h" #include "slang-check.h" +#include <chrono> + // Artifact #include "../compiler-core/slang-artifact-associated.h" #include "../compiler-core/slang-artifact-container-util.h" @@ -1835,6 +1837,26 @@ SlangResult CodeGenContext::_emitEntryPoints(ComPtr<IArtifact>& outArtifact) return SLANG_FAIL; } +// Helper class for recording compile time. +struct CompileTimerRAII +{ + std::chrono::high_resolution_clock::time_point startTime; + Session* session; + CompileTimerRAII(Session* inSession) + { + startTime = std::chrono::high_resolution_clock::now(); + session = inSession; + } + ~CompileTimerRAII() + { + double elapsedTime = std::chrono::duration_cast<std::chrono::microseconds>( + std::chrono::high_resolution_clock::now() - startTime) + .count() / + 1e6; + session->addTotalCompileTime(elapsedTime); + } +}; + // Do emit logic for a zero or more entry points SlangResult CodeGenContext::emitEntryPoints(ComPtr<IArtifact>& outArtifact) { |
