diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp index 6903485cc4..a0dc713e78 100644 --- a/src/dawn_native/ShaderModule.cpp +++ b/src/dawn_native/ShaderModule.cpp @@ -1050,7 +1050,7 @@ namespace dawn_native { } // TintSource is a PIMPL container for a tint::Source::File, which needs to be kept alive for as - // long as tint diagnostics are inspected. + // long as tint diagnostics are inspected / printed. class TintSource { public: template @@ -1070,9 +1070,8 @@ namespace dawn_native { return DAWN_VALIDATION_ERROR("Shader module descriptor missing chained descriptor"); } // For now only a single SPIRV or WGSL subdescriptor is allowed. - DAWN_TRY(ValidateSingleSType(chainedDescriptor, - wgpu::SType::ShaderModuleSPIRVDescriptor, - wgpu::SType::ShaderModuleWGSLDescriptor)); + DAWN_TRY(ValidateSingleSType(chainedDescriptor, wgpu::SType::ShaderModuleSPIRVDescriptor, + wgpu::SType::ShaderModuleWGSLDescriptor)); OwnedCompilationMessages* outMessages = parseResult->compilationMessages.get(); @@ -1114,8 +1113,8 @@ namespace dawn_native { spirv_cfg.emit_vertex_point_size = true; transformInputs.Add(spirv_cfg); - DAWN_TRY_ASSIGN(program, RunTransforms(&transformManager, &program, - transformInputs, nullptr, outMessages)); + DAWN_TRY_ASSIGN(program, RunTransforms(&transformManager, &program, transformInputs, + nullptr, outMessages)); std::vector spirv; DAWN_TRY_ASSIGN(spirv, ModuleToSPIRV(&program)); @@ -1346,6 +1345,7 @@ namespace dawn_native { MaybeError ShaderModuleBase::InitializeBase(ShaderModuleParseResult* parseResult) { mTintProgram = std::move(parseResult->tintProgram); + mTintSource = std::move(parseResult->tintSource); mSpirv = std::move(parseResult->spirv); mCompilationMessages = std::move(parseResult->compilationMessages); diff --git a/src/dawn_native/ShaderModule.h b/src/dawn_native/ShaderModule.h index 25347922b6..b5d949f10e 100644 --- a/src/dawn_native/ShaderModule.h +++ b/src/dawn_native/ShaderModule.h @@ -203,6 +203,7 @@ namespace dawn_native { EntryPointMetadataTable mEntryPoints; std::vector mSpirv; std::unique_ptr mTintProgram; + std::unique_ptr mTintSource; // Keep the tint::Source::File alive std::unique_ptr mCompilationMessages; };