google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.35k stars 1.83k forks source link

Metal drawable size issue in readPixels #4961

Open kpeeters opened 2 years ago

kpeeters commented 2 years ago

Running the modified hello-pbr of issue #4077 with a debug build of filament under Catalyst and doing a drag to trigger a readPixels leads to

_validateGetBytes:65: failed assertion `GetBytes Validation origin.x + size.width)(3024) must be <= width(2050).

which is produced by the [readPixelsTexture ... in MetalDriver::readPixels (and leads to a SIGABRT). The image looks fine on the screen.

On an actual iPad, this demo produces an image with a garbled strip on the right-hand side, as in #4077.

romainguy commented 2 years ago

This might be fixed after recent changes that went in the Metal backend.

mseare commented 1 year ago

@kpeeters How did you build Filament for Mac Catalyst? When I try to build it using build.sh, I keep getting an error:

/filament/lib/universal/libfilaflat.a(ChunkContainer.cpp.o), building for Mac Catalyst, but linking in object file built for macOS, file '/filament/lib/universal/libfilaflat.a' for architecture arm64