diff options
| author | Yong He <yonghe@outlook.com> | 2022-01-04 11:24:11 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-04 11:24:11 -0800 |
| commit | 43b6f5c36cbe2529d93df0e44e319a330487ed0d (patch) | |
| tree | bb9399d71a505c007327080285ce2583d12bc576 /tools/gfx/debug-layer.cpp | |
| parent | 9d6c7763334908c78027199a0cb1ca3b9841ebab (diff) | |
gfx: Fix root shader object implementation in debug layer. (#2059)
* gfx: Fix root shader object implementation in debug layer.
* Fix.
Co-authored-by: Yong He <yhe@nvidia.com>
Co-authored-by: Theresa Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'tools/gfx/debug-layer.cpp')
| -rw-r--r-- | tools/gfx/debug-layer.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/gfx/debug-layer.cpp b/tools/gfx/debug-layer.cpp index 97504017e..80c04bd1f 100644 --- a/tools/gfx/debug-layer.cpp +++ b/tools/gfx/debug-layer.cpp @@ -652,17 +652,26 @@ Result DebugDevice::createMutableShaderObject( } Result DebugDevice::createMutableRootShaderObject( - IShaderProgram* program, IShaderObject** outObject) + IShaderProgram* program, IShaderObject** outRootObject) { SLANG_GFX_API_FUNC; - return baseObject->createMutableRootShaderObject(program, outObject); + RefPtr<DebugShaderObject> outObject = new DebugShaderObject(); + auto result = baseObject->createMutableRootShaderObject( + getInnerObj(program), outObject->baseObject.writeRef()); + if (SLANG_FAILED(result)) + return result; + outObject->m_device = this; + outObject->m_slangType = nullptr; + outObject->m_rootComponentType = getDebugObj(program)->m_slangProgram; + returnComPtr(outRootObject, outObject); + return result; } Result DebugDevice::createProgram(const IShaderProgram::Desc& desc, IShaderProgram** outProgram) { SLANG_GFX_API_FUNC; - RefPtr<DebugShaderProgram> outObject = new DebugShaderProgram(); + RefPtr<DebugShaderProgram> outObject = new DebugShaderProgram(desc); auto result = baseObject->createProgram(desc, outObject->baseObject.writeRef()); if (SLANG_FAILED(result)) return result; @@ -1836,4 +1845,9 @@ Result DebugFence::setCurrentValue(uint64_t value) return baseObject->setCurrentValue(value); } +DebugShaderProgram::DebugShaderProgram(const IShaderProgram::Desc& desc) +{ + m_slangProgram = desc.slangProgram; +} + } // namespace gfx |
