Search Unity

Resolved Generating an identical struct layout between CPU and GPU - trying to remember an obscure API

Discussion in 'General Graphics' started by SamOld, Aug 30, 2021.

  1. SamOld

    SamOld

    Joined:
    Aug 17, 2018
    Posts:
    333
    I remember reading about an obscure Unity feature that allows a struct to be declared in C#, and an identically layed out mirror struct declaration is automatically created in a shader. I now cannot find reference to that feature. I'm about 80% certain that I didn't imagine it.

    Does anybody know what I'm thinking of? Could somebody please point me to the API?

    Thanks.
     
  2. ekakiya

    ekakiya

    Joined:
    Jul 25, 2011
    Posts:
    79
    Last edited: Aug 30, 2021
    unity_735418 and SamOld like this.
  3. SamOld

    SamOld

    Joined:
    Aug 17, 2018
    Posts:
    333
    Ah, thank you! This is what I saw before, but I had forgotten that it was SRP specific so I didn't look there.