diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-05-30 21:59:18 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-05-30 21:59:18 +0200 |
| commit | 116377f6d96d573fb3888fc79db10307188fca5c (patch) | |
| tree | e3f7347ec795b76728014ab560b7947b01aeb0e2 /src/video_core/texture_cache/texture_cache.h | |
| parent | 7c32cf03a1ce2a88b5bda041a5aebc8405fe634d (diff) | |
[vk] fix oversight with #3874 with invalid image ids (#4026)
oopsie, forgot we had a GC
fixes SSBU
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4026
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index c0a0c3736b..2cfdb94359 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -313,13 +313,14 @@ SamplerId TextureCache<P>::GetSamplerId(u32 index, bool compute) { LOG_DEBUG(HW_GPU, "Invalid sampler index={}", index); return NULL_SAMPLER_ID; } + auto const map_index = index | (compute ? Common::SlotId::TAGGED_VALUE : 0); auto const [descriptor, is_new] = table.Read(*gpu_memory, index); if (is_new) { auto const id = FindSampler(descriptor, compute); - channel_state->sampler_ids.insert_or_assign(index | (compute ? Common::SlotId::TAGGED_VALUE : 0), id); + channel_state->sampler_ids.insert_or_assign(map_index, id); return id; } - return channel_state->sampler_ids.find(index | (compute ? Common::SlotId::TAGGED_VALUE : 0))->second; + return channel_state->sampler_ids.find(map_index)->second; } template <class P> @@ -542,6 +543,7 @@ ImageViewId TextureCache<P>::VisitImageView(u32 index, bool compute) { LOG_DEBUG(HW_GPU, "Invalid image view index={}", index); return NULL_IMAGE_VIEW_ID; } + auto const map_index = index | (compute ? Common::SlotId::TAGGED_VALUE : 0); // Is new (on the tegra engine side)? auto const [descriptor, is_new] = table.Read(*gpu_memory, index); if (is_new) { @@ -551,14 +553,15 @@ ImageViewId TextureCache<P>::VisitImageView(u32 index, bool compute) { if (is_new_tc) pair->second = CreateImageView(descriptor); PrepareImageView(pair->second, false, false); - channel_state->image_view_ids.insert_or_assign(index | (compute ? Common::SlotId::TAGGED_VALUE : 0), pair->second); + channel_state->image_view_ids.insert_or_assign(map_index, pair->second); return pair->second; } - channel_state->image_view_ids.insert_or_assign(index | (compute ? Common::SlotId::TAGGED_VALUE : 0), NULL_IMAGE_VIEW_ID); + channel_state->image_view_ids.insert_or_assign(map_index, NULL_IMAGE_VIEW_ID); return NULL_IMAGE_VIEW_ID; } - auto const it = channel_state->image_view_ids.find(index | (compute ? Common::SlotId::TAGGED_VALUE : 0)); - PrepareImageView(it->second, false, false); + auto const it = channel_state->image_view_ids.find(map_index); + if (it->second != NULL_IMAGE_VIEW_ID) + PrepareImageView(it->second, false, false); return it->second; } |
