RT BLAS update bug fix

This commit is contained in:
2025-11-23 23:47:16 +09:00
parent cbcaf23df1
commit 1bff14571c
2 changed files with 12 additions and 3 deletions

View File

@@ -99,6 +99,15 @@ static VkDeviceAddress get_buffer_address(VkDevice dev, VkBuffer buf)
AccelStructureHandle RayTracingManager::getOrBuildBLAS(const std::shared_ptr<MeshAsset> &mesh)
{
if (!mesh) return {};
// If uploads are deferred, ensure any pending mesh buffer uploads are flushed
// before building a BLAS that reads from those GPU buffers.
if (_resources && _resources->deferred_uploads() && _resources->has_pending_uploads())
{
fmt::println("[RT] getOrBuildBLAS: flushing pending resource uploads before BLAS build");
_resources->process_queued_uploads_immediate();
}
if (auto it = _blasByMesh.find(mesh.get()); it != _blasByMesh.end())
{
fmt::println("[RT] getOrBuildBLAS reuse by mesh mesh='{}' handle={}", mesh->name,

View File

@@ -9,9 +9,9 @@ except Exception:
PIL_OK = False
DEFAULT_SUFFIX = {
"albedo": ["_albedo", "_basecolor", "_base_colour", "_base_color", "_base", "baseColor"],
"mr": ["_mr", "_orm", "_metalrough", "_metallicroughness", "metallicRoughness"],
"normal": ["_normal", "_norm", "_nrm", "_normalgl"]
"albedo": ["_albedo", "_basecolor", "_base_colour", "_base_color", "_base", "baseColor", "BaseColor"],
"mr": ["_mr", "_orm", "_metalrough", "_metallicroughness", "metallicRoughness", "Metallic"],
"normal": ["_normal", "_norm", "_nrm", "_normalgl", "Normal"]
}
SUPPORTED_IMAGE_EXTS = {".png", ".jpg", ".jpeg", ".tga", ".tif", ".tiff"}