diff --git a/src/core/vk_raytracing.cpp b/src/core/vk_raytracing.cpp index e747ce2..0a84498 100644 --- a/src/core/vk_raytracing.cpp +++ b/src/core/vk_raytracing.cpp @@ -99,6 +99,15 @@ static VkDeviceAddress get_buffer_address(VkDevice dev, VkBuffer buf) AccelStructureHandle RayTracingManager::getOrBuildBLAS(const std::shared_ptr &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, diff --git a/texture_compression.py b/texture_compression.py index 2ca636d..ef8dedd 100644 --- a/texture_compression.py +++ b/texture_compression.py @@ -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"}