diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-ir-insert-debug-value-store.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source/slang/slang-ir-insert-debug-value-store.cpp b/source/slang/slang-ir-insert-debug-value-store.cpp index 86ad377a2..25b9c03fa 100644 --- a/source/slang/slang-ir-insert-debug-value-store.cpp +++ b/source/slang/slang-ir-insert-debug-value-store.cpp @@ -51,6 +51,14 @@ bool DebugValueStoreContext::isDebuggableType(IRType* type) debuggable = isDebuggableType(arrayType->getElementType()); break; } + case kIROp_HLSLInputPatchType: + case kIROp_HLSLOutputPatchType: + case kIROp_HLSLTriangleStreamType: + { + auto elementType = as<IRType>(type->getOperand(0)); + debuggable = isDebuggableType(elementType); + break; + } case kIROp_VectorType: case kIROp_MatrixType: case kIROp_PtrType: @@ -115,6 +123,11 @@ void DebugValueStoreContext::insertDebugValueStore(IRFunc* func) isRefParam = true; paramType = outType->getValueType(); } + else if (auto ptrType = as<IRConstRefType>(param->getDataType())) + { + isRefParam = true; + paramType = ptrType->getValueType(); + } if (!isDebuggableType(paramType)) continue; auto debugVar = builder.emitDebugVar( @@ -130,9 +143,14 @@ void DebugValueStoreContext::insertDebugValueStore(IRFunc* func) // Store the initial value of the parameter into the debug var. IRInst* paramVal = nullptr; if (!isRefParam) + { paramVal = param; - else if (as<IRInOutType>(param->getDataType())) + } + else if (as<IRInOutType>(param->getDataType()) || as<IRConstRefType>(param->getDataType())) + { paramVal = builder.emitLoad(param); + } + if (paramVal) { builder.emitDebugValue(debugVar, paramVal); |
