mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 14:31:08 +01:00
Playtest for binding a group
This commit is contained in:
1 parent
1886149cae
commit
eed8bf84ef
8 files changed
+99
-11
No files matched your search
@@ -2,6 +2,7 @@
|
||||
backends: (bits: 0x7),
|
||||
tests: [
|
||||
"buffer-copy.ron",
|
||||
"bind-group.ron",
|
||||
"quad.ron",
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,76 @@
|
||||
(
|
||||
features: (bits: 0x0),
|
||||
expectations: [], //not crash!
|
||||
actions: [
|
||||
CreatePipelineLayout(Id(0, 1, Empty), (
|
||||
label: Some("empty"),
|
||||
bind_group_layouts: [],
|
||||
push_constant_ranges: [],
|
||||
)),
|
||||
CreateShaderModule(
|
||||
id: Id(0, 1, Empty),
|
||||
data: "empty.comp.spv",
|
||||
),
|
||||
CreateComputePipeline(Id(0, 1, Empty), (
|
||||
label: None,
|
||||
layout: Some(Id(0, 1, Empty)),
|
||||
compute_stage: (
|
||||
module: Id(0, 1, Empty),
|
||||
entry_point: "main",
|
||||
),
|
||||
)),
|
||||
CreateBuffer(Id(0, 1, Empty), (
|
||||
label: None,
|
||||
size: 16,
|
||||
usage: (
|
||||
bits: 64,
|
||||
),
|
||||
mapped_at_creation: false,
|
||||
)),
|
||||
CreateBindGroupLayout(Id(0, 1, Empty), (
|
||||
label: None,
|
||||
entries: [
|
||||
(
|
||||
binding: 0,
|
||||
visibility: (bits: 0x3),
|
||||
ty: UniformBuffer(
|
||||
dynamic: false,
|
||||
min_binding_size: None,
|
||||
),
|
||||
count: None,
|
||||
),
|
||||
],
|
||||
)),
|
||||
CreateBindGroup(Id(0, 1, Empty), (
|
||||
label: None,
|
||||
layout: Id(0, 1, Empty),
|
||||
entries: [
|
||||
(
|
||||
binding: 0,
|
||||
resource: Buffer((
|
||||
buffer_id: Id(0, 1, Empty),
|
||||
offset: 0,
|
||||
size: None,
|
||||
)),
|
||||
)
|
||||
],
|
||||
)),
|
||||
Submit(1, [
|
||||
RunComputePass(
|
||||
base: (
|
||||
commands: [
|
||||
SetPipeline(Id(0, 1, Empty)),
|
||||
SetBindGroup(
|
||||
index: 0,
|
||||
num_dynamic_offsets: 0,
|
||||
bind_group_id: Id(0, 1, Empty),
|
||||
),
|
||||
],
|
||||
dynamic_offsets: [],
|
||||
string_data: [],
|
||||
push_constant_data: [],
|
||||
),
|
||||
),
|
||||
]),
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
#version 450
|
||||
layout(local_size_x = 1) in;
|
||||
|
||||
void main() {
|
||||
}
|
||||
Binary file not shown.
@@ -3,7 +3,7 @@
|
||||
expectations: [
|
||||
(
|
||||
name: "Quad",
|
||||
buffer: (index: 1, epoch: 1),
|
||||
buffer: (index: 0, epoch: 1),
|
||||
offset: 0,
|
||||
data: File("quad.bin", 16384),
|
||||
)
|
||||
@@ -38,7 +38,7 @@
|
||||
desc: (),
|
||||
),
|
||||
CreateBuffer(
|
||||
Id(1, 1, Empty),
|
||||
Id(0, 1, Empty),
|
||||
(
|
||||
label: Some("Output Buffer"),
|
||||
size: 16384,
|
||||
@@ -135,7 +135,7 @@
|
||||
array_layer: 0,
|
||||
),
|
||||
dst: (
|
||||
buffer: Id(1, 1, Empty),
|
||||
buffer: Id(0, 1, Empty),
|
||||
layout: (
|
||||
offset: 0,
|
||||
bytes_per_row: 256,
|
||||
@@ -149,7 +149,5 @@
|
||||
),
|
||||
),
|
||||
]),
|
||||
DestroyShaderModule(Id(0, 1, Empty)),
|
||||
DestroyShaderModule(Id(1, 1, Empty)),
|
||||
],
|
||||
)
|
||||
Reference in new issue
Block a user