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

change some float to half,mali offline compiler report stack spilling

Hi guys,

I write a TAA shader in unity,I try to optimization this shader,change some float to half.

then I compare the shader brfore and after with mali offline compiler

Mali-G76 before,no spilling

Mali-G76 after,spilling

Mali-G77 before,spilling

Mali-G77 after,no spilling

2 questions:

1.Why the results of Mali-G76 and Mali-G77 are opposite

2.Why do I reduce the calculation precision, but it spilling on Mali-G76

5756.shader.zip

Parents
  • Mali-G76 is the Bifrost architecture, and and Mali-G77 is the Valhall architecture. These two GPUs have very different instruction sets and instruction scheduling restrictions, so I'm not surprised to see them have different results. I'll take a look at the shaders to see if there is anything I can recommend to help the spilling.

    Cheers, 
    Pete

Reply
  • Mali-G76 is the Bifrost architecture, and and Mali-G77 is the Valhall architecture. These two GPUs have very different instruction sets and instruction scheduling restrictions, so I'm not surprised to see them have different results. I'll take a look at the shaders to see if there is anything I can recommend to help the spilling.

    Cheers, 
    Pete

Children
  • Nothing obvious jumps out as a quick fix - the shader is just very complex and uses a lot of variables and swizzles. Using mixed precision computation will require more casting and fp16 vec2 packing, so where possible try to compute an entire computation chain at either mediump or highp with minimal precision changes. 

    Newer drivers have solved the spilling in the original shader for Mali-G77, but the latest driver still spills in the shader with reduced precision for Mali-G76.

  • Thank you,I will try to use full highp on Mali-G76