wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Add multiple render targets example (v2)

Open kaphula opened this issue 2 years ago • 2 comments

Connections This PR depends on https://github.com/gfx-rs/wgpu/pull/5312

This is a new version of https://github.com/gfx-rs/wgpu/pull/5297 which had some issues.

Description This PR adds a new example that demonstrates how to use multiple render targets when you want to render to two or more targets from the fragment shader.

As far as I know, none of the existing examples demonstrate this, and furthermore, finding information about how to do this with wgpu seems to be way too challenging, or at least it was for me. I had to ask help from multiple people who knew how to do this, and before that I was not even sure if this was possible at all.

Testing I am not sure if this should or can be tested, or if the core feature has already been tested. Suggestions or instructions are welcome on how to implement the required tests.

Checklist

  • [x] Run cargo fmt.
  • [x] Run cargo clippy. If applicable, add:
    • [ ] --target wasm32-unknown-unknown
    • [ ] --target wasm32-unknown-emscripten
  • [x] Run cargo xtask test to run tests.
  • [x] Add change to CHANGELOG.md. See simple instructions inside file.

kaphula avatar Feb 27 '24 22:02 kaphula

@cwfitzgerald Your requested changes are now implemented. Let me know if there is anything else.

kaphula avatar Mar 14 '24 06:03 kaphula

I added another commit to make all the imports direct as I realized that is probably what you meant and not just the wgpu imports.

kaphula avatar Mar 15 '24 05:03 kaphula