Skip to content

Remove is_discardable property from several textures - #118396

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
clayjohn:remove-discardable
Apr 13, 2026
Merged

Remove is_discardable property from several textures#118396
Repiteo merged 1 commit into
godotengine:masterfrom
clayjohn:remove-discardable

Conversation

@clayjohn

@clayjohn clayjohn commented Apr 10, 2026

Copy link
Copy Markdown
Member

Partially undoes #113781
Fixes: #118361
Bugsquad edit: Fixes #116357

is_discardable does 2 things:

  1. It allows the ARG to optimize load ops when the texture hasn't been written to earlier in the frame
  2. It allows the ARG to optimize store ops if the texture is not written to later in the frame.

In theory it should be safe to enable for any texture so long as it isn't written to in one frame and read in another (or vice versa) as the ARG should use the proper load/store ops. The render target (2d color buffer) is a special case since it is sampled when rendering to the swap chain and that isn't tracked by the ARG (#115530).

However, it seems that the MRP in #118361 is hitting another case where the ARG fails to properly detect when it is safe to use LOAD_OP_DONT_CARE and STORE_OP_DONT_CARE. The safest option for now is to avoid using is_discardable for textures we know will be read/written in other parts of the frame.

This PR will undo most of the performance benefit of #113781

The property is causing issues on NVidia devices

@blueskythlikesclouds blueskythlikesclouds left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunate but makes sense. I figure the next time we visit this, we should implement strict validation that errors out when a discarded texture tries to be loaded without being fully overwritten first.

@Repiteo
Repiteo merged commit 6e6d480 into godotengine:master Apr 13, 2026
20 checks passed
@Repiteo

Repiteo commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants