alipbcs / ZetaRay

Real-time Direct3D 12 path tracer
MIT License
223 stars 4 forks source link

How many logic cores are you running with? #3

Closed yhyu13 closed 1 year ago

yhyu13 commented 1 year ago

Hi,

I just found out that this project assumed max 16 threads for some reason?

Everything about threads just breaks on my rig which has 16 physical cores detected.

2MhRDgHBZH

I think it is because this project has fixed a maximum of 16 threads, and that you have related num of threads equal to physical cores + num backgrounds threads (which in my case is 16 + 2 = 18 exceed MAX_NUM_THREADS which causes numerous heap corruption for cocurrent queue)

In my local workspace, limiting physical cores fix's this issue for short, but it's weird.

rider64_06GMGAMdTd

alipbcs commented 1 year ago

You're right, it was indeed an oversight. To kickstart the project, I had initially set the maximum to 16 and thought I'd fix it later, but unfortunately I forgot.

I'll implement a fix to set the maximum to a more reasonable value.