@@ -134,7 +134,7 @@ interface IBuffer {
134134 data : ByteBuffer ,
135135 offset : Long ,
136136 ): Throwable ? {
137- if (! bufferValid(target))
137+ if (! bufferValid(target, access ))
138138 return IllegalArgumentException (" Target is not valid. Refer to the table in the documentation" )
139139
140140 if (! bufferBound(target))
@@ -152,7 +152,7 @@ interface IBuffer {
152152 * @param data The data to put in the new allocated buffer
153153 */
154154 fun allocate (data : ByteBuffer ): Throwable ? {
155- if (! bufferValid(target))
155+ if (! bufferValid(target, access ))
156156 return IllegalArgumentException (" Target is not valid. Refer to the table in the documentation" )
157157
158158 if (! bufferUsageValid(usage))
@@ -172,7 +172,7 @@ interface IBuffer {
172172 * @param size The size of the new buffer
173173 */
174174 fun allocate (size : Long ): Throwable ? {
175- if (! bufferValid(target))
175+ if (! bufferValid(target, access ))
176176 return IllegalArgumentException (" Target is not valid. Refer to the table in the documentation" )
177177
178178 if (! bufferUsageValid(usage))
@@ -191,7 +191,7 @@ interface IBuffer {
191191 * This function handles the buffer binding
192192 */
193193 fun storage (data : ByteBuffer ): Throwable ? {
194- if (! bufferValid(target))
194+ if (! bufferValid(target, access ))
195195 return IllegalArgumentException (" Target is not valid. Refer to the table in the documentation" )
196196
197197 if (! bufferUsageValid(usage))
@@ -212,7 +212,7 @@ interface IBuffer {
212212 * @param size The size of the storage buffer
213213 */
214214 fun storage (size : Long ): Throwable ? {
215- if (! bufferValid(target))
215+ if (! bufferValid(target, access ))
216216 return IllegalArgumentException (" Target is not valid. Refer to the table in the documentation" )
217217
218218 if (! bufferUsageValid(usage))
@@ -243,7 +243,7 @@ interface IBuffer {
243243 size < 0
244244 ) return IllegalArgumentException (" Invalid offset or size parameter offset: $offset size: $size " )
245245
246- if (! bufferValid(target))
246+ if (! bufferValid(target, access ))
247247 return IllegalArgumentException (" Target is not valid. Refer to the table in the documentation" )
248248
249249 if (! bufferBound(target))
0 commit comments