mesa/bufferobj: use mapping range in BufferSubData.
authorDave Airlie <airlied@redhat.com>
Wed, 25 May 2016 04:02:27 +0000 (14:02 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 1 Jun 2016 03:30:40 +0000 (13:30 +1000)
According to GL4.5 spec:
An INVALID_OPERATION error is generated if any part of the speci-
fied buffer range is mapped with MapBufferRange or MapBuffer (see sec-
tion 6.3), unless it was mapped with MAP_PERSISTENT_BIT set in the Map-
BufferRange access flags.

So we should use the if range is mapped path.

This fixes:
GL45-CTS.buffer_storage.map_persistent_buffer_sub_data

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: "12.0, 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/bufferobj.c

index 33bc57409b1160dab01705403dec4b153f778dd8..795cb1618fd5cd630fb9374205cf85ca111e2215 100644 (file)
@@ -1765,7 +1765,7 @@ _mesa_buffer_sub_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
                       const char *func)
 {
    if (!buffer_object_subdata_range_good(ctx, bufObj, offset, size,
-                                         false, func)) {
+                                         true, func)) {
       /* error already recorded */
       return;
    }