summaryrefslogtreecommitdiffstats
path: root/wgpu/src/triangle
diff options
context:
space:
mode:
authorLibravatar shan <shankern@protonmail.com>2022-10-04 18:24:46 -0700
committerLibravatar shan <shankern@protonmail.com>2022-10-04 18:24:46 -0700
commit6e7b3ced0b1daf368e44e181ecdb4ae529877eb6 (patch)
treee530025c737d509b640172d595cff0a0809f5a40 /wgpu/src/triangle
parent5d0fffc626928177239336757507b986b081b878 (diff)
downloadiced-6e7b3ced0b1daf368e44e181ecdb4ae529877eb6.tar.gz
iced-6e7b3ced0b1daf368e44e181ecdb4ae529877eb6.tar.bz2
iced-6e7b3ced0b1daf368e44e181ecdb4ae529877eb6.zip
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.
Diffstat (limited to 'wgpu/src/triangle')
-rw-r--r--wgpu/src/triangle/gradient.rs6
-rw-r--r--wgpu/src/triangle/solid.rs15
2 files changed, 10 insertions, 11 deletions
diff --git a/wgpu/src/triangle/gradient.rs b/wgpu/src/triangle/gradient.rs
index 471b204c..15b6b7e0 100644
--- a/wgpu/src/triangle/gradient.rs
+++ b/wgpu/src/triangle/gradient.rs
@@ -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)],
+ )
}
}
diff --git a/wgpu/src/triangle/solid.rs b/wgpu/src/triangle/solid.rs
index a3cbd72b..e7e9098a 100644
--- a/wgpu/src/triangle/solid.rs
+++ b/wgpu/src/triangle/solid.rs
@@ -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)],
+ )
}
-} \ No newline at end of file
+}