Search Unity

Question Set Matrix4x4 array in computer buffer different on nvidia vs amd.

Discussion in 'Shaders' started by techmage, Sep 9, 2022.

  1. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    I have a compute shader that works fine on Nvidia, but on AMD 6950xt the math is all whack. Not just a lower precision, but completely wrong.

    I've narrowed it down that setting an array of Matrix4x4's on a computer buffer seems to be producing a different result in Nvidia vs AMD. Does Nvidia store Matrix4x4's in HLSL differently than AMD or something? Anyone run into anything like this?
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    This shouldn't be the case.
    Can you please make a bug report?
    Thank you!
     
  3. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    Hey so it was the case, but found setting it as a GraphicsBuffer instead of a ComputeBuffer solved it. Some bug in ComputerBuffer.
     
  4. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    That definitely sounds like a bug; please report it! Even if the underlying data is treated differently, Unity API should paper that over (or at least very clearly document it and give us some #ifdefs and stuff)
     
    aleksandrk likes this.