Reworked wgpu buffers, updated glow side to have proper transform location storage, attempting to fix visibility modifiers, implemented some of the feedback received in initial PR.
This commit is contained in:
parent
5d0fffc626
commit
6e7b3ced0b
20 changed files with 411 additions and 417 deletions
|
|
@ -253,13 +253,13 @@ impl GradientPipeline {
|
|||
pub fn configure_render_pass<'a>(
|
||||
&'a self,
|
||||
render_pass: &mut wgpu::RenderPass<'a>,
|
||||
index: usize,
|
||||
count: usize,
|
||||
) {
|
||||
render_pass.set_pipeline(&self.pipeline);
|
||||
render_pass.set_bind_group(
|
||||
0,
|
||||
&self.bind_group,
|
||||
&[self.uniform_buffer.offset_at_index(index)],
|
||||
);
|
||||
&[self.uniform_buffer.offset_at_index(count)],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,15 +8,15 @@ use encase::ShaderType;
|
|||
use glam::Vec4;
|
||||
use iced_graphics::Transformation;
|
||||
|
||||
pub(super) struct SolidPipeline {
|
||||
pub struct SolidPipeline {
|
||||
pipeline: wgpu::RenderPipeline,
|
||||
pub(super) buffer: DynamicBuffer<SolidUniforms>,
|
||||
pub(crate) buffer: DynamicBuffer<SolidUniforms>,
|
||||
bind_group_layout: wgpu::BindGroupLayout,
|
||||
bind_group: wgpu::BindGroup,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, ShaderType)]
|
||||
pub(super) struct SolidUniforms {
|
||||
pub struct SolidUniforms {
|
||||
transform: glam::Mat4,
|
||||
color: Vec4,
|
||||
}
|
||||
|
|
@ -156,14 +156,13 @@ impl SolidPipeline {
|
|||
pub fn configure_render_pass<'a>(
|
||||
&'a self,
|
||||
render_pass: &mut wgpu::RenderPass<'a>,
|
||||
index: usize,
|
||||
count: usize,
|
||||
) {
|
||||
render_pass.set_pipeline(&self.pipeline);
|
||||
|
||||
render_pass.set_bind_group(
|
||||
0,
|
||||
&self.bind_group,
|
||||
&[self.buffer.offset_at_index(index)],
|
||||
);
|
||||
&[self.buffer.offset_at_index(count)],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue