https://bugs.freedesktop.org/show_bug.cgi?id=108275

            Bug ID: 108275
           Summary: Breaking out of loop creates broken code on RADV
           Product: Mesa
           Version: 18.2
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/Vulkan/radeon
          Assignee: mesa-dev@lists.freedesktop.org
          Reporter: mais...@archlinux.us
        QA Contact: mesa-dev@lists.freedesktop.org

Created attachment 141940
  --> https://bugs.freedesktop.org/attachment.cgi?id=141940&action=edit
Fossilize dump

I have a test case where adding a break to a loop creates broken code, and
Vulkan renders something complete bogus.

The code comes from spirv-opt and works fine on all other implementations I've
tested.

The original GLSL looks like this:
https://github.com/Themaister/Granite/blob/master/assets/shaders/ocean/cull_blocks.comp
To workaround the issue, I removed the "break" on line 54, which for some
reason fixed the issue.

My hunch is that the SelectionMerge inside the loop is merging to the loop's
continue block, and this is causing some weirdness.

To build Fossilize for repro:

git clone git://github.com/Themaister/Fossilize
cd Fossilize
git submodule update --init
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j16

To disassemble the failing SPIR-V pipeline:

GLSL (SPIRV-Cross):
./cli/fossilize-disasm fossilize.json --compute-pipeline 3 --target glsl
SPIR-V asm:
... --target asm
AMD ISA (VK_AMD_shader_info):
... --target amd

For the workaround case, use --compute-pipeline 29 instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to