google / google/filament

Calling function flushAndWait will always block on it if I not run it on main thread. Under the mac arm64 architecture.

Open
#8,137 2 comments 0 reactions 1 assignee Claimed by @pixelflinger View on GitHub
ios macos
Dominant language
C++
Stars
20.5k
Forks
2.3k
Avg merge
2d 16h
Merged PRs (30d)
74

Description

⚠️ **Issues not using this template will be systematically closed.**

**Describe the bug**
I want to use off-screen rendering to do something. When developing on the Mac platform, for some reason, I must work on non-main thread . Then I found that if I render on a non-main thread, it will be blocked in flushAndWait,This happened to me on `Mac(M1)`, but not on Windows.

**To Reproduce**
Steps to reproduce the behavior:
the code like this:
```
void test(){
//do init engine , scene, render
....
// do begin frame , readpixel , endframe, flushAndWait
renderer_->beginFrame(swapchain_);
renderer_->readPixels(....);
renderer_->endFrame(swapchain_);
//block here
engine_.flushAndWait();

}

int main(){
std::thread work(test);
work.detach()
getchar();

return 0;
}

```

**Expected behavior**
hope can on non-main thread render image (on mac M1 arm64)

**Screenshots**
no
**Logs**
no

**Desktop (please complete the following information):**
- OS: macx arm64
- GPU:
- Backend: OpenGL

**Additional context**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.