Forums - Vulkan fails to link shader with Adreno 640 "PSEUDOIMUL32"

1 post / 0 new
Vulkan fails to link shader with Adreno 640 "PSEUDOIMUL32"
sagielevy21
Join Date: 31 Oct 23
Posts: 1
Posted: Wed, 2023-11-01 01:39

Hey,
I built a shader via Unity (written in HLSL) and made an Android build on a OnePlus 7T with Adreno 640. One of my shaders crash, saying:

AdrenoVK-0 Failed to link shaders.
AdrenoVK-0 Info log: Assertion failed: false && "PSEUDOIMUL32 must not be seen here"
AdrenoVK-0 Failed to link shaders.
AdrenoVK-0 Info log: Assertion failed: false && "PSEUDOIMUL32 must not be seen here"
Unity Vulkan: could not create a pipeline object [-13] (<unknown>)
 
I can't paste the entire shader here but there was one line where I noticed if i wrote this:
 if (abs(endPoint.value.x - controlPoint.x) < 0.001 || abs(endPoint.value.x - startPoint.x) < 0.001)
 {
     endPoint.value.x += 10 * 0.001;
 }
I get the crash, but this:
endPoint.value.x += 10 * 0.001 * (abs(startPoint.x - controlPoint.x) < 0.001 || abs(controlPoint.x - startPoint.x) < 0.001);

Seems to compile just fine. I simply moved the condition into the addition as a factor.
(startPoint, controlPoint are float2, endPoint is: struct { float2 value; int a; }; )


I get this crash elsewhere too and have yet to fully understand the pattern. What is `PSEUDOIMUL32` and why do I get it in my compilation?

Edit: I managed to find a horrible workaround by changing all the code which was used to calculate the final value of `endPoint` from using `if` statements to using lerp(X, Y, B) where B is either 0 or 1 and X and Y were the two possible return values in the previous implementation. Maybe this provides a clue?

This is my Andreno data as reported by Andreno-VK-0, if that helps:

AdrenoVK-0 QUALCOMM build          : 2f950bf, I802c3b73eb

AdrenoVK-0 Build Date              : 06/14/21
AdrenoVK-0 Shader Compiler Version : EV031.32.02.12
AdrenoVK-0 Local Branch            : mybranchebcd58da-bf05-f13c-94fa-5cb90179c3d8
AdrenoVK-0 Remote Branch           : quic/gfx-adreno.lnx.1.0.r99-rel
AdrenoVK-0 Remote Branch           : NONE
AdrenoVK-0 Reconstruct Branch      : NOTHING
AdrenoVK-0 Build Config            : S P 10.0.7 AArch64
AdrenoVK-0 Driver Path             : /vendor/lib64/hw/vulkan.adreno.so

I can provide a binary generated in "shader-playground" if that helps, but I don't know what values to set for the:
target_profile, optimization level, extra options, (output format I assume is SPIR-V) and SPRI-V target.
  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.