From 4378f1f88c11b623e9876b7b8d9fa2ac0e62f481 Mon Sep 17 00:00:00 2001 From: Doug McDiarmid Date: Sat, 19 Jun 2021 22:48:21 -0700 Subject: [PATCH] Skipped meshes that do not have the required streams when adding to the RayTracingFeatureProcessor. --- .../Common/Code/Source/Mesh/MeshFeatureProcessor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index 3001831817..d0d1391da2 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -783,7 +783,7 @@ namespace AZ // retrieve vertex/index buffers RPI::ModelLod::StreamBufferViewList streamBufferViews; - [[maybe_unused]] bool result = modelLod->GetStreamsForMesh( + bool result = modelLod->GetStreamsForMesh( inputStreamLayout, streamBufferViews, nullptr, @@ -791,7 +791,12 @@ namespace AZ meshIndex, materialAssignment.m_matModUvOverrides, material->GetAsset()->GetMaterialTypeAsset()->GetUvNameMap()); - AZ_Assert(result, "Failed to retrieve mesh stream buffer views"); + + if (!result) + { + AZ_Warning("MeshFeatureProcessor", false, "Mesh is missing required vertex streams for RayTracing. Skipping."); + continue; + } // note that the element count is the size of the entire buffer, even though this mesh may only // occupy a portion of the vertex buffer. This is necessary since we are accessing it using