diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp index 3fda88f97..901e38157 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp @@ -491,6 +491,13 @@ void GPUContextVulkan::BeginRenderPass() else { handle = _rtHandles[0]; +#if !BUILD_RELEASE + if (!handle) + { + LOG(Error, "BeginRenderPass called with no render targets bound"); + return; + } +#endif layout.ReadDepth = false; layout.WriteDepth = false; } diff --git a/Source/Engine/Level/Actors/BoneSocket.cpp b/Source/Engine/Level/Actors/BoneSocket.cpp index b73c9e1c6..4cc6f4331 100644 --- a/Source/Engine/Level/Actors/BoneSocket.cpp +++ b/Source/Engine/Level/Actors/BoneSocket.cpp @@ -48,8 +48,15 @@ void BoneSocket::UpdateTransformation() Transform t; if (nodes.IsValidIndex(_index)) nodes.Get()[_index].Decompose(t); - else + else if (parent->SkinnedModel->Skeleton.Nodes.IsValidIndex(_index)) t = parent->SkinnedModel->Skeleton.GetNodeTransform(_index); + else + { + // Retry when cached index become invalid (eg. model reimport) + _index = -1; + UpdateTransformation(); + return; + } if (!_useScale) t.Scale = _localTransform.Scale; SetLocalTransform(t); diff --git a/Source/Engine/Level/Actors/StaticModel.cpp b/Source/Engine/Level/Actors/StaticModel.cpp index 727a14000..67d608523 100644 --- a/Source/Engine/Level/Actors/StaticModel.cpp +++ b/Source/Engine/Level/Actors/StaticModel.cpp @@ -21,7 +21,7 @@ #include "Editor/Editor.h" #endif -void LightmapEntry::Serialize(ISerializable::SerializeStream& stream) +void LightmapEntry::Serialize(ISerializable::SerializeStream& stream) const { stream.JKEY("LightmapIndex"); stream.Int(TextureIndex); diff --git a/Source/Engine/Level/Prefabs/Prefab.cpp b/Source/Engine/Level/Prefabs/Prefab.cpp index d309bf7bb..a8dc997e5 100644 --- a/Source/Engine/Level/Prefabs/Prefab.cpp +++ b/Source/Engine/Level/Prefabs/Prefab.cpp @@ -61,14 +61,14 @@ Actor* Prefab::GetDefaultInstance() // Skip if not loaded if (!IsLoaded()) { - LOG(Warning, "Cannot instantiate object from not loaded prefab asset."); + LOG(Warning, "Cannot instantiate object from not loaded prefab asset '{}'", GetPath()); return nullptr; } // Prevent recursive calls if (_isCreatingDefaultInstance) { - LOG(Warning, "Loop call to Prefab::GetDefaultInstance."); + LOG(Warning, "Loop call to Prefab::GetDefaultInstance for '{}'", GetPath()); return nullptr; } _isCreatingDefaultInstance = true; diff --git a/Source/Engine/Particles/Graph/CPU/ParticleEmitterGraph.CPU.cpp b/Source/Engine/Particles/Graph/CPU/ParticleEmitterGraph.CPU.cpp index 54b2ea0cc..b42ad976d 100644 --- a/Source/Engine/Particles/Graph/CPU/ParticleEmitterGraph.CPU.cpp +++ b/Source/Engine/Particles/Graph/CPU/ParticleEmitterGraph.CPU.cpp @@ -370,7 +370,9 @@ bool ParticleEmitterGraphCPUExecutor::ComputeBounds(ParticleEmitter* emitter, Pa void ParticleEmitterGraphCPUExecutor::Draw(ParticleEmitter* emitter, ParticleEffect* effect, ParticleEmitterInstance& data, RenderContext& renderContext, Matrix& transform) { - if (!emitter->IsUsingLights || _graph._attrPosition == -1) + if (!emitter->IsUsingLights || + _graph._attrPosition == -1 || + data.Version != _graph.Version) return; // Prepare particles buffer access diff --git a/Source/Engine/Renderer/Lightmaps.h b/Source/Engine/Renderer/Lightmaps.h index aa0c04099..f44637ddc 100644 --- a/Source/Engine/Renderer/Lightmaps.h +++ b/Source/Engine/Renderer/Lightmaps.h @@ -58,7 +58,7 @@ struct LightmapEntry { } - void Serialize(ISerializable::SerializeStream& stream); + void Serialize(ISerializable::SerializeStream& stream) const; void Deserialize(ISerializable::DeserializeStream& stream); };