The texImage2D function defines a texture's dimensions and format, meaning it can trigger expensive GPU memory allocations or re-allocations if the texture already exists. Conversely, texSubImage2D strictly updates the pixel data within a previously allocated texture, guaranteeing no memory re-allocation and providing much faster performance for continuous updates.
HTML-in-canvas needs to support the faster update of an existing texture. We should add texSubElementImage2D to the WebGL API.
The
texImage2Dfunction defines a texture's dimensions and format, meaning it can trigger expensive GPU memory allocations or re-allocations if the texture already exists. Conversely,texSubImage2Dstrictly updates the pixel data within a previously allocated texture, guaranteeing no memory re-allocation and providing much faster performance for continuous updates.HTML-in-canvas needs to support the faster update of an existing texture. We should add
texSubElementImage2Dto the WebGL API.