Search completed in 0.84 seconds.
9 results for "bufferSubData":
WebGLRenderingContext.bufferSubData() - Web APIs
WebAPIWebGLRenderingContextbufferSubData
the webglrenderingcontext.buffersubdata() method of the webgl api updates a subset of a buffer object's data store.
... syntax // webgl1: void gl.buffersubdata(target, offset, arraybuffer srcdata); void gl.buffersubdata(target, offset, arraybufferview srcdata); // webgl2: void gl.buffersubdata(target, dstbyteoffset, arraybufferview srcdata, srcoffset, length); parameters target a glenum specifying the binding point (target).
... examples using buffersubdata var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, 1024, gl.static_draw); gl.buffersubdata(gl.array_buffer, 512, data); specifications specification status comment webgl 1.0the definition of 'buffersubdata' in that specification.
...And 2 more matches
WebGL2RenderingContext.copyBufferSubData() - Web APIs
WebAPIWebGL2RenderingContextcopyBufferSubData
the webgl2renderingcontext.copybuffersubdata() method of the webgl 2 api copies part of the data of a buffer to another buffer.
... syntax void gl.copybuffersubdata(readtarget, writetarget, readoffset, writeoffset, size); parameters readtarget writetarget a glenum specifying the binding point (target) from whose data store should be read or written.
... gl.createbuffer(); var dstbuffer = gl.createbuffer(); var data = new float32array(vertices); var length = vertices.length * 4; gl.bindbuffer(gl.array_buffer, srcbuffer); gl.bufferdata(gl.array_buffer, data, gl.static_draw); gl.bindbuffer(gl.copy_read_buffer, srcbuffer); gl.bindbuffer(gl.array_buffer, dstbuffer); gl.bufferdata(gl.array_buffer, new float32array(length), gl.static_draw); gl.copybuffersubdata(gl.copy_read_buffer, gl.array_buffer, 0, 0, length); specifications specification status comment webgl 2.0the definition of 'copybuffersubdata' in that specification.
... opengl es 3.0the definition of 'glcopybuffersubdata' in that specification.
WebGL2RenderingContext.getBufferSubData() - Web APIs
WebAPIWebGL2RenderingContextgetBufferSubData
the webgl2renderingcontext.getbuffersubdata() method of the webgl 2 api reads data from a buffer binding point and writes them to an arraybuffer or sharedarraybuffer.
... syntax void gl.getbuffersubdata(target, srcbyteoffset, arraybufferview dstdata, optional dstoffset, optional length); parameters target a glenum specifying the binding point (target).
... examples var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array(vertices), gl.static_draw); var arrbuffer = new arraybuffer(vertices.length * float32array.bytes_per_element); gl.getbuffersubdata(gl.array_buffer, 0, arrbuffer); specifications specification status comment webgl 2.0the definition of 'getbuffersubdata' in that specification.
Index - Web APIs
WebAPIIndex
4620 webgl2renderingcontext.copybuffersubdata() api, experimental, method, reference, webgl, webgl2 the webgl2renderingcontext.copybuffersubdata() method of the webgl 2 api copies part of the data of a buffer to another buffer.
... 4642 webgl2renderingcontext.getbuffersubdata() api, experimental, method, reference, webgl, webgl2 the webgl2renderingcontext.getbuffersubdata() method of the webgl 2 api reads data from a buffer binding point and writes them to an arraybuffer or sharedarraybuffer.
... 4736 webglrenderingcontext.buffersubdata() api, method, reference, webgl, webglrenderingcontext, buffersubdata the webglrenderingcontext.buffersubdata() method of the webgl api updates a subset of a buffer object's data store.
WebGL2RenderingContext - Web APIs
WebAPIWebGL2RenderingContext
webgl2renderingcontext.buffersubdata() updates a subset of a buffer object's data store.
... webgl2renderingcontext.copybuffersubdata() copies part of the data of a buffer to another buffer.
... webgl2renderingcontext.getbuffersubdata() reads data from a buffer and writes them to an arraybuffer or sharedarraybuffer.
WebGL best practices - Web APIs
WebAPIWebGL APIWebGL best practices
getbuffersubdata(): usual finish + round-trip.
...tasync(gl, sync, flags, interval_ms) { return new promise((resolve, reject) => { function test() { const res = gl.clientwaitsync(sync, flags, 0); if (res == gl.wait_failed) { reject(); return; } if (res == gl.timeout_expired) { settimeout(test, interval_ms); return; } resolve(); } test()); }); } async function getbuffersubdataasync( gl, target, buffer, srcbyteoffset, dstbuffer, /* optional */ dstoffset, /* optional */ length) { const sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.flush(); await clientwaitasync(gl, sync, 0, 10); gl.deletesync(sync); gl.bindbuffer(target, buffer); gl.getbuffersubdata(target, srcbyteoffset, dstbuffer, dstoffset, length); gl.bindbuffer(target, null); r...
...eturn dest; } async function readpixelsasync(gl, x, y, w, h, format, type, dest) { const buf = gl.createbuffer(); gl.bindbuffer(gl.pixel_pack_buffer, buf); gl.bufferdata(gl.pixel_pack_buffer, dest.bytelength, gl.stream_read); gl.readpixels(x, y, w, h, format, type, 0); gl.bindbuffer(gl.pixel_pack_buffer, null); await getbuffersubdataasync(gl, gl.pixel_pack_buffer, buf, 0, dest); gl.deletebuffer(buf); return dest; } canvas and webgl-related some tips are relevent to webgl, but deal with other apis.
WebGLRenderingContext - Web APIs
WebAPIWebGLRenderingContext
webglrenderingcontext.buffersubdata() updates buffer data starting at a passed offset.
WebGL constants - Web APIs
WebAPIWebGL APIConstants
compressed_texture_formats 0x86a3 vendor 0x1f00 renderer 0x1f01 version 0x1f02 implementation_color_read_type 0x8b9a implementation_color_read_format 0x8b9b browser_default_webgl 0x9244 buffers constants passed to webglrenderingcontext.bufferdata(), webglrenderingcontext.buffersubdata(), webglrenderingcontext.bindbuffer(), or webglrenderingcontext.getbufferparameter().
SharedArrayBuffer - JavaScript
WebJavaScriptReferenceGlobal ObjectsSharedArrayBuffer
apis which use sharedarraybuffer objects webglrenderingcontext.bufferdata() webglrenderingcontext.buffersubdata() webgl2renderingcontext.getbuffersubdata() security requirements shared memory and high-resolution timers were effectively disabled at the start of 2018 in light of spectre.