From cdccdfcd4d01e1b142bdb0962f5369b9366f2e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 25 Mar 2026 14:49:27 +0100 Subject: [PATCH] Fix: EEVEE: Missing bind in shadow_tag_update Caused by unused resource. --- .../eevee/shaders/eevee_shadow_page_ops.bsl.hh | 4 ++++ .../eevee/shaders/eevee_shadow_tag_update.bsl.hh | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source/blender/draw/engines/eevee/shaders/eevee_shadow_page_ops.bsl.hh b/source/blender/draw/engines/eevee/shaders/eevee_shadow_page_ops.bsl.hh index 08510f9f3bc..a2bc93c2f4c 100644 --- a/source/blender/draw/engines/eevee/shaders/eevee_shadow_page_ops.bsl.hh +++ b/source/blender/draw/engines/eevee/shaders/eevee_shadow_page_ops.bsl.hh @@ -14,6 +14,10 @@ struct TileMaps { [[storage(0, read_write)]] ShadowTileMapData (&tilemaps_buf)[]; }; +struct Tiles { + [[storage(1, read_write)]] uint (&tiles_buf)[]; +}; + struct Statistics { [[storage(7, read_write)]] ShadowStatistics &statistics_buf; }; diff --git a/source/blender/draw/engines/eevee/shaders/eevee_shadow_tag_update.bsl.hh b/source/blender/draw/engines/eevee/shaders/eevee_shadow_tag_update.bsl.hh index 0a3fa8ea31b..6998d0ecac4 100644 --- a/source/blender/draw/engines/eevee/shaders/eevee_shadow_tag_update.bsl.hh +++ b/source/blender/draw/engines/eevee/shaders/eevee_shadow_tag_update.bsl.hh @@ -29,7 +29,6 @@ struct TagUpdate { [[push_constant]] int tilemap_count; - [[storage(1, read_write)]] uint (&tiles_buf)[]; [[storage(5, read)]] const ObjectBounds (&bounds_buf)[]; [[storage(6, read)]] const uint (&resource_ids_buf)[]; }; @@ -105,7 +104,7 @@ void tag_update_vert([[resource_table]] TagUpdate &srt, } [[fragment]] -void tag_update_frag([[resource_table]] TagUpdate &srt, +void tag_update_frag([[resource_table]] Tiles &tiles, [[resource_table]] TileMaps &tilemaps, [[frag_coord]] const float4 frag_coord, [[in]] const VertOut &v_out) @@ -115,12 +114,12 @@ void tag_update_frag([[resource_table]] TagUpdate &srt, uint2 texel = uint2(frag_coord.xy); /* Tag only LOD0. The lower LOD will be written by the tag_propagate pass. */ int tile_index = shadow_tile_offset(texel, tilemap.tiles_index, 0); - atomicOr(srt.tiles_buf[tile_index], uint(SHADOW_DO_UPDATE)); + atomicOr(tiles.tiles_buf[tile_index], uint(SHADOW_DO_UPDATE)); } /* Propagate the LOD0 update tag to the lower LOD tiles. */ [[compute, local_size(SHADOW_TILEMAP_RES, SHADOW_TILEMAP_RES)]] -void tag_propagate([[resource_table]] TagUpdate &srt, +void tag_propagate([[resource_table]] Tiles &tiles, [[resource_table]] TileMaps &tilemaps, [[global_invocation_id]] const uint3 global_id) { @@ -128,13 +127,13 @@ void tag_propagate([[resource_table]] TagUpdate &srt, uint2 texel = uint2(global_id.xy); const int tile_index_lod0 = shadow_tile_offset(texel, tilemap.tiles_index, 0); - bool do_update = (srt.tiles_buf[tile_index_lod0] & uint(SHADOW_DO_UPDATE)) != 0; + bool do_update = (tiles.tiles_buf[tile_index_lod0] & uint(SHADOW_DO_UPDATE)) != 0; if (do_update) { /* TODO(fclem): Recursive downsampling. */ for (int lod = 1; lod <= SHADOW_TILEMAP_LOD; lod++) { int tile_index = shadow_tile_offset(texel >> lod, tilemap.tiles_index, lod); - atomicOr(srt.tiles_buf[tile_index], uint(SHADOW_DO_UPDATE)); + atomicOr(tiles.tiles_buf[tile_index], uint(SHADOW_DO_UPDATE)); } } }