Commit ca8eb21
fix(core): determine isGPUDepth from session mode instead of texture existence
Summary:
The depth occlusion system determined isGPUDepth by checking whether an
ExternalTexture (nativeTexture) existed. This caused the preprocessing
shader and material shader to disagree on which depth formula to use,
because ExternalTexture availability can differ between render contexts.
- Derive isGPUDepth from session.depthUsage === 'gpu-optimized' so both
the preprocessing and material shaders always use the same formula
- Extract shared isGPUDepth getter and getDepthTextureArray helper to
eliminate duplicated texture selection logic
- Remove minMaxEntityCount reset from cleanup() since entities persist
across XR sessions and don't re-qualify on session re-entry. This fixed the
bug of MinMax occluded objects being hidden after reentering the session
Reviewed By: cabanier
Differential Revision: D102858221
fbshipit-source-id: e5c6265972f724fc8e32437936bd48606626b3fa1 parent f823f9c commit ca8eb21
1 file changed
Lines changed: 19 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
330 | 329 | | |
331 | 330 | | |
332 | 331 | | |
| |||
365 | 364 | | |
366 | 365 | | |
367 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
368 | 378 | | |
369 | 379 | | |
370 | 380 | | |
371 | 381 | | |
372 | 382 | | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 383 | + | |
379 | 384 | | |
380 | 385 | | |
381 | 386 | | |
382 | 387 | | |
| 388 | + | |
383 | 389 | | |
384 | 390 | | |
385 | 391 | | |
| |||
481 | 487 | | |
482 | 488 | | |
483 | 489 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
| 490 | + | |
493 | 491 | | |
494 | 492 | | |
495 | 493 | | |
496 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
497 | 500 | | |
498 | 501 | | |
499 | 502 | | |
| |||
0 commit comments