Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert changes to zero_init_texture_after_discard #4739

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading