Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ documentation = "https://docs.rs/wgpu_glyph"
readme = "README.md"

[dependencies]
wgpu = "26"
wgpu = "28"
glyph_brush = "0.7"
log = "0.4"

Expand Down
3 changes: 2 additions & 1 deletion examples/clipping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() -> Result<(), Box<dyn Error>> {
});

// Create staging belt
let mut staging_belt = wgpu::util::StagingBelt::new(1024);
let mut staging_belt = wgpu::util::StagingBelt::new(device.clone(), 1024);

// Prepare swap chain
let render_format = wgpu::TextureFormat::Bgra8UnormSrgb;
Expand Down Expand Up @@ -136,6 +136,7 @@ fn main() -> Result<(), Box<dyn Error>> {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
},
);
}
Expand Down
3 changes: 2 additions & 1 deletion examples/depth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn main() -> Result<(), Box<dyn Error>> {
});

// Create staging belt
let mut staging_belt = wgpu::util::StagingBelt::new(1024);
let mut staging_belt = wgpu::util::StagingBelt::new(device.clone(), 1024);

// Prepare swap chain and depth buffer
let mut size = window.inner_size();
Expand Down Expand Up @@ -125,6 +125,7 @@ fn main() -> Result<(), Box<dyn Error>> {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
},
);
}
Expand Down
3 changes: 2 additions & 1 deletion examples/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() -> Result<(), Box<dyn Error>> {
});

// Create staging belt
let mut staging_belt = wgpu::util::StagingBelt::new(1024);
let mut staging_belt = wgpu::util::StagingBelt::new(device.clone(), 1024);

// Prepare swap chain
let render_format = wgpu::TextureFormat::Bgra8UnormSrgb;
Expand Down Expand Up @@ -136,6 +136,7 @@ fn main() -> Result<(), Box<dyn Error>> {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
},
);
}
Expand Down
4 changes: 0 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ impl<F: Font + Sync, H: BuildHasher> GlyphBrush<(), F, H> {
) -> Result<(), String> {
self.process_queued(device, staging_belt, encoder);
self.pipeline.draw(
device,
staging_belt,
encoder,
target,
Expand Down Expand Up @@ -317,7 +316,6 @@ impl<F: Font + Sync, H: BuildHasher> GlyphBrush<(), F, H> {
) -> Result<(), String> {
self.process_queued(device, staging_belt, encoder);
self.pipeline.draw(
device,
staging_belt,
encoder,
target,
Expand Down Expand Up @@ -408,7 +406,6 @@ impl<F: Font + Sync, H: BuildHasher> GlyphBrush<wgpu::DepthStencilState, F, H> {
) -> Result<(), String> {
self.process_queued(device, staging_belt, encoder);
self.pipeline.draw(
device,
staging_belt,
encoder,
target,
Expand Down Expand Up @@ -445,7 +442,6 @@ impl<F: Font + Sync, H: BuildHasher> GlyphBrush<wgpu::DepthStencilState, F, H> {
self.process_queued(device, staging_belt, encoder);

self.pipeline.draw(
device,
staging_belt,
encoder,
target,
Expand Down
14 changes: 4 additions & 10 deletions src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ impl Pipeline<()> {

pub fn draw(
&mut self,
device: &wgpu::Device,
staging_belt: &mut wgpu::util::StagingBelt,
encoder: &mut wgpu::CommandEncoder,
target: &wgpu::TextureView,
Expand All @@ -54,7 +53,6 @@ impl Pipeline<()> {
) {
draw(
self,
device,
staging_belt,
encoder,
target,
Expand Down Expand Up @@ -88,7 +86,6 @@ impl Pipeline<wgpu::DepthStencilState> {

pub fn draw(
&mut self,
device: &wgpu::Device,
staging_belt: &mut wgpu::util::StagingBelt,
encoder: &mut wgpu::CommandEncoder,
target: &wgpu::TextureView,
Expand All @@ -98,7 +95,6 @@ impl Pipeline<wgpu::DepthStencilState> {
) {
draw(
self,
device,
staging_belt,
encoder,
target,
Expand Down Expand Up @@ -173,7 +169,6 @@ impl<Depth> Pipeline<Depth> {
&self.instances,
0,
size,
device,
);

instances_view.copy_from_slice(instances_bytes);
Expand Down Expand Up @@ -216,7 +211,7 @@ fn build<D>(
address_mode_w: wgpu::AddressMode::ClampToEdge,
mag_filter: filter_mode,
min_filter: filter_mode,
mipmap_filter: filter_mode,
mipmap_filter: wgpu::MipmapFilterMode::Nearest,
..Default::default()
});

Expand Down Expand Up @@ -280,7 +275,7 @@ fn build<D>(
let layout =
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: None,
push_constant_ranges: &[],
immediate_size: 0,
bind_group_layouts: &[&uniform_layout],
});

Expand Down Expand Up @@ -340,7 +335,7 @@ fn build<D>(
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
});

Pipeline {
Expand All @@ -360,7 +355,6 @@ fn build<D>(

fn draw<D>(
pipeline: &mut Pipeline<D>,
device: &wgpu::Device,
staging_belt: &mut wgpu::util::StagingBelt,
encoder: &mut wgpu::CommandEncoder,
target: &wgpu::TextureView,
Expand All @@ -374,7 +368,6 @@ fn draw<D>(
&pipeline.transform,
0,
unsafe { NonZeroU64::new_unchecked(16 * 4) },
device,
);

transform_view.copy_from_slice(bytemuck::cast_slice(&transform));
Expand All @@ -397,6 +390,7 @@ fn draw<D>(
depth_stencil_attachment,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});

render_pass.set_pipeline(&pipeline.raw);
Expand Down
1 change: 0 additions & 1 deletion src/pipeline/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ impl Cache {
&self.upload_buffer,
0,
NonZeroU64::new(padded_data_size).unwrap(),
device,
);

for row in 0..height {
Expand Down