mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-09 20:31:29 +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/gen/* linguist-generated
|
||||
|
||||
piet-wgpu/shader/* linguist-language=wgsl
|
||||
|
|
3
Cargo.lock
generated
3
Cargo.lock
generated
|
@ -906,6 +906,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "naga"
|
||||
version = "0.10.0"
|
||||
source = "git+https://github.com/gfx-rs/naga?rev=ddcd5d3121150b2b1beee6e54e9125ff31aaa9a2#ddcd5d3121150b2b1beee6e54e9125ff31aaa9a2"
|
||||
dependencies = [
|
||||
"bit-set",
|
||||
"bitflags",
|
||||
|
@ -1274,7 +1275,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "piet-twgsl"
|
||||
name = "piet-wgsl"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
|
|
|
@ -13,4 +13,6 @@ members = [
|
|||
]
|
||||
|
||||
[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]
|
||||
name = "piet-twgsl"
|
||||
name = "piet-wgsl"
|
||||
version = "0.1.0"
|
||||
authors = ["Raph Levien <raph@google.com>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
|
|
|
@ -20,10 +20,7 @@ struct Tile {
|
|||
segments: u32,
|
||||
}
|
||||
|
||||
struct Config {
|
||||
width_in_tiles: u32,
|
||||
height_in_tiles: u32,
|
||||
}
|
||||
{{> config}}
|
||||
|
||||
@group(0) @binding(0)
|
||||
var<storage> config: Config;
|
||||
|
@ -49,6 +46,7 @@ fn main(
|
|||
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) {
|
||||
|
|
|
@ -20,7 +20,6 @@ use std::{fs::File, io::BufWriter};
|
|||
|
||||
use engine::Engine;
|
||||
|
||||
use bytemuck;
|
||||
use render::render;
|
||||
use test_scene::dump_scene_info;
|
||||
use wgpu::{Device, Queue};
|
||||
|
|
|
@ -65,6 +65,7 @@ pub fn render(scene: &Scene, shaders: &Shaders) -> (Recording, BufProxy) {
|
|||
// TODO: more principled size calc
|
||||
let tiles_buf = BufProxy::new(4097 * 8);
|
||||
let segments_buf = BufProxy::new(256 * 24);
|
||||
recording.clear_all(tiles_buf);
|
||||
recording.dispatch(
|
||||
shaders.path_coarse,
|
||||
(path_coarse_wgs, 1, 1),
|
||||
|
|
|
@ -25,7 +25,7 @@ impl ShaderTemplate {
|
|||
pub fn new() -> ShaderTemplate {
|
||||
let mut handlebars = Handlebars::new();
|
||||
handlebars
|
||||
.register_templates_directory("twgsl", "shader")
|
||||
.register_templates_directory("twgsl", concat!(env!("CARGO_MANIFEST_DIR"), "/shader"))
|
||||
.unwrap();
|
||||
handlebars.register_escape_fn(handlebars::no_escape);
|
||||
ShaderTemplate { handlebars }
|
||||
|
|
Loading…
Reference in a new issue