mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 12:41:30 +11:00
Address review feedback
Cleans up some of the immediate issue, but still hacky and has a bunch of stuff hard-coded.
This commit is contained in:
parent
a50d76cb1c
commit
911dee23cd
2
.gitattributes
vendored
2
.gitattributes
vendored
|
@ -1,3 +1,3 @@
|
||||||
**/shader/* linguist-language=glsl
|
**/shader/* linguist-language=glsl
|
||||||
**/shader/gen/* linguist-generated
|
**/shader/gen/* linguist-generated
|
||||||
|
piet-wgpu/shader/* linguist-language=wgsl
|
||||||
|
|
3
Cargo.lock
generated
3
Cargo.lock
generated
|
@ -906,6 +906,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "naga"
|
name = "naga"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
|
source = "git+https://github.com/gfx-rs/naga?rev=ddcd5d3121150b2b1beee6e54e9125ff31aaa9a2#ddcd5d3121150b2b1beee6e54e9125ff31aaa9a2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
@ -1274,7 +1275,7 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "piet-twgsl"
|
name = "piet-wgsl"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
|
@ -13,4 +13,6 @@ members = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
naga = { path = "../../dl/naga" }
|
# Required for metal support to work on wgpu
|
||||||
|
# TODO: remove when wgpu is upgraded to 0.15
|
||||||
|
naga = { git = "https://github.com/gfx-rs/naga", rev="ddcd5d3121150b2b1beee6e54e9125ff31aaa9a2" }
|
||||||
|
|
3
piet-wgsl/.gitignore
vendored
3
piet-wgsl/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
target
|
|
||||||
.ninja_deps
|
|
||||||
.ninja_log
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "piet-twgsl"
|
name = "piet-wgsl"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Raph Levien <raph@google.com>"]
|
authors = ["Raph Levien <raph@google.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
|
|
|
@ -20,10 +20,7 @@ struct Tile {
|
||||||
segments: u32,
|
segments: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Config {
|
{{> config}}
|
||||||
width_in_tiles: u32,
|
|
||||||
height_in_tiles: u32,
|
|
||||||
}
|
|
||||||
|
|
||||||
@group(0) @binding(0)
|
@group(0) @binding(0)
|
||||||
var<storage> config: Config;
|
var<storage> config: Config;
|
||||||
|
@ -49,6 +46,7 @@ fn main(
|
||||||
backdrop = tiles[ix].backdrop;
|
backdrop = tiles[ix].backdrop;
|
||||||
}
|
}
|
||||||
sh_backdrop[local_id.x] = backdrop;
|
sh_backdrop[local_id.x] = backdrop;
|
||||||
|
// iterate log2(WG_SIZE) times
|
||||||
for (var i = 0u; i < firstTrailingBit(WG_SIZE); i += 1u) {
|
for (var i = 0u; i < firstTrailingBit(WG_SIZE); i += 1u) {
|
||||||
workgroupBarrier();
|
workgroupBarrier();
|
||||||
if local_id.x >= (1u << i) {
|
if local_id.x >= (1u << i) {
|
||||||
|
|
|
@ -20,7 +20,6 @@ use std::{fs::File, io::BufWriter};
|
||||||
|
|
||||||
use engine::Engine;
|
use engine::Engine;
|
||||||
|
|
||||||
use bytemuck;
|
|
||||||
use render::render;
|
use render::render;
|
||||||
use test_scene::dump_scene_info;
|
use test_scene::dump_scene_info;
|
||||||
use wgpu::{Device, Queue};
|
use wgpu::{Device, Queue};
|
||||||
|
|
|
@ -65,6 +65,7 @@ pub fn render(scene: &Scene, shaders: &Shaders) -> (Recording, BufProxy) {
|
||||||
// TODO: more principled size calc
|
// TODO: more principled size calc
|
||||||
let tiles_buf = BufProxy::new(4097 * 8);
|
let tiles_buf = BufProxy::new(4097 * 8);
|
||||||
let segments_buf = BufProxy::new(256 * 24);
|
let segments_buf = BufProxy::new(256 * 24);
|
||||||
|
recording.clear_all(tiles_buf);
|
||||||
recording.dispatch(
|
recording.dispatch(
|
||||||
shaders.path_coarse,
|
shaders.path_coarse,
|
||||||
(path_coarse_wgs, 1, 1),
|
(path_coarse_wgs, 1, 1),
|
||||||
|
|
|
@ -25,7 +25,7 @@ impl ShaderTemplate {
|
||||||
pub fn new() -> ShaderTemplate {
|
pub fn new() -> ShaderTemplate {
|
||||||
let mut handlebars = Handlebars::new();
|
let mut handlebars = Handlebars::new();
|
||||||
handlebars
|
handlebars
|
||||||
.register_templates_directory("twgsl", "shader")
|
.register_templates_directory("twgsl", concat!(env!("CARGO_MANIFEST_DIR"), "/shader"))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
handlebars.register_escape_fn(handlebars::no_escape);
|
handlebars.register_escape_fn(handlebars::no_escape);
|
||||||
ShaderTemplate { handlebars }
|
ShaderTemplate { handlebars }
|
||||||
|
|
Loading…
Reference in a new issue