Search Unity

SRP Batching problem

Discussion in 'General Graphics' started by zhutianlun810, Aug 13, 2021.

  1. zhutianlun810

    zhutianlun810

    Joined:
    Sep 17, 2017
    Posts:
    171
    I am wondering is there any size limit of every CBUFFER_START(UnityPerMaterial)?

    I am encountering a weird bug. When I enable SRP, some object of my scene are rendered incorrectly. From the RenderDoc. I can see the _BaseColor of my shader is wrong. However, in the FrameDebugger, it is correct.

    I guess may material has a limit size of CBuffer. The value beyond the limit will be random.
     
  2. StevenTillson02

    StevenTillson02

    Joined:
    Jun 30, 2021
    Posts:
    11
    Material has a limit size of CBuffer. You are right.
     
  3. zhutianlun810

    zhutianlun810

    Joined:
    Sep 17, 2017
    Posts:
    171
    Is there any document related to this? How large is the limit size?
     
  4. zhutianlun810

    zhutianlun810

    Joined:
    Sep 17, 2017
    Posts:
    171
    In document of HLSL, it says "each constant buffer can hold up to 4096 vectors; each vector contains up to four 32-bit values. You can bind up to 14 constant buffers per pipeline stage (2 additional slots are reserved for internal use)". Is it still true for Unity? I can only use 14 constant buffers in each shader stage?