|
@@ -255,12 +255,6 @@ void SPIRVEmitter::HandleTranslationUnit(ASTContext &context) {
|
|
|
if (context.getDiagnostics().hasErrorOccurred())
|
|
|
return;
|
|
|
|
|
|
- AddRequiredCapabilitiesForShaderModel();
|
|
|
-
|
|
|
- // Addressing and memory model are required in a valid SPIR-V module.
|
|
|
- theBuilder.setAddressingModel(spv::AddressingModel::Logical);
|
|
|
- theBuilder.setMemoryModel(spv::MemoryModel::GLSL450);
|
|
|
-
|
|
|
TranslationUnitDecl *tu = context.getTranslationUnitDecl();
|
|
|
|
|
|
// The entry function is the seed of the queue.
|
|
@@ -292,6 +286,15 @@ void SPIRVEmitter::HandleTranslationUnit(ASTContext &context) {
|
|
|
doDecl(workQueue[i]);
|
|
|
}
|
|
|
|
|
|
+ if (context.getDiagnostics().hasErrorOccurred())
|
|
|
+ return;
|
|
|
+
|
|
|
+ AddRequiredCapabilitiesForShaderModel();
|
|
|
+
|
|
|
+ // Addressing and memory model are required in a valid SPIR-V module.
|
|
|
+ theBuilder.setAddressingModel(spv::AddressingModel::Logical);
|
|
|
+ theBuilder.setMemoryModel(spv::MemoryModel::GLSL450);
|
|
|
+
|
|
|
theBuilder.addEntryPoint(getSpirvShaderStage(shaderModel), entryFunctionId,
|
|
|
entryFunctionName, declIdMapper.collectStageVars());
|
|
|
|