Created attachment 140691 [details] One of the affected shaders (GLSL version) Hello, when building Mesa with LLVM 7.0-svn, OpBitfieldUExtract sometimes returns the original source operand instead of zero when the bit count is zero. With LLVM 6.0.1, it works as expected. This causes the following bug in DXVK: https://github.com/doitsujin/dxvk/issues/497 Here's a renderdoc capture (recorded on Polaris) showing the issue: https://mega.nz/#!8W5nDTxT!P7PI4BZ_gpmZDIoh1Iziq0PHpLp448hiUqJN9iEhukg The attached shader is a GLSL version of the vertex shader used in the bookmarked draw call. I added some comments around like 220 for observed vs. expected behaviour of the shader code. I tried to reproduce the problem outside of DXVK, but had no luck so far: A small demo app testing the GLSL bitfieldExtract function in a compute shader always returns the correct values. Handling the count = 0 case explicitly in the NIR->LLVM translation fixes the issue in Far Cry 5. Regards, - Philip
Created attachment 140692 [details] [review] Workaround that fixes the rendering issue
Created attachment 140693 [details] Final image (correct)
Created attachment 140694 [details] Final image (broken)
Created attachment 140695 [details] Demo app that does not trigger the problem I used this small sample app in an attempt to reproduce the problem, but for me it always returns 0 for the count=0 case for some reason. Please note that the queue family and memory type indices are hardcoded.
Should be fixed with https://cgit.freedesktop.org/mesa/mesa/commit/?id=3d41757788aca774e64297bed962696cc0c9b262
*** Bug 107156 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.