Skip to content

vtn, nir: Fix a couple OpenCL issues

Jesse Natalie requested to merge jenatali/mesa:cl-regressions into master

We haven't tried to re-run the full OpenCL CTS since we upstreamed the CLOn12 compiler to master. Now that I'm digging into CL3.0 I'd like to be able to see if I'm doing it right, so I'm re-running the CTS... and finding some things that used to pass don't pass anymore.

Here's the first two that took me a while to track down:

  1. We had a completely different implementation of barriers downstream that had significant reworks upstream. Apparently none of the content we tested since then uses global memory barriers, because they failed to validate on the DXIL side, because we ended up with a sync-only barrier with no memory semantics. That happened because the barrier logic in vtn conformed strictly to the Vulkan spec, which means it didn't work for CL. CC @cmarcelo
  2. Downstream we had added alignment to loads/stores, but upstream we had added alignments to derefs. We have a lowering pass for dealing with unaligned loads and stores, which splits them into properly-aligned operations instead. A bug in nir_opt_deref caused alignment info to be lost in specific cases, which caused that pass to explode. CC @jekstrand

I'm sure I'll have more as I slowly re-work my way through the rest of the CTS.

Merge request reports