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

Make wgpu_test::valid print errors it detects. #6136

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

jimblandy
Copy link
Member

@jimblandy jimblandy commented Aug 20, 2024

When a block passed to wgpu_test::valid actually raises validation errors, include the full error in the panic message.

I'm not sure this is the best place to put this. Certainly the output from the test suite when we hit this is not neat. But it seems like this is the only place that actually has the validation error in hand, so I'm not sure what else to do. It looks like this:

thread '<unnamed>' panicked at tests/tests/bounds_checks/buffer.rs:15:5:
`valid` block at tests/tests/bounds_checks/buffer.rs:15:5 encountered wgpu error
Validation Error

Caused by:
  In Device::create_bind_group_layout, label = 'buffer_storage'
    Too many bindings of type StorageBuffers in Stage ShaderStages(COMPUTE), limit is 0, count was 2. Check the limit `max_storage_buffers_per_shader_stage` passed to `Adapter::request_device`

In Device::create_bind_group_layout, label = 'buffer_storage'
Too many bindings of type StorageBuffers in Stage ShaderStages(COMPUTE), limit is 0, count was 2. Check the limit `max_storage_buffers_per_shader_stage` passed to `Adapter::request_device`

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2024-08-20T19:24:25Z ERROR wgpu_test::expectations] Panic: `valid` block at tests/tests/bounds_checks/buffer.rs:15:5 encountered wgpu error
    Validation Error
    
    Caused by:
      In Device::create_bind_group_layout, label = 'buffer_storage'
        Too many bindings of type StorageBuffers in Stage ShaderStages(COMPUTE), limit is 0, count was 2. Check the limit `max_storage_buffers_per_shader_stage` passed to `Adapter::request_device`
    
    In Device::create_bind_group_layout, label = 'buffer_storage'
    Too many bindings of type StorageBuffers in Stage ShaderStages(COMPUTE), limit is 0, count was 2. Check the limit `max_storage_buffers_per_shader_stage` passed to `Adapter::request_device`
    
thread '<unnamed>' panicked at tests/src/run.rs:120:9:
tests/tests/bounds_checks/buffer.rs:5:47: test "wgpu_test::bounds_checks::buffer::buffer_storage" did not behave as expected

But it's definitely more helpful than not seeing the validation error.

@jimblandy jimblandy requested a review from a team as a code owner August 20, 2024 19:25
tests/src/lib.rs Outdated Show resolved Hide resolved
jimblandy and others added 2 commits August 23, 2024 10:05
When a block passed to `wgpu_test::valid` actually raises validation
errors, include the full error in the panic message.
@ErichDonGubler ErichDonGubler added the area: infrastructure Testing, building, coordinating issues label Aug 23, 2024
@ErichDonGubler ErichDonGubler enabled auto-merge (squash) August 23, 2024 14:06
@ErichDonGubler ErichDonGubler merged commit 15d64c3 into gfx-rs:trunk Aug 23, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: infrastructure Testing, building, coordinating issues
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants