Skip to content

Commit

Permalink
1.1.1 maker?
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjackyuanjie committed Apr 9, 2024
1 parent 171e35c commit 4bcdbe9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 23 deletions.
4 changes: 2 additions & 2 deletions maker-py/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

gray = (200, 200, 200)

_version_ = "1.1.0"
_version_ = "1.1.1"


class NumStatus(IntEnum):
Expand Down Expand Up @@ -220,7 +220,7 @@ def init_name_diy(self) -> None:
)
# 从大到小
num_group = Group(parent=self.num_group, order=10)
for i in range(256):
for i in range(89, 217):
num_name = NumWidget(
num=i, batch=self.main_batch, group=num_group, x=40, y=50
)
Expand Down
3 changes: 2 additions & 1 deletion maker-py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"random",
"lzma",
"bz2",
"decimal"
"decimal",
"ssl"
],
}

Expand Down
17 changes: 17 additions & 0 deletions maker-py/update_log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 八围制造器 更新日志

## 1.x

### 1.1.1

修复了左下角多出来的那一堆 block

修复了计算血量时只用了 `[3:6]` (即 3-5) 的问题

### 1.1.0

修复了忘记在计算值的时候 `&63` 的问题

### 1.0

发布啦!
40 changes: 20 additions & 20 deletions wgpu-mine/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ async fn execute_gpu_inner(
// A storage buffer (can be bound within a bind group and thus available to a shader).
// The destination of a copy.
// The source of a copy.
let storage_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
label: Some("Storage Buffer"),
contents: bytemuck::cast_slice(numbers),
usage: wgpu::BufferUsages::STORAGE
| wgpu::BufferUsages::COPY_DST
| wgpu::BufferUsages::COPY_SRC,
});
// let storage_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
// label: Some("Storage Buffer"),
// contents: bytemuck::cast_slice(numbers),
// usage: wgpu::BufferUsages::STORAGE
// | wgpu::BufferUsages::COPY_DST
// | wgpu::BufferUsages::COPY_SRC,
// });

// A bind group defines how buffers are accessed by shaders.
// It is to WebGPU what a descriptor set is to Vulkan.
Expand All @@ -118,20 +118,20 @@ async fn execute_gpu_inner(
label: None,
layout: None,
module: &cs_module,
entry_point: "main",
entry_point: "team_bytes",
// constants: &Default::default(),
});

// Instantiates the bind group, once again specifying the binding of buffers.
let bind_group_layout = compute_pipeline.get_bind_group_layout(0);
let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
label: None,
layout: &bind_group_layout,
entries: &[wgpu::BindGroupEntry {
binding: 0,
resource: storage_buffer.as_entire_binding(),
}],
});
// let bind_group_layout = compute_pipeline.get_bind_group_layout(0);
// let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
// label: None,
// layout: &bind_group_layout,
// entries: &[wgpu::BindGroupEntry {
// binding: 0,
// resource: storage_buffer.as_entire_binding(),
// }],
// });

// A command encoder executes one or many pipelines.
// It is to WebGPU what a command buffer is to Vulkan.
Expand All @@ -143,13 +143,13 @@ async fn execute_gpu_inner(
timestamp_writes: None,
});
cpass.set_pipeline(&compute_pipeline);
cpass.set_bind_group(0, &bind_group, &[]);
// cpass.set_bind_group(0, &bind_group, &[]);
cpass.insert_debug_marker("compute collatz iterations");
cpass.dispatch_workgroups(numbers.len() as u32, 1, 1); // Number of cells to run, the (x,y,z) size of item being processed
// cpass.dispatch_workgroups(numbers.len() as u32, 1, 1); // Number of cells to run, the (x,y,z) size of item being processed
}
// Sets adds copy operation to command encoder.
// Will copy data from storage buffer on GPU to staging buffer on CPU.
encoder.copy_buffer_to_buffer(&storage_buffer, 0, &staging_buffer, 0, size);
// encoder.copy_buffer_to_buffer(&storage_buffer, 0, &staging_buffer, 0, size);

// Submits command encoder for processing
queue.submit(Some(encoder.finish()));
Expand Down

0 comments on commit 4bcdbe9

Please sign in to comment.