New Mesa Vec4 Backend For Intel, Supports Their NIR Goals
Written by Michael Larabel in Intel on 30 June 2015 at 12:32 PM EDT. 2 Comments
Eduardo Lima Mitev of Igalia last week published a new vec4 back-end based on NIR for the Mesa i965 DRI driver. This work is part of implementing a NIR to Vec4 pass in order to allow using NIR for everything.

NIR is the promising new intermediate representation that's evolved quite well in Mesa over the past few months and has started to be used in select areas. Besides Intel using NIR after it was originally designed by their high school intern, there's interest in NIR from other Mesa/Gallium3D drivers like VC4 (the Raspberry Pi driver) and Freedreno (for Qualcomm Adreno).

This new Vec4 back-end spawned out of this bug report/request. "In order to use NIR for everything in the i965 backend (which we would like to do), we need to write a NIR -> vec4 pass. Most of the work should be fairly straightforward. The brw_fs_nir.cpp and brw_vec4_visitor.cpp files should provide a pretty good template of what needs to be done. A grep for INTEL_USE_NIR should show you how we actually plumb it through for the FS backend. It would probably be good to start with Vertex shaders on HSW or IVB as SNB- has issues with booleans and we already have NIR doing scalar VS on BDW. It may be a bit tricky to get NIR to generate comparable code quality. However, we can only even start looking into that once we get decent NIR -> vec4 pass so don't worry about that for now. I (Jason) will act as the primary contact for anyone working on this but I'm also going to Cc Matt Turner as he knows vec4 better than I do."

With the patches out of Igalia, the new backend is used if the INTEL_USE_NIR environment variable is true, the stage is a GLSL vertex shader (but there's not yet geometry shader or ARB_vertex_program support), and the hardware is Gen6/Gen7 such as Sandy/Ivy Bridge and Haswell.

Those wishing to test this new vec4 back-end can find the patches via this patch series but hopefully it will end up in Mesa Git soon enough. Once it does, there will be test exposure via our daily performance testing over at
Related News
About The Author
Author picture

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter or contacted via

Popular News This Week