summaryrefslogtreecommitdiffstats
path: root/tools/gfx/debug-layer
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/debug-layer
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/debug-layer')
-rw-r--r--tools/gfx/debug-layer/debug-device.cpp42
-rw-r--r--tools/gfx/debug-layer/debug-device.h10
2 files changed, 52 insertions, 0 deletions
diff --git a/tools/gfx/debug-layer/debug-device.cpp b/tools/gfx/debug-layer/debug-device.cpp
index 45374b64f..44ca1de7a 100644
--- a/tools/gfx/debug-layer/debug-device.cpp
+++ b/tools/gfx/debug-layer/debug-device.cpp
@@ -376,6 +376,27 @@ Result DebugDevice::createShaderObject(
return result;
}
+Result DebugDevice::createShaderObject2(
+ slang::ISession* session,
+ slang::TypeReflection* type,
+ ShaderObjectContainerType containerType,
+ IShaderObject** outShaderObject)
+{
+ SLANG_GFX_API_FUNC;
+
+ RefPtr<DebugShaderObject> outObject = new DebugShaderObject();
+ auto typeName = type->getName();
+ auto result =
+ baseObject->createShaderObject2(session, type, containerType, outObject->baseObject.writeRef());
+ outObject->m_typeName = typeName;
+ outObject->m_device = this;
+ outObject->m_slangType = type;
+ if (SLANG_FAILED(result))
+ return result;
+ returnComPtr(outShaderObject, outObject);
+ return result;
+}
+
Result DebugDevice::createMutableShaderObject(
slang::TypeReflection* type,
ShaderObjectContainerType containerType,
@@ -396,6 +417,27 @@ Result DebugDevice::createMutableShaderObject(
return result;
}
+Result DebugDevice::createMutableShaderObject2(
+ slang::ISession* session,
+ slang::TypeReflection* type,
+ ShaderObjectContainerType containerType,
+ IShaderObject** outShaderObject)
+{
+ SLANG_GFX_API_FUNC;
+
+ RefPtr<DebugShaderObject> outObject = new DebugShaderObject();
+ auto typeName = type->getName();
+ auto result =
+ baseObject->createMutableShaderObject2(session, type, containerType, outObject->baseObject.writeRef());
+ outObject->m_typeName = typeName;
+ outObject->m_device = this;
+ outObject->m_slangType = type;
+ if (SLANG_FAILED(result))
+ return result;
+ returnComPtr(outShaderObject, outObject);
+ return result;
+}
+
Result DebugDevice::createMutableRootShaderObject(
IShaderProgram* program, IShaderObject** outRootObject)
{
diff --git a/tools/gfx/debug-layer/debug-device.h b/tools/gfx/debug-layer/debug-device.h
index 5b8424093..90feaa37e 100644
--- a/tools/gfx/debug-layer/debug-device.h
+++ b/tools/gfx/debug-layer/debug-device.h
@@ -94,10 +94,20 @@ public:
slang::TypeReflection* type,
ShaderObjectContainerType container,
IShaderObject** outObject) override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL createShaderObject2(
+ slang::ISession* session,
+ slang::TypeReflection* type,
+ ShaderObjectContainerType container,
+ IShaderObject** outObject) override;
virtual SLANG_NO_THROW Result SLANG_MCALL createMutableShaderObject(
slang::TypeReflection* type,
ShaderObjectContainerType container,
IShaderObject** outObject) override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL createMutableShaderObject2(
+ slang::ISession* session,
+ slang::TypeReflection* type,
+ ShaderObjectContainerType container,
+ IShaderObject** outObject) override;
virtual SLANG_NO_THROW Result SLANG_MCALL createShaderObjectFromTypeLayout(
slang::TypeLayoutReflection* typeLayout, IShaderObject** outObject) override;
virtual SLANG_NO_THROW Result SLANG_MCALL createMutableShaderObjectFromTypeLayout(