Search Unity

Inspecting Struct Layout

Discussion in 'Entity Component System' started by jRocket, Jul 29, 2021.

  1. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    Is there any way to visualize how my structs are being laid out in memory? I would like to verify that it is being laid out how I think it should be, so I can optimize in terms of layout and padding.

    I found a tool for Visual Studio C++ code that does that. It would be neat to see something like it in the Unity editor.
     
    Last edited: Jul 29, 2021
    Lukas_Kastern and apkdev like this.
  2. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    jRocket likes this.
  3. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    And yes having such tool built in unity for MB and DOTS will be good :)
     
    Last edited: Jul 30, 2021
  4. Scorr

    Scorr

    Joined:
    Jul 2, 2013
    Posts:
    73
    xVergilx, apkdev and jRocket like this.