gfx-rs nuts and bolts

gfx-rs is a project bringing efficient cross-platform graphics to rust. This blog supposedly hosts the major milestones, concepts, and recaps of the project.

Release of a Pure-Rust v0.10 and a Call For Testing

18 Aug 2021

gfx-rs community’s goal is to make graphics programming in Rust easy, fast, and reliable. Our main projects are:

  • wgpu is built on top of wgpu-hal and naga. It provides safety, accessibility, and portability for graphics applications.
  • naga translates shader programs between languages, including WGSL. It also provides shader validation and transformation, ensuring user code running on the GPU is safe and efficient.

If you’ve been following these releases you’ll notice that gfx-hal is absent from this list. gfx-hal has now been deprecated in favor of a new abstraction layer inside of wgpu called wgpu-hal. To see more information about the deprecation, see the 0.9 release post.

Following our release cadence every few months, we rolled out 0.10 through all of the gfx-rs projects! See wgpu v0.10 changelog and naga v0.6 changelog for the details.

Pure-Rust Graphics

wgpu has had many new changes, the most notible of which is the switch to our new Hardware Abstraction Layer wgpu-hal. This includes completely rebuilt backends which are more efficient, easier to maintain, and signifigantly leaner. As part of this, we have shed our last C/C++ dependency spirv-cross. We now are entirely based on naga for all of our shader translation. This is not only a marked achievement for rust graphics, but has made wgpu safer and more robust.

The new wgpu-hal:

  • Supports Vulkan, D3D12, Metal, and OpenGL ES with D3D11 to come soon.
  • Has 60% fewer lines of code than gfx-hal (22k LOC vs 55k)
  • Maps better to the wide variety of backends we need to support.

Other notable changes within wgpu:

  • Many api improvements and bug fixes.
  • New automated testing infrastructure.

naga has continued to matured significantly since the last release:

  • hlsl output is now supported and working well.
  • wgsl parsing has had numerous bugs fixed.
  • spirv parsing support continues to be very difficult but improving steadily.
  • With wgpu-hal now dependending on naga, all code paths have gotten signifigant testing.
  • Validation has gotten more complete and correct.

Call For Testing

This is an extremely big release for us. While we have confidence in our code and we have tested it extensively, we need everyone’s help in testing this new release! As such we ask if people can update to the latest wgpu and report to us any problems or issues you face.

If you aren’t sure if something is an issue, feel free to hop on our matrix chat to discuss.

Thank You!

Thanks to the countless contributors that helped out with this massive release! wgpu’s momentum is truely incredible due to everyone’s contributions and we look forward to seeing the amazing places wgpu will go as a project. If you are interested in helping, take a look at our good-first-issues, our issues with help wanted, or contact us on our matrix chat, we are always willing to help mentor first time and returning contributors.

Additionally, thank you to all the users who report new issues, ask for enhancements, or test the git version of wgpu. Keep it coming!

Happy rendering!