antvis / g-device-api

A Device API references WebGPU implementations
https://observablehq.com/@antv/g-device-api
8 stars 1 forks source link

支持 Shader Defines #155

Open xiaoiver opened 5 months ago

xiaoiver commented 5 months ago

目前为 WGSL 提供 Shader Chunks 模块化功能用法如下:

const compiler = device['WGSLComposer'];
const code = compiler.wgsl_compile(wgsl);
#define_import_path my_module

fn my_func() -> f32 {
    return 1.0;
}

但还不支持 shader defines

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: Support

Currently, the Shader Chunks modular function provided for WGSL is used as follows:

const compiler = device['WGSLComposer'];
const code = compiler.wgsl_compile(wgsl);
#define_import_path my_module

fn my_func() -> f32 {
return 1.0;
}

But shader definitions are not yet supported