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

Graphics Command Buffer shows 0 Draw Calls in Profiler

Discussion in 'General Graphics' started by Rueddenklau, Jan 9, 2019.

  1. Rueddenklau

    Rueddenklau

    Joined:
    Nov 15, 2017
    Posts:
    4
    Hello everybody,

    I've got a very confusing problem analyzing my rendering performance with the profiler. I've implemented a custom light source for deferred rendering. To integrate it in the deferred pipeline, I'm using a graphics command buffer, which is added at my one and only camera after Unity's standard lighting:

    Code (CSharp):
    1. cam.AddCommandBuffer(CameraEvent.AfterLighting, bufAfterLighting);
    Triggered by 'OnPreRender' from the Camera-Component, the Command Buffer operations are defined in each frame:
    Code (CSharp):
    1. cmdBuffer = bufAfterLighting;
    2.             cmdBuffer.Clear();
    3.             cmdBuffer.BeginSample("headlight");
    4.             cmdBuffer.DrawMesh(MeshHalfsphere, matrixTrafo, matLight, 0, 0, matPropBlock);
    5.             cmdBuffer.EndSample("headlight");
    whereby 'matLight' contains my custom light shader. The confusing thing is, that analyzing the scene with Unity's profiler, I can see the CommandBuffer in the hierachy but there are 0 draw calls and 0 ms time consuming listed for it. On the other hand, my light source is working, as I can see it's influence in the scene. For testing, I added a Unity standard spotlight. This is shown with 2 draw calls and some ms time consuming.

    Can anybody help me?

    Nico
     
  2. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    Hi,

    Can you post a screenshot of the frame debugger? Is the draw actually executed as requested?
     
  3. Rueddenklau

    Rueddenklau

    Joined:
    Nov 15, 2017
    Posts:
    4
    Hello,

    here is a sceenshot of the frame debugger, the profiler and the game view (to be sure you beleive, that lighting is working ;-) )
     

    Attached Files:

  4. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    Right. I see that we are missing a GPU timestamp when drawing from the CommandBuffer. Thanks for reporting it, I will add it to our backlog but I can't guarantee when/if it will be fixed.
     
    xVergilx likes this.