[Mesa-dev] NIR Debugging Tips

Jason Ekstrand jason at jlekstrand.net
Thu Feb 25 15:53:34 UTC 2021


Hi Tommy,

As you've probably noticed already, Mesa documentation is sparse at
best.  For NIR, the best places to go are:

 1. For ALU ops, nir_opcodes.py defines the opcodes as well as a C
snippet which describes the opcode's semantics
 2. For all intrinsics, nir_intrinsics.py defines them and typically
has some sort of description for each.  How good it is very much
depends on the op.

> Also, what is the debug strategy that is used to debug NIR shaders to check if the implementation is correct?

What do you mean?  Debugging back-end drivers?  That's typically done
by running piglit (OpenGL test suite) or CTS tests from one of the
Khronos test suites.

Debugging NIR passes?  Typically the same on your favorite hardware.
The Mesa GitLab CI system will test on a pretty broad spread of
hardware so you can use that once you have it working locally.

--Jason

On Thu, Feb 25, 2021 at 3:39 AM Tommy Chou <yuanhsi at ece.ubc.ca> wrote:
>
> Hi,
>
> Could I get some tips on figuring out what the NIR intrinsics do, specifically the vulkan related ones? Also, what is the debug strategy that is used to debug NIR shaders to check if the implementation is correct?
>
> Thanks,
> Tommy
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list