Commit Graph
11 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5 0655fcc711 Vulkan: Guard the render pass cache against the render thread
GetRenderPass() looks up and inserts into renderPasses_ from the main thread
(EndCurRenderStep, CreateGraphicsPipeline) and from the render thread
(PerformBindFramebufferAsRenderTarget), unsynchronized. The render thread really
does insert rather than only hit: PreprocessSteps rewrites the load actions to
CLEAR when it merges a clear-only pass into a later one, after the main thread
already looked up the pre-merge key. DenseHashMap::Insert can Grow(), which
reallocates the buckets out from under a concurrent Get().

VKRRenderPass::Get() has the same problem one level down - it creates the passes
lazily and is called from both threads on the same object, so two threads hitting
an empty slot each create a pass and one gets overwritten and leaked, while the
sample-count branch can queue a pass for deletion that the other thread is about
to hand to vkCreateGraphicsPipelines.

A mutex each. Handing the VKRRenderPass pointer out from under the map lock is
fine, entries are only ever erased all at once in DestroyDeviceObjects.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vd8ntC2brCUtCrDJMqLbs8
2026-08-29 11:42:47 +02:00
Henrik Rydgård 4d6905672e Bunch more linting 2024-10-10 11:57:10 +02:00
Henrik Rydgård 21c6594961 Fix a bunch of Android Studio lint warnings 2024-10-10 10:24:40 +02:00
Henrik Rydgård ce2163eb93 Vulkan MSAA: Avoid creating backbuffer renderpasses with the wrong sample count, oops 2024-01-17 21:41:04 +01:00
Henrik Rydgård 6de05f13f1 More barrier batching 2023-12-30 10:41:59 +01:00
Henrik Rydgård ca4ee83038 Vulkan: Add debug names to renderpasses 2023-09-27 16:56:57 +02:00
Henrik Rydgård 6d8069dfd1 Vulkan: Remove the remains of the input attachment experiment
Haven't been using these for a while.

I've come to the conclusion here that I think it's better to try to
deal with the issues using safe workarounds like copies, instead of
relying on features with somewhat iffy driver support that are not
universal across APIs anyway.
2023-06-13 20:46:27 +02:00
Henrik Rydgård e3679df6cf Fix switching between MSAA levels 2022-12-01 22:49:00 +01:00
Henrik Rydgård 4dfce4f6bc Basically working MSAA on desktop GPUs! Some glitches remain. 2022-12-01 22:49:00 +01:00
Henrik Rydgård 06af304c8d Multisampling groundwork 2022-12-01 22:49:00 +01:00
Henrik Rydgård 31af24a230 Break out VKRFramebuffer/VKRRenderpass from VulkanRenderManager 2022-11-27 10:22:37 +01:00