Commit 0333ba6
[Native] Report engine.name "Native" and implement updateTextureData
The native engine inherited engine.name === "WebGL" from ThinEngine, so code
that guards WebGL-only _gl access with �ngine.name === "WebGL" ran on the
native engine and dereferenced the null _gl context (e.g. TEXTURE_2D undefined).
updateTextureData also threw "not implemented".
- Report a distinct engine name ("Native"), mirroring how the WebGPU engine
reports "WebGPU", so name-gated WebGL-only code paths skip the native engine.
- Implement updateTextureData: forward the sub-rectangle (plus invertY, so the
native side can match the base texture's vertical orientation) to the native
engine. generateMipMaps is ignored (mip regeneration after a partial update is
not supported on Native).
Pairs with the BabylonNative change adding NativeEngine::UpdateTextureData.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4ff061b commit 0333ba6
2 files changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
58 | 69 | | |
59 | 70 | | |
60 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
294 | 298 | | |
295 | 299 | | |
296 | 300 | | |
| |||
2648 | 2652 | | |
2649 | 2653 | | |
2650 | 2654 | | |
2651 | | - | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
2652 | 2664 | | |
2653 | 2665 | | |
2654 | 2666 | | |
| |||
0 commit comments