Comments in header
| 2879 | |
| 2880 | // Comments in header |
| 2881 | void Builder::enterFunction(Function const* function) |
| 2882 | { |
| 2883 | currentFunction = function; |
| 2884 | |
| 2885 | // Save and disable debugInfo for HLSL entry point function. It is a wrapper |
| 2886 | // function with no user code in it. |
| 2887 | restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo; |
| 2888 | if (sourceLang == spv::SourceLanguage::HLSL && function == entryPointFunction) { |
| 2889 | emitNonSemanticShaderDebugInfo = false; |
| 2890 | } |
| 2891 | |
| 2892 | if (emitNonSemanticShaderDebugInfo) { |
| 2893 | // Initialize scope state |
| 2894 | Id funcId = function->getFuncId(); |
| 2895 | Id debugFuncId = getDebugFunction(funcId); |
| 2896 | currentDebugScopeId.push(debugFuncId); |
| 2897 | // Create DebugFunctionDefinition |
| 2898 | spv::Id resultId = getUniqueId(); |
| 2899 | Instruction* defInst = new Instruction(resultId, makeVoidType(), Op::OpExtInst); |
| 2900 | defInst->reserveOperands(4); |
| 2901 | defInst->addIdOperand(nonSemanticShaderDebugInfo); |
| 2902 | defInst->addImmediateOperand(NonSemanticShaderDebugInfoDebugFunctionDefinition); |
| 2903 | defInst->addIdOperand(debugFuncId); |
| 2904 | defInst->addIdOperand(funcId); |
| 2905 | addInstruction(std::unique_ptr<Instruction>(defInst)); |
| 2906 | } |
| 2907 | |
| 2908 | if (auto linkType = function->getLinkType(); linkType != LinkageType::Max) { |
| 2909 | Id funcId = function->getFuncId(); |
| 2910 | addCapability(Capability::Linkage); |
| 2911 | addLinkageDecoration(funcId, function->getExportName(), linkType); |
| 2912 | } |
| 2913 | } |
| 2914 | |
| 2915 | // Comments in header |
| 2916 | void Builder::leaveFunction() |
no test coverage detected