Search Unity

Gfx.ReadbackImage slowness

Discussion in 'General Graphics' started by RoughSpaghetti3211, Oct 26, 2018.

  1. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,709
    Hello,

    Im having some extreme slowness coming from Gfx.ReadbackImage. I was wondering if someone could run me through the what and why of this little vampire. From what i read on the web it passed info back to the CPU from the GPU. What kind of info and how do I reduce this call or the amount of data?

    Thanks in advance

    Screen Shot 2018-10-25 at 10.07.00 PM.png Screen Shot 2018-10-25 at 10.38.29 PM.png
     
    Last edited: Oct 26, 2018
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,025
    Hi!

    Looks like you have realtime GI enabled. Turn it off and it should stop doing this.

    In general this is a request to read the contents of a framebuffer from a GPU to the CPU-visible memory. It causes the CPU to wait for the GPU to finish everything up to the readback point, then copy the data and continue with other stuff, which is very slow, and should be avoided. This is especially painful on mobile platforms, but other platform suffer from this as well.
     
    RoughSpaghetti3211 likes this.
  3. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,709
    OK thanks for the reply, so with realtime GI this is around the cost I should expect. Sorry for my ignorance Im from VFX and have no concept on what is considered fast. (hours a frame is my bar)
     
    richardkettlewell likes this.