gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.43k stars 908 forks source link

Render pipeline without FragmentState or FragmentState with empty targets causes validation error on Android #2084

Open larsjarlvik opened 3 years ago

larsjarlvik commented 3 years ago

Description Validation fails with the with not enough memory left error on Android if you create a pipeline without FragmentState or a FragmentState with targets set to empty:

10-16 22:27:30.380 18761 18800 I RustStdoutStderr: thread '<unnamed>' panicked at 'wgpu error: Validation Error
10-16 22:27:30.380 18761 18800 I RustStdoutStderr:
10-16 22:27:30.380 18761 18800 I RustStdoutStderr: Caused by:
10-16 22:27:30.380 18761 18800 I RustStdoutStderr:     In Device::create_render_pipeline
10-16 22:27:30.380 18761 18800 I RustStdoutStderr:       note: label = `model_shadows_render_pipeline`
10-16 22:27:30.380 18761 18800 I RustStdoutStderr:     not enough memory left

The pipeline works fine on Windows and Linux but fails on Android (tested on Pixel 5 with Android 11).

Repro steps Create a shader and render pipeline without a fragment stage.

Reproducible example: https://github.com/larsjarlvik/wgpu-android-fragment/

Expected vs observed behavior Validation should pass and run on Android.

Platform Tested with wgpu version "0.11.0" and "0.10.1" Android 11 with vulkan backend

kvark commented 3 years ago

Looks like some validation is missing on that front. Thank you for reporting!