webgpu: Implement ShaderCompilationInfo (#32642)

* ShaderCompilationInfo

* expectations

* Handle CompilationInfo promise in GPUShaderModule

* Fix my english
This commit is contained in:
Samson 2024-07-02 15:39:06 +02:00 committed by GitHub
parent bd0a5eb4b7
commit c0105de82b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 22103 additions and 682 deletions

View file

@ -5,6 +5,7 @@
#![allow(dead_code)] // this file is stub as wgpu does not provide info
use dom_struct::dom_struct;
use webgpu::ShaderCompilationInfo;
use super::bindings::codegen::Bindings::WebGPUBinding::{
GPUCompilationMessageMethods, GPUCompilationMessageType,
@ -62,6 +63,18 @@ impl GPUCompilationMessage {
global,
)
}
pub fn from(global: &GlobalScope, info: ShaderCompilationInfo) -> DomRoot<Self> {
GPUCompilationMessage::new(
global,
info.message.into(),
GPUCompilationMessageType::Error,
info.line_number as u64,
info.line_pos as u64,
info.offset as u64,
info.length as u64,
)
}
}
impl GPUCompilationMessageMethods for GPUCompilationMessage {