summaryrefslogtreecommitdiff
path: root/tools/gfx/cuda
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-20 12:24:00 -0800
committerGitHub <noreply@github.com>2024-02-20 12:24:00 -0800
commit4d20fd329956ac89408b1628a8291fea01bc9a6d (patch)
tree8e62d9c1ec05142fd25d0b31073fdb56d44691b0 /tools/gfx/cuda
parent8e9b61e3bac69dbb37a1451b62302e688a017ced (diff)
Refactor compiler option representations. (#3598)
* Refactor compiler option representation. * Fix binary compatibility. * Add a test for specifying compiler options at link time. * Fix binary compatibility. * Fix binary compatibility. * Fix backward compatibility on matrix layout. * Fix. * Fix. * Fix. * Fix gfx. * Fix gfx. * Fix dynamic dispatch. * Polish.
Diffstat (limited to 'tools/gfx/cuda')
-rw-r--r--tools/gfx/cuda/cuda-device.cpp3
-rw-r--r--tools/gfx/cuda/cuda-device.h1
-rw-r--r--tools/gfx/cuda/cuda-shader-object-layout.cpp9
-rw-r--r--tools/gfx/cuda/cuda-shader-object-layout.h2
4 files changed, 9 insertions, 6 deletions
diff --git a/tools/gfx/cuda/cuda-device.cpp b/tools/gfx/cuda/cuda-device.cpp
index 7f931afa1..377a5aba2 100644
--- a/tools/gfx/cuda/cuda-device.cpp
+++ b/tools/gfx/cuda/cuda-device.cpp
@@ -908,11 +908,12 @@ SLANG_NO_THROW Result SLANG_MCALL DeviceImpl::createQueryPool(
}
Result DeviceImpl::createShaderObjectLayout(
+ slang::ISession* session,
slang::TypeLayoutReflection* typeLayout,
ShaderObjectLayoutBase** outLayout)
{
RefPtr<ShaderObjectLayoutImpl> cudaLayout;
- cudaLayout = new ShaderObjectLayoutImpl(this, typeLayout);
+ cudaLayout = new ShaderObjectLayoutImpl(this, session, typeLayout);
returnRefPtrMove(outLayout, cudaLayout);
return SLANG_OK;
}
diff --git a/tools/gfx/cuda/cuda-device.h b/tools/gfx/cuda/cuda-device.h
index bfaf1be6e..e711dc261 100644
--- a/tools/gfx/cuda/cuda-device.h
+++ b/tools/gfx/cuda/cuda-device.h
@@ -73,6 +73,7 @@ public:
IQueryPool** outPool) override;
virtual Result createShaderObjectLayout(
+ slang::ISession* session,
slang::TypeLayoutReflection* typeLayout,
ShaderObjectLayoutBase** outLayout) override;
diff --git a/tools/gfx/cuda/cuda-shader-object-layout.cpp b/tools/gfx/cuda/cuda-shader-object-layout.cpp
index eacae0fc0..f527d78de 100644
--- a/tools/gfx/cuda/cuda-shader-object-layout.cpp
+++ b/tools/gfx/cuda/cuda-shader-object-layout.cpp
@@ -9,11 +9,11 @@ using namespace Slang;
namespace cuda
{
-ShaderObjectLayoutImpl::ShaderObjectLayoutImpl(RendererBase* renderer, slang::TypeLayoutReflection* layout)
+ShaderObjectLayoutImpl::ShaderObjectLayoutImpl(RendererBase* renderer, slang::ISession* session, slang::TypeLayoutReflection* layout)
{
m_elementTypeLayout = _unwrapParameterGroups(layout, m_containerType);
- initBase(renderer, m_elementTypeLayout);
+ initBase(renderer, session, m_elementTypeLayout);
// Compute the binding ranges that are used to store
// the logical contents of the object in memory. These will relate
@@ -101,7 +101,7 @@ ShaderObjectLayoutImpl::ShaderObjectLayoutImpl(RendererBase* renderer, slang::Ty
if (slangBindingType != slang::BindingType::ExistentialValue)
{
subObjectLayout =
- new ShaderObjectLayoutImpl(renderer, slangLeafTypeLayout->getElementTypeLayout());
+ new ShaderObjectLayoutImpl(renderer, session, slangLeafTypeLayout->getElementTypeLayout());
}
SubObjectRangeInfo subObjectRange;
@@ -118,13 +118,14 @@ BindingRangeInfo ShaderObjectLayoutImpl::getBindingRange(Index index) { return m
Index ShaderObjectLayoutImpl::getBindingRangeCount() const { return m_bindingRanges.getCount(); }
RootShaderObjectLayoutImpl::RootShaderObjectLayoutImpl(RendererBase* renderer, slang::ProgramLayout* inProgramLayout)
- : ShaderObjectLayoutImpl(renderer, inProgramLayout->getGlobalParamsTypeLayout())
+ : ShaderObjectLayoutImpl(renderer, inProgramLayout->getSession(), inProgramLayout->getGlobalParamsTypeLayout())
, programLayout(inProgramLayout)
{
for (UInt i = 0; i < programLayout->getEntryPointCount(); i++)
{
entryPointLayouts.add(new ShaderObjectLayoutImpl(
renderer,
+ programLayout->getSession(),
programLayout->getEntryPointByIndex(i)->getTypeLayout()));
}
diff --git a/tools/gfx/cuda/cuda-shader-object-layout.h b/tools/gfx/cuda/cuda-shader-object-layout.h
index 5d3a2d52a..edec0c352 100644
--- a/tools/gfx/cuda/cuda-shader-object-layout.h
+++ b/tools/gfx/cuda/cuda-shader-object-layout.h
@@ -50,7 +50,7 @@ public:
Index m_subObjectCount = 0;
Index m_resourceCount = 0;
- ShaderObjectLayoutImpl(RendererBase* renderer, slang::TypeLayoutReflection* layout);
+ ShaderObjectLayoutImpl(RendererBase* renderer, slang::ISession* session, slang::TypeLayoutReflection* layout);
Index getResourceCount() const;
Index getSubObjectCount() const;