summaryrefslogtreecommitdiffstats
path: root/tools/gfx/debug-layer.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-02-28 18:09:27 -0800
committerGitHub <noreply@github.com>2022-02-28 18:09:27 -0800
commite6c9625e0f0d5d9703451fd2ebb8b206d210009c (patch)
treead2c46f5e9a5f7a6e67cacf5b7227d726f392088 /tools/gfx/debug-layer.cpp
parentc31577953d5041c82375c22d847c2eba06106c58 (diff)
Use GLSL scalar layout for constant buffers. (#2147)
Diffstat (limited to 'tools/gfx/debug-layer.cpp')
-rw-r--r--tools/gfx/debug-layer.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/gfx/debug-layer.cpp b/tools/gfx/debug-layer.cpp
index 0926c5273..ec51dbee3 100644
--- a/tools/gfx/debug-layer.cpp
+++ b/tools/gfx/debug-layer.cpp
@@ -669,6 +669,42 @@ Result DebugDevice::createMutableRootShaderObject(
return result;
}
+Result DebugDevice::createShaderObjectFromTypeLayout(
+ slang::TypeLayoutReflection* typeLayout, IShaderObject** outShaderObject)
+{
+ SLANG_GFX_API_FUNC;
+
+ RefPtr<DebugShaderObject> outObject = new DebugShaderObject();
+ auto result = baseObject->createShaderObjectFromTypeLayout(typeLayout, outObject->baseObject.writeRef());
+ auto type = typeLayout->getType();
+ auto typeName = type->getName();
+ 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::createMutableShaderObjectFromTypeLayout(
+ slang::TypeLayoutReflection* typeLayout, IShaderObject** outShaderObject)
+{
+ SLANG_GFX_API_FUNC;
+ RefPtr<DebugShaderObject> outObject = new DebugShaderObject();
+ auto result = baseObject->createMutableShaderObjectFromTypeLayout(
+ typeLayout, outObject->baseObject.writeRef());
+ if (SLANG_FAILED(result))
+ return result;
+ auto type = typeLayout->getType();
+ auto typeName = type->getName();
+ outObject->m_typeName = typeName;
+ outObject->m_device = this;
+ outObject->m_slangType = type;
+ returnComPtr(outShaderObject, outObject);
+ return result;
+}
+
Result DebugDevice::createProgram(
const IShaderProgram::Desc& desc, IShaderProgram** outProgram, ISlangBlob** outDiagnostics)
{