diff options
author | Dave Airlie <[email protected]> | 2017-10-12 09:32:14 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-10-13 07:53:34 +1000 |
commit | 26f1ba94a384718e0e5974c10d4f758459ef0b10 (patch) | |
tree | e25c447ac4d59f0a00687e286f5aed19fad3b0d7 | |
parent | 69730dc589ceb6d6e7e0c0a065580cda1d51d432 (diff) |
mesa/bufferobj: fix atomic offset/size get
When I realigned the bufferobj code, I didn't see the getters
were different, realign the getters to work the same as ssbo.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103214
Fixes: 65d3ef7cd (mesa: align atomic buffer handling code with ubo/ssbo (v1.1))
Reviewed-by: Samuel Pitoiset <[email protected]>
Tested-by: Mark Janes <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r-- | src/mesa/main/get.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 4c4a4a79c07..e68a93b10ee 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -2349,7 +2349,8 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) goto invalid_enum; if (index >= ctx->Const.MaxAtomicBufferBindings) goto invalid_value; - v->value_int64 = ctx->AtomicBufferBindings[index].Offset; + v->value_int64 = ctx->AtomicBufferBindings[index].Offset < 0 ? 0 : + ctx->AtomicBufferBindings[index].Offset; return TYPE_INT64; case GL_ATOMIC_COUNTER_BUFFER_SIZE: @@ -2357,7 +2358,8 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) goto invalid_enum; if (index >= ctx->Const.MaxAtomicBufferBindings) goto invalid_value; - v->value_int64 = ctx->AtomicBufferBindings[index].Size; + v->value_int64 = ctx->AtomicBufferBindings[index].Size < 0 ? 0 : + ctx->AtomicBufferBindings[index].Size; return TYPE_INT64; case GL_VERTEX_BINDING_DIVISOR: |