Class: WebGPULogger

WebGPULogger(device)

Logger for WebGPU Enable debugging for the global_id you want to debug inside your main function: fn main() { // make sure you debug only for a specific workitem/global_id // if you don't the last workitem/global_id will overwrite the log // if you have more dimensions you need to specify all of them enable_log(global_id.x == 0); // log only the 1st workitem } The following log function is now available anywhere inside your wsgl script: // print scalar var test: u32 = 10; console.log("scalar:", test); // print array element var test = array(1,2,3,4); console.log("arr element:", test[2]); // print subarray from 1st to 3rd element var test = array(1,2,3,4); console.log("subarray:", test[1:3]);

Constructor

new WebGPULogger(device)

Initializes the logger
Parameters:
Name Type Description
device The webgpu device
Source:

Classes

WebGPULogger

Methods

createLogShader(shader, bindGroupLayoutEntries)

Get the log shader
Parameters:
Name Type Description
shader The current shader to log
bindGroupLayoutEntries The binding group layout entries
Source:
Returns:
The debuggable shader

(async) getLog()

Get the WebGPU log
Source:
Returns:
The log

setBindGroupEntries(bindGroupEntries)

Set the bind group entries
Parameters:
Name Type Description
bindGroupEntries The bind group entries
Source:

setBindGroupLayoutEntries(bindGroupLayoutEntries)

Set the bind group layout entries
Parameters:
Name Type Description
bindGroupLayoutEntries The bind group layout entries
Source:

setCommandEncoder(commandEncoder)

Set command encoder
Parameters:
Name Type Description
commandEncoder
Source: