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. Dismiss Notice

Question ComputeShader with more than 8 buffers

Discussion in 'Shaders' started by AdmiralOberstein, Dec 2, 2020.

  1. AdmiralOberstein

    AdmiralOberstein

    Joined:
    Dec 20, 2019
    Posts:
    9
    I'm currently having a problem with the number of buffers used in a compute shader. In the inspector, the shader produces the following warning:
    When executed, the following error message is logged to console:
    Now the warning already notes that it's okay to have more than 8 buffers as long as you're targeting D3D11.1. However, I wasn't able to find out how to set the version or how to see which one is currently being used.
    I've tried to change the "Player" settings, but the only options available are D3D11 or D3D12.

    I'm on Unity 2020.2.0b13.

    Any help would be highly appreciated.

    On a side note, using multiple buffers of primitive data types instead of a single buffer of a struct seems to be the prefered way to achieve coherent reads, e.g.
    Code (CSharp):
    1. struct S { float a1; float a2; int a3 }; RWStructuredBuffer<S> buffer
    is worse than three buffers

    Code (CSharp):
    1. RWStructuredBuffer<float> buffer1
    2. RWStructuredBuffer<float> buffer2
    3. RWStructuredBuffer<int> buffer3
    Is there a better way to achieve this? 2D-Textures (as far as I know) wouldn't work with different data types and having a struct of arrays only works up to an array size of 64K.
     
  2. b0nes123

    b0nes123

    Joined:
    Nov 6, 2019
    Posts:
    24
    Hi, I've also run into the same problem with too many buffers. Did you ever find a way of targeting D3D11.1? the #pragma target directive is not recognized in a compute shader, and
    #pragma use_dxc does not seem to work either.
     
    Last edited: May 18, 2021
  3. unity_fime5ey3qd

    unity_fime5ey3qd

    Joined:
    Jul 20, 2020
    Posts:
    2
    I have the same problem and any help will be appritiated!
     
  4. cowj

    cowj

    Joined:
    Mar 10, 2019
    Posts:
    17
    need Help too,can anyone explain the limit count of rwbufffer in computeshader?
     
  5. bobozee

    bobozee

    Joined:
    Jul 17, 2017
    Posts:
    2
    Need help too.