Fix #117977: EEVEE-Next: Broken shadows with 1GB pool size

shadow_page_unpack clamps the result to a valid page range, causing
all pages that shouldn't be rendered to render to the last valid page.

Pull Request: https://projects.blender.org/blender/blender/pulls/118979
This commit is contained in:
Miguel Pozo
2024-03-04 16:01:02 +01:00
parent 4f70190a01
commit fd459ae82c

View File

@@ -58,6 +58,12 @@ void main()
uint page_packed = render_map_buf[render_page_index];
ivec3 page = ivec3(shadow_page_unpack(page_packed));
/* If the page index is invalid this page shouldn't be rendered,
* however shadow_page_unpack clamps the result to a valid page.
* Instead of doing an early return (and introducing branching),
* we simply ensure the page layer is out-of-bounds. */
page.z = page_packed < SHADOW_MAX_PAGE ? page.z : -1;
ivec3 out_texel = ivec3((page.xy << page_shift) | texel_page, page.z);
uint u_depth = floatBitsToUint(f_depth);