EEVEE-Next: Fix shadow tests
Fix an issue in `find_first_valid` where Nvidia would incorrectly increment `src` after return. This should fix the issue where some tiles would stay corrupted until resetting EEVEE. Initialize tiles_data in `TestAlloc` so it doesn't fail in debug builds. Pull Request: https://projects.blender.org/blender/blender/pulls/114550
This commit is contained in:
@@ -24,11 +24,14 @@ const uint max_page = SHADOW_MAX_PAGE;
|
||||
|
||||
void find_first_valid(inout uint src, uint dst)
|
||||
{
|
||||
for (; src < dst; src++) {
|
||||
if (pages_cached_buf[src % max_page].x != uint(-1)) {
|
||||
for (uint i = src; i < dst; i++) {
|
||||
if (pages_cached_buf[i % max_page].x != uint(-1)) {
|
||||
src = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
src = dst;
|
||||
}
|
||||
|
||||
void page_cached_free(uint page_index)
|
||||
|
||||
@@ -648,6 +648,10 @@ class TestAlloc {
|
||||
GPU_render_begin();
|
||||
int tiles_index = 1;
|
||||
|
||||
for (int i : IndexRange(SHADOW_MAX_TILE)) {
|
||||
tiles_data[i] = 0;
|
||||
}
|
||||
|
||||
for (uint i : IndexRange(0, page_free_count)) {
|
||||
uint2 page = {i % SHADOW_PAGE_PER_ROW, i / SHADOW_PAGE_PER_ROW};
|
||||
pages_free_data[i] = page.x | (page.y << 16u);
|
||||
|
||||
Reference in New Issue
Block a user