6
6
extern crate wgpu_core as wgc;
7
7
extern crate wgpu_types as wgt;
8
8
9
- use wgc:: { device:: trace, identity:: IdentityManager } ;
9
+ use wgc:: { command :: Command , device:: trace, identity:: IdentityManager } ;
10
10
11
11
use std:: { borrow:: Cow , fs, path:: Path } ;
12
12
13
13
pub trait GlobalPlay {
14
14
fn encode_commands (
15
15
& self ,
16
16
encoder : wgc:: id:: CommandEncoderId ,
17
- commands : Vec < trace :: Command > ,
17
+ commands : Vec < Command > ,
18
18
command_buffer_id_manager : & mut IdentityManager < wgc:: id:: markers:: CommandBuffer > ,
19
19
) -> wgc:: id:: CommandBufferId ;
20
20
fn process (
@@ -32,12 +32,12 @@ impl GlobalPlay for wgc::global::Global {
32
32
fn encode_commands (
33
33
& self ,
34
34
encoder : wgc:: id:: CommandEncoderId ,
35
- commands : Vec < trace :: Command > ,
35
+ commands : Vec < Command > ,
36
36
command_buffer_id_manager : & mut IdentityManager < wgc:: id:: markers:: CommandBuffer > ,
37
37
) -> wgc:: id:: CommandBufferId {
38
38
for command in commands {
39
39
match command {
40
- trace :: Command :: CopyBufferToBuffer {
40
+ Command :: CopyBufferToBuffer {
41
41
src,
42
42
src_offset,
43
43
dst,
@@ -48,31 +48,31 @@ impl GlobalPlay for wgc::global::Global {
48
48
encoder, src, src_offset, dst, dst_offset, size,
49
49
)
50
50
. unwrap ( ) ,
51
- trace :: Command :: CopyBufferToTexture { src, dst, size } => self
51
+ Command :: CopyBufferToTexture { src, dst, size } => self
52
52
. command_encoder_copy_buffer_to_texture ( encoder, & src, & dst, & size)
53
53
. unwrap ( ) ,
54
- trace :: Command :: CopyTextureToBuffer { src, dst, size } => self
54
+ Command :: CopyTextureToBuffer { src, dst, size } => self
55
55
. command_encoder_copy_texture_to_buffer ( encoder, & src, & dst, & size)
56
56
. unwrap ( ) ,
57
- trace :: Command :: CopyTextureToTexture { src, dst, size } => self
57
+ Command :: CopyTextureToTexture { src, dst, size } => self
58
58
. command_encoder_copy_texture_to_texture ( encoder, & src, & dst, & size)
59
59
. unwrap ( ) ,
60
- trace :: Command :: ClearBuffer { dst, offset, size } => self
60
+ Command :: ClearBuffer { dst, offset, size } => self
61
61
. command_encoder_clear_buffer ( encoder, dst, offset, size)
62
62
. unwrap ( ) ,
63
- trace :: Command :: ClearTexture {
63
+ Command :: ClearTexture {
64
64
dst,
65
65
subresource_range,
66
66
} => self
67
67
. command_encoder_clear_texture ( encoder, dst, & subresource_range)
68
68
. unwrap ( ) ,
69
- trace :: Command :: WriteTimestamp {
69
+ Command :: WriteTimestamp {
70
70
query_set_id,
71
71
query_index,
72
72
} => self
73
73
. command_encoder_write_timestamp ( encoder, query_set_id, query_index)
74
74
. unwrap ( ) ,
75
- trace :: Command :: ResolveQuerySet {
75
+ Command :: ResolveQuerySet {
76
76
query_set_id,
77
77
start_query,
78
78
query_count,
@@ -88,16 +88,14 @@ impl GlobalPlay for wgc::global::Global {
88
88
destination_offset,
89
89
)
90
90
. unwrap ( ) ,
91
- trace :: Command :: PushDebugGroup ( marker) => self
91
+ Command :: PushDebugGroup ( marker) => self
92
92
. command_encoder_push_debug_group ( encoder, & marker)
93
93
. unwrap ( ) ,
94
- trace:: Command :: PopDebugGroup => {
95
- self . command_encoder_pop_debug_group ( encoder) . unwrap ( )
96
- }
97
- trace:: Command :: InsertDebugMarker ( marker) => self
94
+ Command :: PopDebugGroup => self . command_encoder_pop_debug_group ( encoder) . unwrap ( ) ,
95
+ Command :: InsertDebugMarker ( marker) => self
98
96
. command_encoder_insert_debug_marker ( encoder, & marker)
99
97
. unwrap ( ) ,
100
- trace :: Command :: RunComputePass {
98
+ Command :: RunComputePass {
101
99
base,
102
100
timestamp_writes,
103
101
} => {
@@ -107,7 +105,7 @@ impl GlobalPlay for wgc::global::Global {
107
105
timestamp_writes. as_ref ( ) ,
108
106
) ;
109
107
}
110
- trace :: Command :: RunRenderPass {
108
+ Command :: RunRenderPass {
111
109
base,
112
110
target_colors,
113
111
target_depth_stencil,
@@ -123,7 +121,7 @@ impl GlobalPlay for wgc::global::Global {
123
121
occlusion_query_set_id,
124
122
) ;
125
123
}
126
- trace :: Command :: BuildAccelerationStructures { blas, tlas } => {
124
+ Command :: BuildAccelerationStructures { blas, tlas } => {
127
125
let blas_iter = blas. iter ( ) . map ( |x| {
128
126
let geometries = match & x. geometries {
129
127
wgc:: ray_tracing:: TraceBlasGeometries :: TriangleGeometries (
0 commit comments