Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Access buffer counter in compute shader

Discussion in 'Shaders' started by MasterReDWinD, Apr 5, 2019.

  1. MasterReDWinD

    MasterReDWinD

    Joined:
    Mar 26, 2018
    Posts:
    9
    Hi,

    I would like to use ID3D11DeviceContext::CopyStructureCount to access the current count of an AppendStructuredBuffer on the GPU. Is this possible? If so, how would I go about doing it?

    I'm aware that I can use CopyCount to retrieve the value on the CPU side.

    Thanks
     
  2. Przemyslaw_Zaworski

    Przemyslaw_Zaworski

    Joined:
    Jun 9, 2017
    Posts:
    314
    MasterReDWinD likes this.
  3. MasterReDWinD

    MasterReDWinD

    Joined:
    Mar 26, 2018
    Posts:
    9
    Thanks for your reply. I have been using this blog already and find it very helpful. Being unable to get the Append buffer counter on the GPU side is rather frustrating. Where I need it I have been using regular RWStructuredBuffers and ComputeBuffer.IncrementCounter(), as a workaround.
     
  4. grizzly

    grizzly

    Joined:
    Dec 5, 2012
    Posts:
    356
    MasterReDWinD likes this.
  5. MasterReDWinD

    MasterReDWinD

    Joined:
    Mar 26, 2018
    Posts:
    9
    Last edited: Jun 13, 2019