files/en-us/web/api/webglrenderingcontext/getbufferparameter/index.md
{{APIRef("WebGL")}}{{AvailableInWorkers}}
The WebGLRenderingContext.getBufferParameter() method of
the WebGL API returns information about the
buffer.
getBufferParameter(target, pname)
target
: A {{domxref("WebGL_API/Types", "GLenum")}} specifying the target buffer object. Possible values:
gl.ARRAY_BUFFER
gl.ELEMENT_ARRAY_BUFFER
When using a {{domxref("WebGL2RenderingContext", "WebGL 2 context", "", 1)}}, the following values are available additionally:
gl.COPY_READ_BUFFER
gl.COPY_WRITE_BUFFER
gl.TRANSFORM_FEEDBACK_BUFFER
gl.UNIFORM_BUFFER
gl.PIXEL_PACK_BUFFER
gl.PIXEL_UNPACK_BUFFER
pname
gl.BUFFER_SIZE
gl.BUFFER_USAGE
: Returns a {{domxref("WebGL_API/Types", "GLenum")}} indicating the usage pattern of the buffer. One of the following:
gl.STATIC_DRAWgl.DYNAMIC_DRAWgl.STREAM_DRAWWhen using a {{domxref("WebGL2RenderingContext", "WebGL 2 context", "", 1)}}, the following values are available additionally:
gl.STATIC_READgl.DYNAMIC_READgl.STREAM_READgl.STATIC_COPYgl.DYNAMIC_COPYgl.STREAM_COPYDepends on the requested information (as specified with pname). Either a
{{domxref("WebGL_API/Types", "GLint")}} or a {{domxref("WebGL_API/Types", "GLenum")}}.
gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE);
{{Specifications}}
{{Compat}}