From 1ea5b1233503369deb7b1c1d5e9fae0e27005cdd Mon Sep 17 00:00:00 2001 From: Stanislav Denisov Date: Sun, 15 Mar 2026 10:52:57 +0100 Subject: [PATCH] Fix thumbnail rendering (#1587) --- Editor/Editor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp index f8883a445..43ab20d0e 100644 --- a/Editor/Editor.cpp +++ b/Editor/Editor.cpp @@ -5692,10 +5692,6 @@ void EditorComponent::SaveAs() Texture EditorComponent::CreateThumbnail(Texture texture, uint32_t target_width, uint32_t target_height, bool mipmaps) const { GraphicsDevice* device = GetDevice(); - // Ensure GPU has finished rendering before creating thumbnail - device->SubmitCommandLists(); - device->WaitForGPU(); - CommandList cmd = device->BeginCommandList(); Texture thumbnail = texture; @@ -5791,6 +5787,10 @@ Texture EditorComponent::CreateThumbnail(Texture texture, uint32_t target_width, wi::renderer::GenerateMipChain(thumbnail, wi::renderer::MIPGENFILTER_LINEAR, cmd); } + // Ensure GPU has finished rendering + device->SubmitCommandLists(); + device->WaitForGPU(); + return thumbnail; } @@ -5824,7 +5824,7 @@ bool EditorComponent::SetupThumbnailCamera(wi::RenderPath3D& thumbnailRenderPath auto add_entity_bounds = [&](const Entity entity) { const ObjectComponent* object = scene.objects.GetComponent(entity); - if (object != nullptr && object->meshID != INVALID_ENTITY) + if (object != nullptr && object->IsRenderable() && object->meshID != INVALID_ENTITY) { const MeshComponent* mesh = scene.meshes.GetComponent(object->meshID); const TransformComponent* transform = scene.transforms.GetComponent(entity);