Hi,
Would love to know if anyone can shed some light on why this code performs so adversely on Safari 16.0 (macOS Monterey v12.6). Tested on an iMac M1.
For context, uMainSampler is a sampler2D array, and this function is called from main such as:
vec4 texture = getSampler(int(outTexId), outTexCoord)
Using this approach we're seeing fps rates no higher than 13fps with a single sprite on-screen and it drags Safari performance really low with it.
If we disable 'WebGL via Metal' it's a solid 60 fps.
If we use Chrome or Firefox, it's a solid 60 fps.
So this is 100% Metal related.
If we use the following function instead, we also get 60 fps:
If the first approach performed badly on all browsers, I could understand the issue was just with the function, but to see it only tank on Safari with Metal must point to something more specific to how it's handled in the back end.
In the meantime, we'll work around it with the if/else approach, but it'd be great to know if this is a common issue (and has a fix upstream?)
Cheers,
Rich