Skip to content

Commit

Permalink
webgl1
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e committed Sep 14, 2024
1 parent e482312 commit c11c95b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cocos/gfx/webgl/webgl-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,9 @@ export function WebGLCmdFuncUpdateBuffer (
}
}

if (size === buff.byteLength) {
if ((gpuBuffer.memUsage & MemoryUsageBit.HOST) && offset === 0 && size === buff.byteLength) {
gl.bufferData(gpuBuffer.glTarget, buff, gl.DYNAMIC_DRAW);
} else if (size === buff.byteLength) {
gl.bufferSubData(gpuBuffer.glTarget, offset, buff);
} else {
gl.bufferSubData(gpuBuffer.glTarget, offset, buff.slice(0, size));
Expand Down

0 comments on commit c11c95b

Please sign in to comment.