File tree Expand file tree Collapse file tree
tests/tests/wgpu-validation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,3 +56,18 @@ fn device_and_buffers() {
5656 device. poll ( wgpu:: PollType :: wait_indefinitely ( ) ) . unwrap ( ) ;
5757 assert ! ( done2. load( Relaxed ) ) ;
5858}
59+
60+ #[ test]
61+ fn transfer_overflow ( ) {
62+ let ( device, queue) = wgpu:: Device :: noop ( & wgpu:: DeviceDescriptor :: default ( ) ) ;
63+
64+ // Create a small buffer. We don't care about the size of this buffer, just that we can use it.
65+ let buffer = device. create_buffer ( & wgpu:: BufferDescriptor {
66+ label : Some ( "hello world" ) ,
67+ size : 8 ,
68+ usage : wgpu:: BufferUsages :: COPY_DST | wgpu:: BufferUsages :: COPY_SRC ,
69+ mapped_at_creation : false ,
70+ } ) ;
71+
72+ buffer. map_async ( wgpu:: MapMode :: Read , , callback) ;
73+ }
Original file line number Diff line number Diff line change @@ -610,7 +610,7 @@ impl Buffer {
610610 return Err ( ( op, BufferAccessError :: UnalignedRangeSize { range_size } ) ) ;
611611 }
612612
613- if offset >= self . size {
613+ if offset > self . size {
614614 return Err ( (
615615 op,
616616 BufferAccessError :: MapStartOffsetOverrun {
You can’t perform that action at this time.
0 commit comments