Skip to content

Commit

Permalink
revert changes to zero_init_texture_after_discard
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy committed Nov 22, 2023
1 parent 877dd5b commit e97ac96
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tests/tests/zero_init_texture_after_discard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ static DISCARDING_COLOR_TARGET_RESETS_TEXTURE_INIT_STATE_CHECK_VISIBLE_ON_COPY_A
let mut case = TestCase::new(&mut ctx, TextureFormat::Rgba8UnormSrgb);
case.create_command_encoder();
case.discard();
case.submit_command_encoder();

case.create_command_encoder();
case.copy_texture_to_buffer();
case.submit_command_encoder_and_wait();
case.submit_command_encoder();

case.assert_buffers_are_zero();
});
Expand All @@ -28,7 +31,7 @@ static DISCARDING_COLOR_TARGET_RESETS_TEXTURE_INIT_STATE_CHECK_VISIBLE_ON_COPY_I
case.create_command_encoder();
case.discard();
case.copy_texture_to_buffer();
case.submit_command_encoder_and_wait();
case.submit_command_encoder();

case.assert_buffers_are_zero();
});
Expand All @@ -55,7 +58,7 @@ static DISCARDING_DEPTH_TARGET_RESETS_TEXTURE_INIT_STATE_CHECK_VISIBLE_ON_COPY_I
case.create_command_encoder();
case.discard();
case.copy_texture_to_buffer();
case.submit_command_encoder_and_wait();
case.submit_command_encoder();

case.assert_buffers_are_zero();
}
Expand Down Expand Up @@ -85,9 +88,15 @@ static DISCARDING_EITHER_DEPTH_OR_STENCIL_ASPECT_TEST: GpuTestConfiguration =
let mut case = TestCase::new(&mut ctx, format);
case.create_command_encoder();
case.discard_depth();
case.submit_command_encoder();

case.create_command_encoder();
case.discard_stencil();
case.submit_command_encoder();

case.create_command_encoder();
case.copy_texture_to_buffer();
case.submit_command_encoder_and_wait();
case.submit_command_encoder();

case.assert_buffers_are_zero();
}
Expand Down Expand Up @@ -205,11 +214,10 @@ impl<'ctx> TestCase<'ctx> {
)
}

pub fn submit_command_encoder_and_wait(&mut self) {
pub fn submit_command_encoder(&mut self) {
self.ctx
.queue
.submit([self.encoder.take().unwrap().finish()]);
self.ctx.device.poll(MaintainBase::Wait);
}

pub fn discard(&mut self) {
Expand Down

0 comments on commit e97ac96

Please sign in to comment.