summaryrefslogtreecommitdiffstats
path: root/tools/gfx/debug-layer/debug-device.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-08-16 17:11:54 -0700
committerGitHub <noreply@github.com>2022-08-16 17:11:54 -0700
commit42f49937ffa69c82e333e886952eed027e12340e (patch)
tree08e3e9821dd40e23476060215d589e29092adb53 /tools/gfx/debug-layer/debug-device.cpp
parente68fab2bda5d979f8d991fc41122bb9aa71849a6 (diff)
Add gfx interface definition in Slang. (#2364)
* Add gfx interface definition in Slang. - add gfx interface definitons in Slang. - fix slang compiler to correctly type-check `out` interface argument. - modify gfx interface to be fully COM compatible - add convenient ShaderProgram creation methods to gfx. * Fix compile errors and warnings. * Update project files * Fix cuda. * Properly implement queryInterface in command encoder impls. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/debug-layer/debug-device.cpp')
-rw-r--r--tools/gfx/debug-layer/debug-device.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/gfx/debug-layer/debug-device.cpp b/tools/gfx/debug-layer/debug-device.cpp
index aae7f9cea..356c875d4 100644
--- a/tools/gfx/debug-layer/debug-device.cpp
+++ b/tools/gfx/debug-layer/debug-device.cpp
@@ -448,10 +448,26 @@ Result DebugDevice::createProgram(
{
SLANG_GFX_API_FUNC;
- RefPtr<DebugShaderProgram> outObject = new DebugShaderProgram(desc);
+ RefPtr<DebugShaderProgram> outObject = new DebugShaderProgram();
auto result = baseObject->createProgram(desc, outObject->baseObject.writeRef(), outDiagnostics);
if (SLANG_FAILED(result))
return result;
+ outObject->m_slangProgram = desc.slangGlobalScope;
+ returnComPtr(outProgram, outObject);
+ return result;
+}
+
+Result DebugDevice::createProgram2(
+ const IShaderProgram::CreateDesc2& desc, IShaderProgram** outProgram, ISlangBlob** outDiagnostics)
+{
+ SLANG_GFX_API_FUNC;
+ IShaderProgram::Desc desc1 = {};
+ RefPtr<DebugShaderProgram> outObject = new DebugShaderProgram();
+ auto result = baseObject->createProgram2(desc, outObject->baseObject.writeRef(), outDiagnostics);
+ if (SLANG_FAILED(result))
+ return result;
+ auto base = static_cast<ShaderProgramBase*>(outObject->baseObject.get());
+ outObject->m_slangProgram = base->desc.slangGlobalScope;
returnComPtr(outProgram, outObject);
return result;
}