<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 28, 2018 at 2:53 AM, Timothy Arceri <span dir="ltr"><<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I thought I'd provide a quick status overview of the radeonsi NIR backend. I'll attempt to list all outstanding tasks (that I'm aware of) so if you are interested in working on one of those just give me a heads up so we don't overlap.<br>
<br>
Also feel free to reply with any feedback on performance and regression results for games (see below). Although try to avoid games like DoW3 that make use of bindless textures until the missing support lands.<br>
<br>
--------------------------<br>
Test Suites / Conformance:<br>
--------------------------<br>
<br>
We are starting to look really good here. I don't have recent CTS results bug it was similar low number of regressions.<br>
<br>
Piglit results for TGSI on Polaris:<br>
<br>
   skip: 1555, pass: 24313, warn: 13, fail: 167, crash: 1<br>
<br>
Piglit results for NIR on Polaris:<br>
<br>
   skip: 1555, pass: 24252, warn: 15, fail: 215, crash: 12<br>
<br>
Summary of these 61 regressions:<br>
<br>
arb_texture_multisample texelfetch bug(s)?<br>
   Number of failures: 39<br>
   Cause of failures: Unknown. Probably all the same bug, thus<br>
      far I have been unable to spot the issue. Feel free to<br>
      debug this :P<br>
   Status: Not started<br>
   Tests:<br>
      arb_texture_multisample<br>
<br>
Missing bindless texture support<br>
   Number of failures: 7<br>
   Cause of failures: Mostly known<br>
   Status: In progress<br>
   Tests:<br>
      arb_bindless_texture<br>
<br>
Bug in sampler lowering<br>
   Number of failures: 1<br>
   Cause of failures:<br>
      nir_lower_samplers_as_deref() only works when<br>
      a struct only contains samplers and is therefor no longer used<br>
      after lowering. If however the struct also contains ordinary<br>
      variables then we need to update its glsl_type after lowering<br>
      to remove the sampler members.<br>
   Status: Not started<br>
   Tests:<br>
      ./bin/shader_runner tests/spec/arb_arrays_of_array<wbr>s/execution/sampler/vs-struct-<wbr>nonconst-non-opaque-members.<wbr>shader_test -auto -fbo<br>
<br>
arb_enhanced_layouts component offsets bugs<br>
   Number of failures: 6<br>
   Cause of failures: Incorrect component offsets<br>
   Status: Not started<br>
   Tests:  arb_enhanced_layouts/execution<wbr>/component-layout<br>
<br>
Missing NIR/NIR->LLVM support for frexp opcode<br>
   Number of failures: 1<br>
   Cause of failures: missing frexp opcode<br>
   Status: Not started<br>
   Tests:<br>
        ./bin/shader_runner tests/spec/arb_gpu_shader_fp64<wbr>/execution/built-in-functions/<wbr>fs-frexp-dvec4.shader_test -auto -fbo<br>
<br>
arb_tessellation_shader doubles bugs:<br>
   Number of failures: 3<br>
   Cause of failures: possibly dual slot varying related.<br>
   Status: Not started<br>
   Tests:<br>
      arb_tessellation_shader<br>
<br>
Bug with explicit location for doubles<br>
   Number of failures: 1<br>
   Cause of failures: incorrect location offset?<br>
   Status: Not started<br>
   Tests:<br>
      ./bin/shader_runner tests/spec/arb_gpu_shader_fp64<wbr>/execution/explicit-location-<wbr>gs-fs-vs.shader_test -auto -fbo<br>
<br>
Shared atomics bug<br>
   Number of failures: 1<br>
   Cause of failures: Unknown<br>
   Status: Not started<br>
   Tests:<br>
      ./bin/shader_runner tests/spec/arb_compute_shader/<wbr>execution/shared-atomics.shade<wbr>r_test -auto -fbo<br>
<br>
Non optimal variable indexing:<br>
   Number of failures: 1<br>
   Cause of failures: Excessive spilling. Optimisations to the<br>
      nir -> llvm path should resolve the issue (see the missing<br>
      optimisations section below).<br>
   Status: Not started<br>
   Tests:<br>
        ./bin/shader_runner tests/spec/glsl-1.50/execution<wbr>/variable-indexing/gs-input-<wbr>array-vec3-index-rd.shader_<wbr>test -auto -fbo<br>
<br>
gs max input components bug<br>
      Number of failures: 1<br>
   Cause of failures: Possibly related to the issue above.<br>
   Status: Not started<br>
   Tests:<br>
      ./bin/shader_runner tests/spec/glsl-1.50/execution<wbr>/geometry/max-input-components<wbr>.shader_test -auto -fbo<br>
<br>
<br>
--------------------------<br>
Missing optimisations:<br>
--------------------------<br>
<br>
- There are a number of TODOS in si_shader_nir.c that need to be<br>
  finished off.<br>
<br>
- Optimal variable indexing (see Non optimal variable indexing in<br>
  the piglit failures above). Need to implement something in nir -> llvm<br>
  like si_llvm_emit_fetch() does for TGSI. This will benefit both<br>
  radeonsi and radv.<br>
<br>
- Fast path when user data SGPRs point to constant buffer 0 directly.<br>
  See si_shader.c:fetch_constant()<br>
<br>
- Need to double check NIR is not lowering anything we can handle<br>
  natively.<br>
<br>
- There are likely more improvements we can do for the NIR shader cache.<br>
  For one we should probably create a driver function so that we can<br>
  call all NIR opts/lowering from the st at link time to avoid variants<br>
  having to call these for a second time.<br></blockquote><div><br></div><div>I'm not sure how familiar you are with the current Intel compiler structure (you're far more familiar than most radeonsi developers!), but I've been very happy with our approach.  It goes something like this:<br><br></div><div>glsl_to_nir() or spirv_to_nir()<br></div><div>/* early driver or language-specific lowering */<br></div><div>brw_preprocess_nir() // core early optimizations<br></div><div>/* late driver or language-specific lowering */<br></div><div>/* cache the shader */<br><br></div><div>later on...<br><br></div><div>nir_clone()<br></div><div>/* variant lowering for texture workarounds etc. */<br></div><div>brw_postprocess_nir() // a bit more lowering and out-of-SSA<br></div><div>fs_visitor() /* NIR -> back-end IR */<br><br></div><div>The split into preprocess and postprocess has been very helpful in letting us share our NIR compilation pipeline between anv and i965.  I have no idea how that would translate into gallium.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Likely a bunch more I've forgotten or missed.<br>
<br>
-----------------<br>
Performance:<br>
-----------------<br>
<br>
More testing is needed. I haven't done much testing here yet, there were some phoronix tests a while back that showed a few regressions in performance. However at that stage we didn't yet have any shader cache and the large MadMax regression was actually causes by an llvm bug (which has been fixed in master 7.0). I'm hopeful any regressions won't be too bad at this stage.<br>
<br>
-----------------------------<br>
Real world testing (Games):<br>
-----------------------------<br>
<br>
Again more testing is needed here. Of the few games I've tested so far most seem to run fine.<br>
<br>
Known regressions:<br>
- Dead Island (displays only graphics corruptions on start-up)<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>