1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glClearBufferSubData">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glClearBufferSubData
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glClearBufferSubData
</refname>
17 <refpurpose>fill all or part of buffer object's data store with a fixed value
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glClearBufferSubData
</function></funcdef>
23 <paramdef>GLenum
<parameter>target
</parameter></paramdef>
24 <paramdef>GLenum
<parameter>internalformat
</parameter></paramdef>
25 <paramdef>GLintptr
<parameter>offset
</parameter></paramdef>
26 <paramdef>GLsizeiptr
<parameter>size
</parameter></paramdef>
27 <paramdef>GLenum
<parameter>format
</parameter></paramdef>
28 <paramdef>GLenum
<parameter>type
</parameter></paramdef>
29 <paramdef>const void *
<parameter>data
</parameter></paramdef>
33 <refsect1 id=
"parameters"><title>Parameters
</title>
36 <term><parameter>target
</parameter></term>
39 Specify the target of the operation.
<parameter>target
</parameter> must be
40 one of the global buffer binding targets.
45 <term><parameter>internalformat
</parameter></term>
48 The internal format with which the data will be stored in the buffer object.
53 <term><parameter>offset
</parameter></term>
56 The offset, in basic machine units into the buffer object's data store at which to start filling.
61 <term><parameter>size
</parameter></term>
64 The size, in basic machine units of the range of the data store to fill.
69 <term><parameter>format
</parameter></term>
72 The format of the data in memory addressed by
<parameter>data
</parameter>.
77 <term><parameter>type
</parameter></term>
80 The type of the data in memory addressed by
<parameter>data
</parameter>.
85 <term><parameter>data
</parameter></term>
88 The address of a memory location storing the data to be replicated into the
95 <refsect1 id=
"description"><title>Description
</title>
97 <function>glClearBufferSubData
</function> fills a specified region of a buffer object's
98 data store with data from client memory.
<parameter>offset
</parameter> and
<parameter>size
</parameter>
99 demark the extent of the region within the data store of the buffer object bound to
100 <parameter>target
</parameter> to fill with data. Data, initially supplied in a format
101 specified by
<parameter>format
</parameter> in data type
<parameter>type
</parameter> is
102 read from the memory address given by
<parameter>data
</parameter> and converted into
103 the internal representation given by
<parameter>internalforamt
</parameter>.
104 This converted data is then replicated throughout the specified region of the buffer object's
108 If
<parameter>data
</parameter> is NULL, then the subrange of the buffer's data store
109 is filled with zeros.
112 <refsect1 id=
"errors"><title>Errors
</title>
114 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>target
</parameter> not one of the generic buffer binding targets.
117 <constant>GL_INVALID_VALUE
</constant> is generated if no buffer is bound to
<parameter>target
</parameter>.
120 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>internalformat
</parameter> is not a sized internal format.
123 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>offset
</parameter> or
<parameter>range
</parameter> are not multiples of
124 the number of basic machine units per-element for the internal format specified by
125 <parameter>internalformat
</parameter>.
128 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>offset
</parameter> or
<parameter>size
</parameter> is less than zero, or if
129 <parameter>offset
</parameter> +
<parameter>size
</parameter> is greater than the value of
<constant>GL_BUFFER_SIZE
</constant> for the buffer bound to
<parameter>target
</parameter>.
132 <constant>GL_INVALID_OPERATION
</constant> is generated if any part of the specified buffer range is
133 mapped with
<citerefentry><refentrytitle>glMapBufferRange
</refentrytitle></citerefentry> or
<citerefentry><refentrytitle>glMapBuffer
</refentrytitle></citerefentry>.
136 <refsect1 id=
"seealso"><title>See Also
</title>
138 <citerefentry><refentrytitle>glClearBufferData
</refentrytitle></citerefentry>.
141 <refsect1 id=
"Copyright"><title>Copyright
</title>
143 Copyright
<trademark class=
"copyright"></trademark> 2012 Khronos Group.
144 This material may be distributed subject to the terms and conditions set forth in
145 the Open Publication License, v
1.0,
8 June
1999.
146 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.