aboutsummaryrefslogtreecommitdiff
path: root/flowy/src/motion/enc.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-11-18 02:08:41 +0100
committermetamuffin <metamuffin@disroot.org>2023-11-18 02:08:41 +0100
commitebd59fb09a4e094701f195d86662e1a9d00fed2b (patch)
tree2e24901b15493612c73ede8fcb4cacde49e9692e /flowy/src/motion/enc.rs
parent3deb911083605ad5b63a0ecd372e4ae437c11b4a (diff)
downloadvideo-codec-experiments-ebd59fb09a4e094701f195d86662e1a9d00fed2b.tar
video-codec-experiments-ebd59fb09a4e094701f195d86662e1a9d00fed2b.tar.bz2
video-codec-experiments-ebd59fb09a4e094701f195d86662e1a9d00fed2b.tar.zst
rudimentary mcomp
Diffstat (limited to 'flowy/src/motion/enc.rs')
-rw-r--r--flowy/src/motion/enc.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/flowy/src/motion/enc.rs b/flowy/src/motion/enc.rs
index aa45d7b..76a2c7f 100644
--- a/flowy/src/motion/enc.rs
+++ b/flowy/src/motion/enc.rs
@@ -1,12 +1,11 @@
-use std::mem::size_of;
-
use super::{CommonBuffers, Params, RoundParams};
use bytemuck::{Pod, Zeroable};
+use std::mem::size_of;
use wgpu::{
include_wgsl, BindGroup, BindGroupDescriptor, BindGroupEntry, BindGroupLayoutDescriptor,
BindGroupLayoutEntry, BindingType, Buffer, BufferDescriptor, BufferUsages, CommandEncoder,
ComputePipeline, ComputePipelineDescriptor, Device, PipelineLayoutDescriptor, Queue,
- ShaderStages, TextureFormat, TextureSampleType, TextureViewDimension,
+ ShaderStages, TextureSampleType, TextureViewDimension,
};
pub struct MotionEncoder {
@@ -101,7 +100,7 @@ impl MotionEncoder {
BindGroupEntry {
binding: 2,
resource: wgpu::BindingResource::TextureView(
- &bufs.textures[1 - i].create_view(&Default::default()),
+ &bufs.textures[i].create_view(&Default::default()),
),
},
BindGroupEntry {
@@ -136,7 +135,7 @@ impl MotionEncoder {
}
}
- pub fn write_uniforms(&self, queue: Queue) {
+ pub fn write_uniforms(&self, queue: &Queue) {
queue.write_buffer(
&self.uniform_buffer,
0,
@@ -151,6 +150,6 @@ impl MotionEncoder {
});
cpass.set_pipeline(&self.pipeline);
cpass.set_bind_group(0, &self.bind_groups[rp.swap], &[]);
- cpass.dispatch_workgroups(params.extent.width, params.extent.height, 1);
+ cpass.dispatch_workgroups(params.blocks_x as u32, params.blocks_y as u32, 1);
}
}