render/gen7: Don't use a message register to store vl
PATCH 1/1 render/gen7: Don't use a message register to store vl
Turns out the "new" assembler that uses mesa's opcode emission hits the path that automatically transforms MRF registers into GRF ones in the exa_wm_src_projective shader.
The diff with the new assembler is:
$ intel-gen4disasm -g7 -
- { 0x00600041, 0x208077be, 0x008d03c0, 0x008d0180 },
+ { 0x00600041, 0x2e8077bd, 0x008d03c0, 0x008d0180 },
mul(8) m4<1>F g30<8,8,1>F g12<8,8,1>F { align1 };
mul(8) g116<1>F g30<8,8,1>F g12<8,8,1>F { align1 };Of course, message registers are no more in gen7, so the shader is trying to do something shaddy (ahem!).
Instead of using m4, let's make exa_wm_src_projective use g68 for v (aka vl) which makes sense since:
1/ vh is g69
2/ exa_wm_src_affine uses g68 for vl already
This commit changes the generated assembly, here's the decoded diff:
$ intel-gen4disasm -g7 -
- { 0x00600041, 0x208077be, 0x008d03c0, 0x008d0180 },
+ { 0x00600041, 0x288077bd, 0x008d03c0, 0x008d0180 },
mul(8) m4<1>F g30<8,8,1>F g12<8,8,1>F { align1 };
mul(8) g68<1>F g30<8,8,1>F g12<8,8,1>F { align1 };--- src/render_program/exa_wm_src_projective.g7a | 4 ++-- src/render_program/exa_wm_src_projective.g7b | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
src/render_program/exa_wm_src_projective.g7a +2 -2
@@ -30,8 +30,8 @@ include(`exa_wm.g4i') define(`u', `g66') define(`ul', `g66') define(`uh', `g67') -define(`v', `src_v') -define(`vl', `src_v') +define(`v', `g68') +define(`vl', `g68') define(`vh', `g69') define(`w', `src_w') define(`wl', `src_w_0')
src/render_program/exa_wm_src_projective.g7b +1 -1
@@ -8,5 +8,5 @@ { 0x00600041, 0x286077bd, 0x008d03e0, 0x008d01a0 }, { 0x0060005a, 0x23c077bd, 0x000000d0, 0x008d0040 }, { 0x0060005a, 0x23e077bd, 0x000000d0, 0x008d0080 }, - { 0x00600041, 0x208077be, 0x008d03c0, 0x008d0180 }, + { 0x00600041, 0x288077bd, 0x008d03c0, 0x008d0180 }, { 0x00600041, 0x28a077bd, 0x008d03e0, 0x008d01a0 },
Signature · 1 line
1.7.7.5
Quoted 29 lines · Damien Lespiau
Turns out the "new" assembler that uses mesa's opcode emission hits the path that automatically transforms MRF registers into GRF ones in the
exa_wm_src_projectiveshader.The diff with the new assembler is:
$ intel-gen4disasm -g7 -(quoted diff) +1
-1- { 0x00600041, 0x208077be, 0x008d03c0, 0x008d0180 }, + { 0x00600041, 0x2e8077bd, 0x008d03c0, 0x008d0180 },mul(8) m4<1>F g30<8,8,1>F g12<8,8,1>F { align1 }; mul(8) g116<1>F g30<8,8,1>F g12<8,8,1>F { align1 };Of course, message registers are no more in gen7, so the shader is trying to do something shaddy (ahem!).
Instead of using m4, let's make
exa_wm_src_projectiveuse g68 for v (aka vl) which makes sense since:1/ vh is g69
2/exa_wm_src_affineuses g68 for vl alreadyThis commit changes the generated assembly, here's the decoded diff:
$ intel-gen4disasm -g7 -src/render_program/exa_wm_src_projective.g7b +1
-1- { 0x00600041, 0x208077be, 0x008d03c0, 0x008d0180 }, + { 0x00600041, 0x288077bd, 0x008d03c0, 0x008d0180 },mul(8) m4<1>F g30<8,8,1>F g12<8,8,1>F { align1 }; mul(8) g68<1>F g30<8,8,1>F g12<8,8,1>F { align1 };
Quoted 3 lines
Cc Kenneth Graunke <[email protected]>Reported-by Xiang, Haihao <[email protected]>Signed-off-by Damien Lespiau <[email protected]>
If I recall correctly, the only actual changes between the Gen6 and Gen7 render assembly was converting MRFs to GRFs, and I arbitrarily picked something in the 60s rather than 112+. If you want, I think you could actually just delete all the Gen7 custom assembly and let gen7_convert_mrf_to_grf do it for you.
But this looks okay to me, if you'd rather continue doing everything explicitly...
Quoted 40 lines · Kenneth Graunke
Quoted 29 lines · Damien Lespiau
Turns out the "new" assembler that uses mesa's opcode emission hits the path that automatically transforms MRF registers into GRF ones in the
exa_wm_src_projectiveshader.The diff with the new assembler is:
$ intel-gen4disasm -g7 -(quoted diff) +1
-1- { 0x00600041, 0x208077be, 0x008d03c0, 0x008d0180 }, + { 0x00600041, 0x2e8077bd, 0x008d03c0, 0x008d0180 },mul(8) m4<1>F g30<8,8,1>F g12<8,8,1>F { align1 }; mul(8) g116<1>F g30<8,8,1>F g12<8,8,1>F { align1 };Of course, message registers are no more in gen7, so the shader is trying to do something shaddy (ahem!).
Instead of using m4, let's make
exa_wm_src_projectiveuse g68 for v (aka vl) which makes sense since:1/ vh is g69
2/exa_wm_src_affineuses g68 for vl alreadyThis commit changes the generated assembly, here's the decoded diff:
$ intel-gen4disasm -g7 -src/render_program/exa_wm_src_projective.g7b +1
-1- { 0x00600041, 0x208077be, 0x008d03c0, 0x008d0180 }, + { 0x00600041, 0x288077bd, 0x008d03c0, 0x008d0180 },mul(8) m4<1>F g30<8,8,1>F g12<8,8,1>F { align1 }; mul(8) g68<1>F g30<8,8,1>F g12<8,8,1>F { align1 };Quoted 3 lines
Cc Kenneth Graunke <[email protected]>Reported-by Xiang, Haihao <[email protected]>Signed-off-by Damien Lespiau <[email protected]>If I recall correctly, the only actual changes between the Gen6 and Gen7 render assembly was converting MRFs to GRFs, and I arbitrarily picked something in the 60s rather than 112+. If you want, I think you could actually just delete all the Gen7 custom assembly and let
gen7_convert_mrf_to_grfdo it for you.
Quoted 3 lines
But this looks okay to me, if you'd rather continue doing everything explicitly...
Reviewed-by Kenneth Graunke <[email protected]>
Thanks for the patch and review, pushed.
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre