summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/CompilationInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/webgpu/CompilationInfo.cpp')
-rw-r--r--dom/webgpu/CompilationInfo.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/dom/webgpu/CompilationInfo.cpp b/dom/webgpu/CompilationInfo.cpp
index 0d46db2e59..995fb17c1a 100644
--- a/dom/webgpu/CompilationInfo.cpp
+++ b/dom/webgpu/CompilationInfo.cpp
@@ -18,8 +18,21 @@ CompilationInfo::CompilationInfo(Device* const aParent) : ChildOf(aParent) {}
void CompilationInfo::SetMessages(
nsTArray<mozilla::webgpu::WebGPUCompilationMessage>& aMessages) {
for (auto& msg : aMessages) {
+ auto messageType = dom::GPUCompilationMessageType::Error;
+ switch (msg.messageType) {
+ case WebGPUCompilationMessageType::Error:
+ messageType = dom::GPUCompilationMessageType::Error;
+ break;
+ case WebGPUCompilationMessageType::Warning:
+ messageType = dom::GPUCompilationMessageType::Warning;
+ break;
+ case WebGPUCompilationMessageType::Info:
+ messageType = dom::GPUCompilationMessageType::Info;
+ break;
+ }
mMessages.AppendElement(MakeAndAddRef<mozilla::webgpu::CompilationMessage>(
- mParent, msg.lineNum, msg.linePos, msg.offset, std::move(msg.message)));
+ mParent, messageType, msg.lineNum, msg.linePos, msg.offset, msg.length,
+ std::move(msg.message)));
}
}