diff options
| author | 2023-05-22 01:13:47 -0400 | |
|---|---|---|
| committer | 2023-05-22 18:10:16 -0400 | |
| commit | 8758932031ff4836652e7577ec566fd733f46e0b (patch) | |
| tree | 05e92cf0f69862e7a59cf55744acc9657afa2a86 /src/video_core/texture_cache | |
| parent | Merge pull request #10392 from danilaml/update-cubeb-again (diff) | |
| download | yuzu-8758932031ff4836652e7577ec566fd733f46e0b.tar.gz yuzu-8758932031ff4836652e7577ec566fd733f46e0b.tar.xz yuzu-8758932031ff4836652e7577ec566fd733f46e0b.zip | |
renderer_vulkan: barrier attachment feedback loops
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 36 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache_base.h | 3 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index b24086fce..8e62a5f78 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -184,6 +184,42 @@ void TextureCache<P>::FillComputeImageViews(std::span<ImageViewInOut> views) { | |||
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | template <class P> | 186 | template <class P> |
| 187 | void TextureCache<P>::CheckFeedbackLoop(std::span<const ImageViewInOut> views) { | ||
| 188 | const bool requires_barrier = [&] { | ||
| 189 | for (const auto& view : views) { | ||
| 190 | if (!view.id) { | ||
| 191 | continue; | ||
| 192 | } | ||
| 193 | auto& image_view = slot_image_views[view.id]; | ||
| 194 | |||
| 195 | // Check color targets | ||
| 196 | for (const auto& ct_view_id : render_targets.color_buffer_ids) { | ||
| 197 | if (ct_view_id) { | ||
| 198 | auto& ct_view = slot_image_views[ct_view_id]; | ||
| 199 | if (image_view.image_id == ct_view.image_id) { | ||
| 200 | return true; | ||
| 201 | } | ||
| 202 | } | ||
| 203 | } | ||
| 204 | |||
| 205 | // Check zeta target | ||
| 206 | if (render_targets.depth_buffer_id) { | ||
| 207 | auto& zt_view = slot_image_views[render_targets.depth_buffer_id]; | ||
| 208 | if (image_view.image_id == zt_view.image_id) { | ||
| 209 | return true; | ||
| 210 | } | ||
| 211 | } | ||
| 212 | } | ||
| 213 | |||
| 214 | return false; | ||
| 215 | }(); | ||
| 216 | |||
| 217 | if (requires_barrier) { | ||
| 218 | runtime.BarrierFeedbackLoop(); | ||
| 219 | } | ||
| 220 | } | ||
| 221 | |||
| 222 | template <class P> | ||
| 187 | typename P::Sampler* TextureCache<P>::GetGraphicsSampler(u32 index) { | 223 | typename P::Sampler* TextureCache<P>::GetGraphicsSampler(u32 index) { |
| 188 | if (index > channel_state->graphics_sampler_table.Limit()) { | 224 | if (index > channel_state->graphics_sampler_table.Limit()) { |
| 189 | LOG_DEBUG(HW_GPU, "Invalid sampler index={}", index); | 225 | LOG_DEBUG(HW_GPU, "Invalid sampler index={}", index); |
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 0720494e5..1a3308e2d 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h | |||
| @@ -148,6 +148,9 @@ public: | |||
| 148 | /// Fill image_view_ids with the compute images in indices | 148 | /// Fill image_view_ids with the compute images in indices |
| 149 | void FillComputeImageViews(std::span<ImageViewInOut> views); | 149 | void FillComputeImageViews(std::span<ImageViewInOut> views); |
| 150 | 150 | ||
| 151 | /// Handle feedback loops during draws. | ||
| 152 | void CheckFeedbackLoop(std::span<const ImageViewInOut> views); | ||
| 153 | |||
| 151 | /// Get the sampler from the graphics descriptor table in the specified index | 154 | /// Get the sampler from the graphics descriptor table in the specified index |
| 152 | Sampler* GetGraphicsSampler(u32 index); | 155 | Sampler* GetGraphicsSampler(u32 index); |
| 153 | 156 | ||