shodz
shodz

Reputation: 1

Explanation of nir MESA IR

I am new to MESA NIR IR. I am trying to understand how GLSL is translated to the equivalent NIR.

Here is GLSL:

attribute vec4 vPosition;
void  main ()
{
    gl_Position = vPosition;
}

Here is the equivalent NIR IR:

NIR (final form) for vertex shader:
shader: MESA_SHADER_VERTEX
name: GLSL3
inputs: 1
outputs: 1
uniforms: 0
Shared: 0
decl_var shader_in INTERP_MODE_NONE highp vec4 vPosition  (VERT_ATTRIB_GENERIC0.xyzw, 16 , 0 )
decl_var shader_out INTERP_MODE_NONE highp vec4 gl_Position  (VARYING_SLOT_POS.xyzw, 0 , 0 )
decl_function main  ( 0 params)
impl main {
    block block_0:
    /* preds: */
    vec1 32 ssa_0 = load_const ( 0x00000000  /* 0.000000 */ )
    vec4 32 ssa_1 = intrinsic load_input (ssa_0) ( 0 , 0 , 160 , 144 ) /* base=0 */  /* component=0 */  /* dest_type=float32 */  /* location=16 slots=1 */
    intrinsic store_output (ssa_1, ssa_0) ( 0 , 15 , 0 , 160 , 128 ) /* base=0 */  /* wrmask=xyzw */  /* component=0 */  /* src_type=float32 */  /* location= 0 slots=1 */  /* gl_Position */
    /* succs: block_1 */
    block block_1:
}

Can someone explain line by line, parameter by parameter what each line is doing.

For example:

vec4 32 ssa_1 = intrinsic load_input (ssa_0) ( 0 , 0 , 160 , 144 ) /* base=0 */  /* component=0 */  /* dest_type=float32 */  /* location=16 slots=1 */

What does component or location represent?

A line by line explanation is highly appreciated.

Upvotes: 0

Views: 41

Answers (0)

Related Questions