Author Topic: Recycled DrawCalls not clearing clipping setting (3.0.8f7)  (Read 2254 times)

shinki

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Recycled DrawCalls not clearing clipping setting (3.0.8f7)
« on: January 13, 2014, 01:56:59 PM »
Hi there :)

Noticed a strange issue where when I switch off a panel which has clipping, the draw call from that panel gets recycled (from the inactive list) to be used by a new panel. However the clipping setting does not get changed, so I'm seeing a panel with no clipping trying to submit a draw call with clipping. This causes it to throw errors when things in that panel don't have the appropriate clipping shaders.

Locally, I fixed this by adding a clipping setting line in the UIDrawCall 'Create' method:

  1. static UIDrawCall Create (string name, UIPanel pan, Material mat, Texture tex, Shader shader)
  2. {
  3.         UIDrawCall dc = Create(name);
  4.         dc.gameObject.layer = pan.cachedGameObject.layer;
  5.         dc.clipping = pan.clipping; // this one
  6.         dc.baseMaterial = mat;
  7.         dc.mainTexture = tex;
  8.         dc.shader = shader;
  9.         dc.renderQueue = pan.startingRenderQueue;
  10.         dc.manager = pan;
  11.         return dc;
  12. }

I would be very interested to hear peoples' thoughts on this issue as well as a more appropriate fix if anyone has one!

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Recycled DrawCalls not clearing clipping setting (3.0.8f7)
« Reply #1 on: January 13, 2014, 05:36:11 PM »
That seems like a safe change. Thanks!

shinki

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Recycled DrawCalls not clearing clipping setting (3.0.8f7)
« Reply #2 on: January 14, 2014, 04:48:58 AM »
Great, thanks for the response. :)