Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Compute Shader RAM usage

Discussion in 'Shaders' started by cowtrix, Aug 31, 2017.

  1. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    322
    Heya folks. I'm trying to use Compute Shaders to do some heavy lifting with some array blending stuff, mostly around editor tools for creating terrains (e.g. blending and normalizing splat maps, heightmaps, etc). A compute shader could be getting set up, executed and disposed a hundred times in an editor frame as different things are done to the terrain.

    However, I've found that doing this results in some really weird memory usage from the Unity editor. I get this in my Task Manager:


    But what's really weird is that this memory explosions isn't actually reflected in the task list, it's being consumed somewhere else, presumably by either DirectX or my actual graphics card driver. I'll see if I can get a bit of a test case together to figure out what's going wrong, but was just wondering if anyone had seen this before or had any insight into what might be happening?

    Some notes:
    • I'm not pooling any of the buffers
    • I am disposing the buffers when done
    • There are no hanging references to these buffers that could be keeping them alive
     
    mischul-microsoft likes this.