summaryrefslogtreecommitdiffstats
path: root/tools/gfx/cuda/render-cuda.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/cuda/render-cuda.cpp')
-rw-r--r--tools/gfx/cuda/render-cuda.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/gfx/cuda/render-cuda.cpp b/tools/gfx/cuda/render-cuda.cpp
index d1e320224..057674550 100644
--- a/tools/gfx/cuda/render-cuda.cpp
+++ b/tools/gfx/cuda/render-cuda.cpp
@@ -6,6 +6,7 @@
#include "../renderer-shared.h"
#include "../render-graphics-common.h"
+#include "../slang-context.h"
#ifdef GFX_ENABLE_CUDA
#include <cuda.h>
@@ -782,6 +783,7 @@ private:
CUcontext m_context = nullptr;
CUDAPipelineState* currentPipeline = nullptr;
CUDARootShaderObject* currentRootObject = nullptr;
+ SlangContext slangContext;
public:
~CUDARenderer()
{
@@ -792,6 +794,8 @@ private:
}
virtual SLANG_NO_THROW SlangResult SLANG_MCALL initialize(const Desc& desc, void* inWindowHandle) override
{
+ SLANG_RETURN_ON_FAIL(slangContext.initialize(desc.slang, SLANG_PTX, "sm_5_1"));
+
SLANG_RETURN_ON_FAIL(_initCuda(reportType));
SLANG_RETURN_ON_FAIL(_findMaxFlopsDeviceIndex(&m_deviceIndex));
@@ -809,6 +813,13 @@ private:
return SLANG_OK;
}
+ virtual SLANG_NO_THROW Result SLANG_MCALL getSlangSession(slang::ISession** outSlangSession) override
+ {
+ *outSlangSession = slangContext.session.get();
+ slangContext.session->addRef();
+ return SLANG_OK;
+ }
+
virtual SLANG_NO_THROW Result SLANG_MCALL createTextureResource(
IResource::Usage initialUsage,
const ITextureResource::Desc& desc,