Skip to content

etnaviv: add alternative NIR based compiler

Jonathan Marek requested to merge flto/mesa:etna-nir into master

Adds a NIR-based compiler alternative to the current TGSI compiler. It is only used with ETNA_MESA_DEBUG=nir

I have a GC2000, GC3000, GC7000Lite for testing. With this I can pass deqp GLES2 shader tests, with the following exceptions:

  • dynamic uniform load in fragment shader doesn't work on GC2000 (looks like LOAD instruction doesn't work in fragment shader, to be investigated more)
  • gl_FrontFacing is inverted if glFrontFace is GL_CW (just noticed this after updating deqp..)

I did a lot of work to reduce the number of emitted instructions in the shader, and it does much better than the TGSI compiler (and passes all tests as opposed to TGSI compiler which has many fails). However there are still some cases which aren't optimal (especially with loops involved), and I left out some WIP optimizations for now.

It is split into two files, the big header contains mostly code I think could be common between etnaviv/a2xx...

Kept this inside gallium for now since Vulkan is still a long way off (looking at GLES3 currently...)

Previous MR: !868 (closed)

Edited by Jonathan Marek

Merge request reports