Cache Vello render output as stitchable textures#3722
Cache Vello render output as stitchable textures#3722TrueDoctor wants to merge 15 commits intomasterfrom
Conversation
Performance Benchmark Results
|
Performance Benchmark Results
|
c8cf08b to
01b4c1f
Compare
Performance Benchmark Results
|
01b4c1f to
f79c30c
Compare
b8a716a to
6950a74
Compare
|
We don't store tiles, so I think the title is technically wrong / misleading |
1b42423 to
0af8665
Compare
0af8665 to
722d379
Compare
865572b to
74332a5
Compare
timon-schelling
left a comment
There was a problem hiding this comment.
Generally LGTM, didn't check the cache as thoroughly. Can do that if you want but the approach is good.
|
|
||
| rows.extend_from_slice(&[header, node_graph_wires_label, graph_wire_style, use_vello, brush_tool]); | ||
| let max_region_size_description = | ||
| "Maximum render region size in total pixels (width × height). Larger values require fewer render passes. If you see rendering artifacts or nothing at all, configure a smaller value."; |
There was a problem hiding this comment.
Can we split this explanation in two parts, first explaining for non technical users and a second part going deeper and explaining the exact effect?
|
|
||
| executor.context.queue.submit([encoder.finish()]); | ||
| surface_texture.present(); | ||
| // image_texture.texture.destroy(); |
There was a problem hiding this comment.
| // image_texture.texture.destroy(); |
| context_features: graphene_std::ContextDependencies { | ||
| extract: ContextFeatures::empty(), | ||
| // We add the extract index annotation here to force the compiler to add a context nullification node before this node so the render context is properly nullified so the render cache node can do its's work | ||
| extract: ContextFeatures::INDEX, |
There was a problem hiding this comment.
could we add a separate ContextFeature for this purpose?
| } | ||
|
|
||
| #[inline] | ||
| pub fn tile_world_start(tile: &TileCoord, scale: f64) -> DVec2 { |
There was a problem hiding this comment.
| pub fn tile_world_start(tile: &TileCoord, scale: f64) -> DVec2 { | |
| pub fn tile_space_origin(tile: &TileCoord, scale: f64) -> DVec2 { |
There was a problem hiding this comment.
not sure, just something to think about
| use crate::render_node::RenderOutputType; | ||
|
|
||
| pub const TILE_SIZE: u32 = 256; | ||
| pub const MAX_CACHE_MEMORY_BYTES: usize = 512 * 1024 * 1024; |
There was a problem hiding this comment.
Maybe this could be a user setting?
| let queue = &exec.context.queue; | ||
|
|
||
| // TODO: Use texture pool to reuse existing unused textures instead of allocating fresh ones every time | ||
| let output_texture = device.create_texture(&wgpu::TextureDescriptor { |
There was a problem hiding this comment.
Could we use target texture here? Only needs to be recreated if viewport size changes?
Cache render output as texture and only rerender necessary parts while panning
Closes: #3509, part of #1607.