diff --git a/README.md b/README.md index ba531b8623a..1f1a5fcd7dc 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation 'com.google.android.filament:filament-android:1.9.14' + implementation 'com.google.android.filament:filament-android:1.9.15' } ``` @@ -63,7 +63,7 @@ A much smaller alternative to `filamat-android` that can only generate OpenGL sh iOS projects can use CocoaPods to install the latest release: ``` -pod 'Filament', '~> 1.9.14' +pod 'Filament', '~> 1.9.15' ``` ### Snapshots diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index fb060c86d6a..ed6a5625bbb 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -5,6 +5,10 @@ A new header is inserted each time a *tag* is created. ## Next release (main branch) +## v1.9.15 + +filamat / matc: fix sporatic crash. + ## v1.9.14 - Improve bloom/emissive with glTF files. diff --git a/android/gradle.properties b/android/gradle.properties index f742ca1dec4..a268799c9a6 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.google.android.filament -VERSION_NAME=1.9.14 +VERSION_NAME=1.9.15 POM_DESCRIPTION=Real-time physically based rendering engine for Android. diff --git a/docs/qrcode/index.html b/docs/qrcode/index.html new file mode 100644 index 00000000000..06e00e0fa6b --- /dev/null +++ b/docs/qrcode/index.html @@ -0,0 +1,143 @@ + + + + + Filament Remote + + + + + + + + + + +
+
+
+

Drop a glb file here.

+
+
+
+ + + + + \ No newline at end of file diff --git a/filament/backend/src/metal/MetalContext.h b/filament/backend/src/metal/MetalContext.h index 4d8ebd731fa..dad842f009b 100644 --- a/filament/backend/src/metal/MetalContext.h +++ b/filament/backend/src/metal/MetalContext.h @@ -24,6 +24,8 @@ #include #include +#include + #include namespace filament { @@ -92,6 +94,8 @@ struct MetalContext { uint64_t signalId = 1; TimerQueryInterface* timerQueryImpl; + + std::stack groupMarkers; }; id getPendingCommandBuffer(MetalContext* context); diff --git a/filament/backend/src/metal/MetalDriver.mm b/filament/backend/src/metal/MetalDriver.mm index c67b1a0b69c..d318fe54632 100644 --- a/filament/backend/src/metal/MetalDriver.mm +++ b/filament/backend/src/metal/MetalDriver.mm @@ -138,6 +138,8 @@ mContext->currentDrawSwapChain->releaseDrawable(); CVMetalTextureCacheFlush(mContext->textureCache, 0); + + assert_invariant(mContext->groupMarkers.empty()); } void MetalDriver::flush(int) { @@ -759,6 +761,11 @@ mContext->currentRenderPassEncoder = [getPendingCommandBuffer(mContext) renderCommandEncoderWithDescriptor:descriptor]; + if (!mContext->groupMarkers.empty()) { + mContext->currentRenderPassEncoder.label = + [NSString stringWithCString:mContext->groupMarkers.top() + encoding:NSUTF8StringEncoding]; + } // Flip the viewport, because Metal's screen space is vertically flipped that of Filament's. NSInteger renderTargetHeight = @@ -858,11 +865,12 @@ } void MetalDriver::pushGroupMarker(const char* string, size_t len) { - + mContext->groupMarkers.push(string); } void MetalDriver::popGroupMarker(int dummy) { - + assert_invariant(!mContext->groupMarkers.empty()); + mContext->groupMarkers.pop(); } void MetalDriver::startCapture(int) { diff --git a/filament/backend/src/opengl/OpenGLDriver.cpp b/filament/backend/src/opengl/OpenGLDriver.cpp index 78518ea7db8..bdee8845a48 100644 --- a/filament/backend/src/opengl/OpenGLDriver.cpp +++ b/filament/backend/src/opengl/OpenGLDriver.cpp @@ -361,7 +361,10 @@ template backend::Handle OpenGLDriver::initHandle(ARGS&& ... args) noexcept { static_assert(sizeof(D) <= 208, "Handle<> too large"); backend::Handle h{ allocateHandle(sizeof(D)) }; + registerHandleId(h.getId()); + D* addr = handle_cast(h); + new(addr) D(std::forward(args)...); #if !defined(NDEBUG) && UTILS_HAS_RTTI addr->typeId = typeid(D).name(); @@ -401,6 +404,7 @@ void OpenGLDriver::destruct(Handle& handle, D const* p) noexcept { #endif p->~D(); mHandleArena.free(const_cast(p), sizeof(D)); + unregisterHandleId(handle.getId()); } } diff --git a/filament/backend/src/opengl/OpenGLDriver.h b/filament/backend/src/opengl/OpenGLDriver.h index 1b306184f74..7000374db9b 100644 --- a/filament/backend/src/opengl/OpenGLDriver.h +++ b/filament/backend/src/opengl/OpenGLDriver.h @@ -27,8 +27,7 @@ #include #include - -#include +#include #ifndef FILAMENT_OPENGL_HANDLE_ARENA_SIZE_IN_MB # define FILAMENT_OPENGL_HANDLE_ARENA_SIZE_IN_MB 2 @@ -254,9 +253,35 @@ class OpenGLDriver final : public backend::DriverBase { using HandleArena = utils::Arena; + + utils::SpinLock mHandleSetLock; + tsl::robin_set mHandleSet; + void registerHandleId(backend::HandleBase::HandleId id) noexcept { + mHandleSetLock.lock(); + auto result = mHandleSet.insert(id); + assert_invariant(result.second); + mHandleSetLock.unlock(); + } + void unregisterHandleId(backend::HandleBase::HandleId id) noexcept { + mHandleSetLock.lock(); + assert_invariant(mHandleSet.find(id) != mHandleSet.cend() ); + mHandleSet.erase(id); + mHandleSetLock.unlock(); + } + void assertHandleId(backend::HandleBase::HandleId id) noexcept { + mHandleSetLock.lock(); + assert_invariant(mHandleSet.find(id) != mHandleSet.cend() ); + mHandleSetLock.unlock(); + } + #else using HandleArena = utils::Arena; + + inline void registerHandleId(backend::HandleBase::HandleId id) noexcept {} + inline void unregisterHandleId(backend::HandleBase::HandleId id) noexcept {} + inline void assertHandleId(backend::HandleBase::HandleId id) noexcept {} + #endif HandleArena mHandleArena; @@ -289,6 +314,7 @@ class OpenGLDriver final : public backend::DriverBase { handle_cast(backend::Handle& handle) noexcept { assert_invariant(handle); if (!handle) return nullptr; // better to get a NPE than random behavior/corruption + assertHandleId(handle.getId()); char* const base = (char *)mHandleArena.getArea().begin(); size_t offset = handle.getId() << HandleAllocator::MIN_ALIGNMENT_SHIFT; // assert that this handle is even a valid one diff --git a/filament/backend/src/vulkan/VulkanDriver.cpp b/filament/backend/src/vulkan/VulkanDriver.cpp index cef43fe4b4f..edb75965157 100644 --- a/filament/backend/src/vulkan/VulkanDriver.cpp +++ b/filament/backend/src/vulkan/VulkanDriver.cpp @@ -62,6 +62,11 @@ VKAPI_ATTR VkBool32 VKAPI_CALL debugReportCallback(VkDebugReportFlagsEXT flags, VKAPI_ATTR VkBool32 VKAPI_CALL debugUtilsCallback(VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT types, const VkDebugUtilsMessengerCallbackDataEXT* cbdata, void* pUserData) { + // TODO: For now, we are silencing an error message relating to writes to the depth buffer + // and the fact that we are not using a read-only depth layout. + if (!strcmp(cbdata->pMessageIdName, "VUID-vkCmdDrawIndexed-None-04584")) { + return VK_FALSE; + } // TODO: For now, we are silencing an error message relating to mutable comparison samplers. // It is likely that the internal "depthSampleCompare" feature flag is mistakenly set to false // by the Molten implementation. In my case, the GPU is an AMD Radeon Pro 5500M. See this bug: diff --git a/ios/CocoaPods/Filament.podspec b/ios/CocoaPods/Filament.podspec index 1f7ef7b21ae..ed83cc2753d 100644 --- a/ios/CocoaPods/Filament.podspec +++ b/ios/CocoaPods/Filament.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |spec| spec.name = "Filament" - spec.version = "1.9.14" + spec.version = "1.9.15" spec.license = { :type => "Apache 2.0", :file => "LICENSE" } spec.homepage = "https://google.github.io/filament" spec.authors = "Google LLC." spec.summary = "Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WASM/WebGL." spec.platform = :ios, "11.0" - spec.source = { :http => "https://github.com/google/filament/releases/download/v1.9.14/filament-v1.9.14-ios.tgz" } + spec.source = { :http => "https://github.com/google/filament/releases/download/v1.9.15/filament-v1.9.15-ios.tgz" } # Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon. spec.pod_target_xcconfig = { diff --git a/libs/utils/include/utils/Panic.h b/libs/utils/include/utils/Panic.h index a81276557ac..65d19ecb704 100644 --- a/libs/utils/include/utils/Panic.h +++ b/libs/utils/include/utils/Panic.h @@ -374,7 +374,7 @@ class UTILS_PUBLIC TPanic : public Panic { namespace details { // these are private, don't use -void logAndPanic( +void panicLog( char const* function, char const* file, int line, const char* format, ...) noexcept; } // namespace details @@ -457,7 +457,7 @@ class UTILS_PUBLIC ArithmeticPanic : public TPanic { * @param format printf-style string describing the error in more details */ #define PANIC_LOG(format, ...) \ - ::utils::details::logAndPanic(__PRETTY_FUNCTION__, \ + ::utils::details::panicLog(__PRETTY_FUNCTION__, \ PANIC_FILE(__FILE__), __LINE__, format, ##__VA_ARGS__) /** diff --git a/libs/utils/src/Panic.cpp b/libs/utils/src/Panic.cpp index a49cf7d7b98..023a79b2477 100644 --- a/libs/utils/src/Panic.cpp +++ b/libs/utils/src/Panic.cpp @@ -149,7 +149,7 @@ void TPanic::panic(char const* function, char const* file, int line, const ch namespace details { -void logAndPanic(char const* function, char const* file, int line, const char* format, ...) noexcept { +void panicLog(char const* function, char const* file, int line, const char* format, ...) noexcept { va_list args; va_start(args, format); std::string reason(formatString(format, args)); diff --git a/libs/utils/src/debug.cpp b/libs/utils/src/debug.cpp index d03d7cf938a..f033770a01f 100644 --- a/libs/utils/src/debug.cpp +++ b/libs/utils/src/debug.cpp @@ -20,8 +20,18 @@ namespace utils { +// we use a non-inlined, not marked as "no return" function for aborting so that we can set +// a breakpoint on the call to abort() in panic() below and skip over it in the debugger if +// needed. +UTILS_NOINLINE +void abort() noexcept { + std::abort(); +} + void panic(const char *func, const char * file, int line, const char *assertion) noexcept { PANIC_LOG("%s:%d: failed assertion `%s'\n", file, line, assertion); + abort(); // set a breakpoint here + return; // this line is needed to be able to move the cursor here in the debugger } } // namespace filament diff --git a/third_party/moltenvk/README.md b/third_party/moltenvk/README.md index 677d023386a..db246f52dc1 100644 --- a/third_party/moltenvk/README.md +++ b/third_party/moltenvk/README.md @@ -2,7 +2,7 @@ This folder contains prebuilt dylib files extracted from `macOS/lib` in the following LunarG SDK: - vulkansdk-macos-1.2.162.1.dmg + vulkansdk-macos-1.2.170.0.dmg The purpose of these files is to allow Filament developers to avoid installing the LunarG SDK. However, to enable validation you must install the SDK. diff --git a/third_party/moltenvk/libMoltenVK.dylib b/third_party/moltenvk/libMoltenVK.dylib index 25802e5a3c8..84cc177029f 100755 Binary files a/third_party/moltenvk/libMoltenVK.dylib and b/third_party/moltenvk/libMoltenVK.dylib differ diff --git a/tools/zbloat/evmar_bloat.py b/tools/zbloat/evmar_bloat.py index cfcf09ca07a..4d32edd3b57 100644 --- a/tools/zbloat/evmar_bloat.py +++ b/tools/zbloat/evmar_bloat.py @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import print_function import operator import optparse import os @@ -102,7 +103,7 @@ def parse_nm(input): # external or weak symbol continue - print >>sys.stderr, 'unparsed:', repr(line) + print('unparsed:', repr(line), file=sys.stderr) def demangle(ident, cppfilt): if cppfilt and ident.startswith('_Z'): @@ -266,7 +267,7 @@ def treeify_syms(symbols, strip_prefix=None, cppfilt=None): old_symbols[type] += 1 tree[key] = (old_size + size, old_symbols) except: - print >>sys.stderr, 'sym `%s`\tparts `%s`\tkey `%s`' % (sym, parts, key) + print('sym `%s`\tparts `%s`\tkey `%s`' % (sym, parts, key), file=sys.stderr) raise return dirs @@ -319,7 +320,7 @@ def jsonify_tree(tree, name): def dump_nm(nmfile, strip_prefix, cppfilt): dirs = treeify_syms(parse_nm(nmfile), strip_prefix, cppfilt) - print (json.dumps(jsonify_tree(dirs, '[everything]'))) + print(json.dumps(jsonify_tree(dirs, '[everything]'))) def parse_objdump(input): @@ -370,11 +371,11 @@ def dump_sections(objdump): sections = jsonify_sections('sections', sections) debug_sections = jsonify_sections('debug', debug_sections) size = sections['data']['$area'] + debug_sections['data']['$area'] - print(json.dumps({ + print((json.dumps({ 'name': 'top ' + format_bytes(size), 'detail': 'top ' + format_bytes_precise(size), 'data': { '$area': size }, - 'children': [ debug_sections, sections ]})) + 'children': [ debug_sections, sections ]}))) usage="""%prog [options] MODE @@ -418,12 +419,12 @@ def dump_sections(objdump): try: res = subprocess.check_output([opts.cppfilt, 'main']) if res.strip() != 'main': - print >>sys.stderr, ("%s failed demangling, " - "output won't be demangled." % opt.cppfilt) + print(("%s failed demangling, " + "output won't be demangled." % opt.cppfilt), file=sys.stderr) opts.cppfilt = None except: - print >>sys.stderr, ("Could not find c++filt at %s, " - "output won't be demangled." % opt.cppfilt) + print(("Could not find c++filt at %s, " + "output won't be demangled." % opt.cppfilt), file=sys.stderr) opts.cppfilt = None dump_nm(nmfile, strip_prefix=opts.strip_prefix, cppfilt=opts.cppfilt) elif mode == 'sections': @@ -442,10 +443,10 @@ def dump_sections(objdump): path = '' if opts.filter and not (opts.filter in sym or opts.filter in path): continue - print '%6s %s (%s) %s' % (format_bytes(size), sym, - symbol_type_to_human(type), path) + print('%6s %s (%s) %s' % (format_bytes(size), sym, + symbol_type_to_human(type), path)) total += size - print '%6s %s' % (format_bytes(total), 'total'), + print('%6s %s' % (format_bytes(total), 'total'), end=' ') else: - print 'unknown mode' + print('unknown mode') parser.print_usage() diff --git a/web/filament-js/package.json b/web/filament-js/package.json index 5c6246c0be0..be0cbf45b45 100644 --- a/web/filament-js/package.json +++ b/web/filament-js/package.json @@ -1,6 +1,6 @@ { "name": "filament", - "version": "1.9.14", + "version": "1.9.15", "description": "Real-time physically based rendering engine", "main": "filament.js", "module": "filament.js",