mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-09 20:31:29 +11:00
Prepare for wgsl-analyzer upgrades (#195)
* Prepare for wgsl-analyzer upgrades * Fix the exponentials
This commit is contained in:
parent
afa706bd7e
commit
3831b58dea
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
|
@ -1,10 +1,8 @@
|
|||
{
|
||||
"wgsl-analyzer.customImports": {
|
||||
// Update as appropriate to proper path
|
||||
// temporary solution
|
||||
// "config": "file:C:\\Users\\Daniel\\Documents\\repositories\\linebender\\piet-gpu\\piet-wgsl\\shader\\shared\\config.wgsl",
|
||||
// "segment": "file:C:\\Users\\Daniel\\Documents\\repositories\\linebender\\piet-gpu\\piet-wgsl\\shader\\shared\\segment.wgsl",
|
||||
// "pathtag": "file:C:\\Users\\Daniel\\Documents\\repositories\\linebender\\piet-gpu\\piet-wgsl\\shader\\shared\\pathtag.wgsl"
|
||||
"config": "${workspaceFolder}/piet-wgsl/shader/shared/config.wgsl",
|
||||
"segment": "${workspaceFolder}/piet-wgsl/shader/shared/segment.wgsl",
|
||||
"pathtag": "${workspaceFolder}/piet-wgsl/shader/shared/pathtag.wgsl"
|
||||
},
|
||||
"wgsl-analyzer.diagnostics.nagaVersion": "main"
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ fn main(
|
|||
@builtin(workgroup_id) wg_id: vec3<u32>,
|
||||
) {
|
||||
let tile_ix = wg_id.y * config.width_in_tiles + wg_id.x;
|
||||
let xy = vec2(f32(global_id.x * PIXELS_PER_THREAD), f32(global_id.y));
|
||||
let xy = vec2<f32>(f32(global_id.x * PIXELS_PER_THREAD), f32(global_id.y));
|
||||
let tile = tiles[tile_ix];
|
||||
var area: array<f32, PIXELS_PER_THREAD>;
|
||||
let backdrop_f = f32(tile.backdrop);
|
||||
|
@ -59,7 +59,7 @@ fn main(
|
|||
let y0 = clamp(y, 0.0, 1.0);
|
||||
let y1 = clamp(y + segment.delta.y, 0.0, 1.0);
|
||||
let dy = y0 - y1;
|
||||
if (dy != 0.0) {
|
||||
if dy != 0.0 {
|
||||
let vec_y_recip = 1.0 / segment.delta.y;
|
||||
let t0 = (y0 - y) * vec_y_recip;
|
||||
let t1 = (y1 - y) * vec_y_recip;
|
||||
|
|
|
@ -132,7 +132,7 @@ let MAX_QUADS = 16u;
|
|||
@compute @workgroup_size(256)
|
||||
fn main(
|
||||
@builtin(global_invocation_id) global_id: vec3<u32>,
|
||||
@builtin(local_invocation_id) local_id: vec3<u32>,
|
||||
@builtin(local_invocation_id) local_id: vec3<u32>,
|
||||
) {
|
||||
// Obtain exclusive prefix sum of tag monoid
|
||||
let ix = global_id.x;
|
||||
|
@ -295,7 +295,7 @@ fn main(
|
|||
tile_seg.delta = dp;
|
||||
var y_edge = mix(lp0.y, lp1.y, (tile_x0 - lp0.x) * recip_dx);
|
||||
if xymin.x < tile_x0 {
|
||||
let p = vec2(tile_x0, y_edge);
|
||||
let p = vec2<f32>(tile_x0, y_edge);
|
||||
if dp.x < 0.0 {
|
||||
tile_seg.delta = p - lp0;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue