mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 12:41:30 +11:00
parent
5dbeb992e9
commit
7d5063b187
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -1,14 +1,15 @@
|
|||
{
|
||||
"wgsl-analyzer.customImports": {
|
||||
"bbox": "${workspaceFolder}/piet-wgsl/shader/shared/bbox.wgsl",
|
||||
"blend": "${workspaceFolder}/piet-wgsl/shader/shared/blend.wgsl",
|
||||
"bump": "${workspaceFolder}/piet-wgsl/shader/shared/bump.wgsl",
|
||||
"clip": "${workspaceFolder}/piet-wgsl/shader/shared/clip.wgsl",
|
||||
"config": "${workspaceFolder}/piet-wgsl/shader/shared/config.wgsl",
|
||||
"cubic": "${workspaceFolder}/piet-wgsl/shader/shared/cubic.wgsl",
|
||||
"drawtag": "${workspaceFolder}/piet-wgsl/shader/shared/drawtag.wgsl",
|
||||
"segment": "${workspaceFolder}/piet-wgsl/shader/shared/segment.wgsl",
|
||||
"pathtag": "${workspaceFolder}/piet-wgsl/shader/shared/pathtag.wgsl",
|
||||
"ptcl": "${workspaceFolder}/piet-wgsl/shader/shared/ptcl.wgsl",
|
||||
"segment": "${workspaceFolder}/piet-wgsl/shader/shared/segment.wgsl",
|
||||
"tile": "${workspaceFolder}/piet-wgsl/shader/shared/tile.wgsl"
|
||||
},
|
||||
"wgsl-analyzer.diagnostics.nagaVersion": "main",
|
||||
|
|
|
@ -28,20 +28,20 @@ fn main(
|
|||
let width_in_tiles = config.width_in_tiles;
|
||||
let ix = wg_id.x * width_in_tiles + local_id.x;
|
||||
var backdrop = 0;
|
||||
if (local_id.x < width_in_tiles) {
|
||||
if local_id.x < width_in_tiles {
|
||||
backdrop = tiles[ix].backdrop;
|
||||
}
|
||||
sh_backdrop[local_id.x] = backdrop;
|
||||
// iterate log2(WG_SIZE) times
|
||||
for (var i = 0u; i < firstTrailingBit(WG_SIZE); i += 1u) {
|
||||
workgroupBarrier();
|
||||
if (local_id.x >= (1u << i)) {
|
||||
if local_id.x >= (1u << i) {
|
||||
backdrop += sh_backdrop[local_id.x - (1u << i)];
|
||||
}
|
||||
workgroupBarrier();
|
||||
sh_backdrop[local_id.x] = backdrop;
|
||||
}
|
||||
if (local_id.x < width_in_tiles) {
|
||||
if local_id.x < width_in_tiles {
|
||||
tiles[ix].backdrop = backdrop;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue