@@ -95,78 +95,84 @@ async fn test_empty_buffer_range(ctx: &TestingContext, buffer_size: u64, label:
95
95
96
96
#[ gpu_test]
97
97
static EMPTY_BUFFER : GpuTestConfiguration = GpuTestConfiguration :: new ( )
98
- . parameters ( TestParameters :: default ( ) . expect_fail ( FailureCase :: always ( ) ) )
98
+ . parameters (
99
+ TestParameters :: default ( )
100
+ . expect_fail ( FailureCase :: always ( ) )
101
+ . enable_noop ( ) ,
102
+ )
99
103
. run_async ( |ctx| async move {
100
104
test_empty_buffer_range ( & ctx, 2048 , "regular buffer" ) . await ;
101
105
test_empty_buffer_range ( & ctx, 0 , "zero-sized buffer" ) . await ;
102
106
} ) ;
103
107
104
108
#[ gpu_test]
105
- static MAP_OFFSET : GpuTestConfiguration = GpuTestConfiguration :: new ( ) . run_async ( |ctx| async move {
106
- // This test writes 16 bytes at the beginning of buffer mapped mapped with
107
- // an offset of 32 bytes. Then the buffer is copied into another buffer that
108
- // is read back and we check that the written bytes are correctly placed at
109
- // offset 32..48.
110
- // The goal is to check that get_mapped_range did not accidentally double-count
111
- // the mapped offset.
112
-
113
- let write_buf = ctx. device . create_buffer ( & wgpu:: BufferDescriptor {
114
- label : None ,
115
- size : 256 ,
116
- usage : wgpu:: BufferUsages :: MAP_WRITE | wgpu:: BufferUsages :: COPY_SRC ,
117
- mapped_at_creation : false ,
118
- } ) ;
119
- let read_buf = ctx. device . create_buffer ( & wgpu:: BufferDescriptor {
120
- label : None ,
121
- size : 256 ,
122
- usage : wgpu:: BufferUsages :: MAP_READ | wgpu:: BufferUsages :: COPY_DST ,
123
- mapped_at_creation : false ,
124
- } ) ;
125
-
126
- write_buf
127
- . slice ( 32 ..)
128
- . map_async ( wgpu:: MapMode :: Write , move |result| {
129
- result. unwrap ( ) ;
109
+ static MAP_OFFSET : GpuTestConfiguration = GpuTestConfiguration :: new ( )
110
+ . parameters ( TestParameters :: default ( ) . enable_noop ( ) )
111
+ . run_async ( |ctx| async move {
112
+ // This test writes 16 bytes at the beginning of buffer mapped mapped with
113
+ // an offset of 32 bytes. Then the buffer is copied into another buffer that
114
+ // is read back and we check that the written bytes are correctly placed at
115
+ // offset 32..48.
116
+ // The goal is to check that get_mapped_range did not accidentally double-count
117
+ // the mapped offset.
118
+
119
+ let write_buf = ctx. device . create_buffer ( & wgpu:: BufferDescriptor {
120
+ label : None ,
121
+ size : 256 ,
122
+ usage : wgpu:: BufferUsages :: MAP_WRITE | wgpu:: BufferUsages :: COPY_SRC ,
123
+ mapped_at_creation : false ,
124
+ } ) ;
125
+ let read_buf = ctx. device . create_buffer ( & wgpu:: BufferDescriptor {
126
+ label : None ,
127
+ size : 256 ,
128
+ usage : wgpu:: BufferUsages :: MAP_READ | wgpu:: BufferUsages :: COPY_DST ,
129
+ mapped_at_creation : false ,
130
130
} ) ;
131
131
132
- ctx. async_poll ( wgpu:: PollType :: wait ( ) ) . await . unwrap ( ) ;
132
+ write_buf
133
+ . slice ( 32 ..)
134
+ . map_async ( wgpu:: MapMode :: Write , move |result| {
135
+ result. unwrap ( ) ;
136
+ } ) ;
133
137
134
- {
135
- let slice = write_buf. slice ( 32 ..48 ) ;
136
- let mut view = slice. get_mapped_range_mut ( ) ;
137
- for byte in & mut view[ ..] {
138
- * byte = 2 ;
138
+ ctx. async_poll ( wgpu:: PollType :: wait ( ) ) . await . unwrap ( ) ;
139
+
140
+ {
141
+ let slice = write_buf. slice ( 32 ..48 ) ;
142
+ let mut view = slice. get_mapped_range_mut ( ) ;
143
+ for byte in & mut view[ ..] {
144
+ * byte = 2 ;
145
+ }
139
146
}
140
- }
141
147
142
- write_buf. unmap ( ) ;
148
+ write_buf. unmap ( ) ;
143
149
144
- let mut encoder = ctx
145
- . device
146
- . create_command_encoder ( & wgpu:: CommandEncoderDescriptor { label : None } ) ;
150
+ let mut encoder = ctx
151
+ . device
152
+ . create_command_encoder ( & wgpu:: CommandEncoderDescriptor { label : None } ) ;
147
153
148
- encoder. copy_buffer_to_buffer ( & write_buf, 0 , & read_buf, 0 , 256 ) ;
154
+ encoder. copy_buffer_to_buffer ( & write_buf, 0 , & read_buf, 0 , 256 ) ;
149
155
150
- ctx. queue . submit ( Some ( encoder. finish ( ) ) ) ;
156
+ ctx. queue . submit ( Some ( encoder. finish ( ) ) ) ;
151
157
152
- read_buf
153
- . slice ( ..)
154
- . map_async ( wgpu:: MapMode :: Read , Result :: unwrap) ;
158
+ read_buf
159
+ . slice ( ..)
160
+ . map_async ( wgpu:: MapMode :: Read , Result :: unwrap) ;
155
161
156
- ctx. async_poll ( wgpu:: PollType :: wait ( ) ) . await . unwrap ( ) ;
162
+ ctx. async_poll ( wgpu:: PollType :: wait ( ) ) . await . unwrap ( ) ;
157
163
158
- let slice = read_buf. slice ( ..) ;
159
- let view = slice. get_mapped_range ( ) ;
160
- for byte in & view[ 0 ..32 ] {
161
- assert_eq ! ( * byte, 0 ) ;
162
- }
163
- for byte in & view[ 32 ..48 ] {
164
- assert_eq ! ( * byte, 2 ) ;
165
- }
166
- for byte in & view[ 48 ..] {
167
- assert_eq ! ( * byte, 0 ) ;
168
- }
169
- } ) ;
164
+ let slice = read_buf. slice ( ..) ;
165
+ let view = slice. get_mapped_range ( ) ;
166
+ for byte in & view[ 0 ..32 ] {
167
+ assert_eq ! ( * byte, 0 ) ;
168
+ }
169
+ for byte in & view[ 32 ..48 ] {
170
+ assert_eq ! ( * byte, 2 ) ;
171
+ }
172
+ for byte in & view[ 48 ..] {
173
+ assert_eq ! ( * byte, 0 ) ;
174
+ }
175
+ } ) ;
170
176
171
177
/// The WebGPU algorithm [validating shader binding][vsb] requires
172
178
/// implementations to check that buffer bindings are large enough to
@@ -177,7 +183,7 @@ static MAP_OFFSET: GpuTestConfiguration = GpuTestConfiguration::new().run_async(
177
183
/// 16 for that variable's group/index. Pipeline creation should fail.
178
184
#[ gpu_test]
179
185
static MINIMUM_BUFFER_BINDING_SIZE_LAYOUT : GpuTestConfiguration = GpuTestConfiguration :: new ( )
180
- . parameters ( TestParameters :: default ( ) . test_features_limits ( ) )
186
+ . parameters ( TestParameters :: default ( ) . test_features_limits ( ) . enable_noop ( ) )
181
187
. run_sync ( |ctx| {
182
188
// Create a shader module that statically uses a storage buffer.
183
189
let shader_module = ctx
@@ -247,7 +253,7 @@ static MINIMUM_BUFFER_BINDING_SIZE_LAYOUT: GpuTestConfiguration = GpuTestConfigu
247
253
/// binding. Command recording should fail.
248
254
#[ gpu_test]
249
255
static MINIMUM_BUFFER_BINDING_SIZE_DISPATCH : GpuTestConfiguration = GpuTestConfiguration :: new ( )
250
- . parameters ( TestParameters :: default ( ) . test_features_limits ( ) )
256
+ . parameters ( TestParameters :: default ( ) . test_features_limits ( ) . enable_noop ( ) )
251
257
. run_sync ( |ctx| {
252
258
// This test tries to use a bindgroup layout with a
253
259
// min_binding_size of 16 to an index whose WGSL type requires 32
@@ -344,7 +350,7 @@ static MINIMUM_BUFFER_BINDING_SIZE_DISPATCH: GpuTestConfiguration = GpuTestConfi
344
350
345
351
#[ gpu_test]
346
352
static CLEAR_OFFSET_OUTSIDE_RESOURCE_BOUNDS : GpuTestConfiguration = GpuTestConfiguration :: new ( )
347
- . parameters ( TestParameters :: default ( ) )
353
+ . parameters ( TestParameters :: default ( ) . enable_noop ( ) )
348
354
. run_sync ( |ctx| {
349
355
let size = 16 ;
350
356
@@ -370,7 +376,7 @@ static CLEAR_OFFSET_OUTSIDE_RESOURCE_BOUNDS: GpuTestConfiguration = GpuTestConfi
370
376
#[ gpu_test]
371
377
static CLEAR_OFFSET_PLUS_SIZE_OUTSIDE_U64_BOUNDS : GpuTestConfiguration =
372
378
GpuTestConfiguration :: new ( )
373
- . parameters ( TestParameters :: default ( ) )
379
+ . parameters ( TestParameters :: default ( ) . enable_noop ( ) )
374
380
. run_sync ( |ctx| {
375
381
let buffer = ctx. device . create_buffer ( & wgpu:: BufferDescriptor {
376
382
label : None ,
0 commit comments