Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

vulkan failed to create pipeline on mali devices after using spirv shaders compiled by DXC

I'm working on a UE4 project. By default UE4 compile its shader to spirv binary by hlslcc + glslang, but in this way the generated spirv shader is suboptimal so I want to use shaderconductor(DXC) to compile hlsl directly to spirv (just like what UE5 does: Unreal Engine 5.0 Release Notes | Unreal Engine 5.0 Documentation)

After I use DXC, the project works pretty well on adreno devices, but it will crash on mali deviecs. I have tried these devices, the all failed to create pipeline (both compute ppl and graphics ppl) with VK_ERROR_INITIALIZATION_FAILED:

The khr spec states that create pipeline should only return the following errors:

and also adreno devices works well, so I guess this might be mali driver bugs.

I have no clue what's goes wrong with generated spirv binary and it seems I can't get enough error information from vulkan, so I need to ask help from mali experts.

I can send you the apk that can produce the failure so if you are interested please leave me a email address. Thanks in advance!

Parents
  • Thanks for the shader!

    It appears the problem is with the SPV_GOOGLE_user_type extension, which we do not support, being used. Based on the DXC documentation they will add this if -fspv-reflect is passed -- which UE will pass by default. However, UE5 will also later strip out the use of the extension before passing the shader to the Vulkan driver. If you look in `Engine/Source/Developer/VulkanShaderFormat/Private/VulkanShaderCompiler.cpp` in UE5 you can find the code that does this (look for `bStripReflect`).

    So, I think your best bet here might be to backport the stripping from UE5 to UE4 if you want to try to use DXC in UE4. Hope that helps :) 

Reply
  • Thanks for the shader!

    It appears the problem is with the SPV_GOOGLE_user_type extension, which we do not support, being used. Based on the DXC documentation they will add this if -fspv-reflect is passed -- which UE will pass by default. However, UE5 will also later strip out the use of the extension before passing the shader to the Vulkan driver. If you look in `Engine/Source/Developer/VulkanShaderFormat/Private/VulkanShaderCompiler.cpp` in UE5 you can find the code that does this (look for `bStripReflect`).

    So, I think your best bet here might be to backport the stripping from UE5 to UE4 if you want to try to use DXC in UE4. Hope that helps :) 

Children