summaryrefslogtreecommitdiff
path: root/tools/gfx/d3d12/d3d12-shader-object-layout.cpp
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/d3d12/d3d12-shader-object-layout.cpp
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/d3d12/d3d12-shader-object-layout.cpp')
-rw-r--r--tools/gfx/d3d12/d3d12-shader-object-layout.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/gfx/d3d12/d3d12-shader-object-layout.cpp b/tools/gfx/d3d12/d3d12-shader-object-layout.cpp
index c43d3881e..0c0095621 100644
--- a/tools/gfx/d3d12/d3d12-shader-object-layout.cpp
+++ b/tools/gfx/d3d12/d3d12-shader-object-layout.cpp
@@ -50,10 +50,11 @@ bool ShaderObjectLayoutImpl::isBindingRangeRootParameter(
Result ShaderObjectLayoutImpl::createForElementType(
RendererBase* renderer,
+ slang::ISession* session,
slang::TypeLayoutReflection* elementType,
ShaderObjectLayoutImpl** outLayout)
{
- Builder builder(renderer);
+ Builder builder(renderer, session);
builder.setElementTypeLayout(elementType);
return builder.build(outLayout);
}
@@ -62,7 +63,7 @@ Result ShaderObjectLayoutImpl::init(Builder* builder)
{
auto renderer = builder->m_renderer;
- initBase(renderer, builder->m_elementTypeLayout);
+ initBase(renderer, builder->m_session, builder->m_elementTypeLayout);
m_containerType = builder->m_containerType;
@@ -223,13 +224,14 @@ Result ShaderObjectLayoutImpl::Builder::setElementTypeLayout(
{
if (auto pendingTypeLayout = slangLeafTypeLayout->getPendingDataTypeLayout())
{
- createForElementType(m_renderer, pendingTypeLayout, subObjectLayout.writeRef());
+ createForElementType(m_renderer, m_session, pendingTypeLayout, subObjectLayout.writeRef());
}
}
else
{
createForElementType(
m_renderer,
+ m_session,
slangLeafTypeLayout->getElementTypeLayout(),
subObjectLayout.writeRef());
}
@@ -982,7 +984,7 @@ Result RootShaderObjectLayoutImpl::create(
auto slangEntryPoint = programLayout->getEntryPointByIndex(e);
RefPtr<ShaderObjectLayoutImpl> entryPointLayout;
SLANG_RETURN_ON_FAIL(ShaderObjectLayoutImpl::createForElementType(
- device, slangEntryPoint->getTypeLayout(), entryPointLayout.writeRef()));
+ device, program->getSession(), slangEntryPoint->getTypeLayout(), entryPointLayout.writeRef()));
builder.addEntryPoint(slangEntryPoint->getStage(), entryPointLayout);
}