bkunikowski
Topic Author
Posts: 12
Joined: 02 Apr 2025, 12:18

Max number of offscreen surfaces reached

25 Jun 2025, 09:59

I have an crash that comes from Noesis, because of error "Max number of offscreen surfaces reached". It looks that when I'm creating Style with DropShadowEffect Noesis creates 21 render targets. With other stuff it sums to offscreen number limit.

Here's a sample effect that introduces a lot of render targets (21 ! SIC!):
            <Style x:Key="BracketPartStyle" TargetType="Rectangle">
                <Setter Property="Opacity" Value="0.5" />
                <Setter Property="Fill" Value="#E7DED5" />
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect Color="#E7DED5" 
                                          BlurRadius="10" 
                                          ShadowDepth="0" 
                                          Opacity="0.8" />
                    </Setter.Value>
                </Setter>
            </Style>
Here's list of these 21 render targets that Noesis creates, and as I checked it is not used (apart L0 and L1):
  • Pyramid_Down_L0
  • Pyramid_Up_L0
  • Pyramid_Down_L1
  • Pyramid_Up_L1
  • Pyramid_Down_L2
  • Pyramid_Up_L2
  • Pyramid_Down_L3
  • Pyramid_Up_L3
  • Pyramid_Down_L4
  • Pyramid_Up_L4
  • Pyramid_Down_L5
  • Pyramid_Up_L5
  • Pyramid_Down_L6
  • Pyramid_Up_L6
  • Pyramid_Down_L7
  • Pyramid_Up_L7
  • Pyramid_Down_L8
  • Pyramid_Up_L8
  • Pyramid_Down_L9
  • Pyramid_Up_L9
  • Pyramid_Down_L10
Is this really needed?

I know that there are also Offscreen0 and Offscreen1 render targets. My new widget wants to create at least one new render target, so it sums up to 24 render targets. Do you know what is the limit? Is that 24? Or maybe I can force Noesis to not create not needed render targets?
 
bkunikowski
Topic Author
Posts: 12
Joined: 02 Apr 2025, 12:18

Re: Max number of offscreen surfaces reached

25 Jun 2025, 10:36

The one more that is created is Pyramid_Up_L0_1'
 
bkunikowski
Topic Author
Posts: 12
Joined: 02 Apr 2025, 12:18

Re: Max number of offscreen surfaces reached

25 Jun 2025, 11:30

I also have set SetOffscreenMaxNumSurfaces to 2, and try different numbers, but doesn't change anything
 
User avatar
jsantos
Site Admin
Posts: 4823
Joined: 20 Jan 2012, 17:18
Contact:

Re: Max number of offscreen surfaces reached

25 Jun 2025, 12:32

Hello,

Let me clarify a few things. The surfaces you're referring to are not 21 separate render targets. Instead, it's one render target plus its mipmap pyramid, so roughly 1.5 times the size of a single render target.

We do require two of these render targets for any given effect. However, under normal circumstances, this memory is reused across multiple Blur or Shadow effects. While it may seem that the pyramid is only partially used, we always allocate the full structure to avoid runtime performance spikes and ensure predictable performance. Depending on the blur radius, the additional mip levels might be needed, and we prefer not to allocate surfaces dynamically in the middle of a radius animation.

As for SetOffscreenMaxNumSurfaces, it only applies to standard offscreen surfaces (like those used for Opacity). If you're seeing many surfaces (more than two is typically considered excessive), it's likely due to overusing the Opacity property, especially if it's applied to multiple nested nodes.

Finally, I don't think your widget should be creating a new render target. Our architecture is designed to allow rendering directly to the active render target, the same one used for rendering your 3D world.

I will be more than happy to analyze any renderdoc capture you could share with us.
 
bkunikowski
Topic Author
Posts: 12
Joined: 02 Apr 2025, 12:18

Re: Max number of offscreen surfaces reached

03 Jul 2025, 16:54

Thank you for your answer. Yes, I already get it that these surfaces are mipmap pyramid, but thanks for clarification. It appears that SetOffscreenMaxNumSurfaces was set to 2. So in our case it seems to low. Sorry, I cannot share RenderDoc.
 
User avatar
jsantos
Site Admin
Posts: 4823
Joined: 20 Jan 2012, 17:18
Contact:

Re: Max number of offscreen surfaces reached

03 Jul 2025, 17:10

Thanks! I’d be happy to review your screens to see if we can reduce the number of required offscreens, it should be possible. Just let us know.

Who is online

Users browsing this forum: No registered users and 3 guests