mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
webgpu: Implement ShaderCompilationInfo (#32642)
* ShaderCompilationInfo * expectations * Handle CompilationInfo promise in GPUShaderModule * Fix my english
This commit is contained in:
parent
bd0a5eb4b7
commit
c0105de82b
9 changed files with 22103 additions and 682 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue