diff options
author | Samuel Iglesias Gonsálvez <[email protected]> | 2015-12-15 12:51:48 +0100 |
---|---|---|
committer | Samuel Iglesias Gonsálvez <[email protected]> | 2016-01-04 07:52:24 +0100 |
commit | 8cf2e892fca20c4776b4a07c39918343cb2d4e0e (patch) | |
tree | bffd4384a454c6c752adb109a1c1cc9bb2b6016a /src/mesa/main | |
parent | 86fa48426cef42d7224139603b52a7d16bd35eb5 (diff) |
i965/wm: use proper API buffer size for the surfaces.
Commit 5bb5eeea fixes a bug indicating that the surfaces should have the
API buffer size. Hovewer it picked the wrong value.
This patch adds a new variable, which takes into account
glBindBufferRange() values. This patch fixes the following CTS
regressions:
ES31-CTS.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-std430-vec-bindrangeOffset
ES31-CTS.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-std430-vec-bindrangeSize
Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]>
Reviewed-by: Marta Lofstedt <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/bufferobj.c | 4 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 3a05cd55042..8a9f9b6a48d 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -43,7 +43,7 @@ #include "glformats.h" #include "texstore.h" #include "transformfeedback.h" - +#include "macros.h" /* Debug flags */ /*#define VBO_DEBUG*/ @@ -2840,6 +2840,7 @@ bind_buffer_range_uniform_buffer(struct gl_context *ctx, _mesa_reference_buffer_object(ctx, &ctx->UniformBuffer, bufObj); bind_uniform_buffer(ctx, index, bufObj, offset, size, GL_FALSE); + bufObj->BufferRangeSize = MIN2(size, bufObj->Size); } /** @@ -2875,6 +2876,7 @@ bind_buffer_range_shader_storage_buffer(struct gl_context *ctx, _mesa_reference_buffer_object(ctx, &ctx->ShaderStorageBuffer, bufObj); bind_shader_storage_buffer(ctx, index, bufObj, offset, size, GL_FALSE); + bufObj->BufferRangeSize = MIN2(size, bufObj->Size); } /** diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 5b9fce8b7cc..97116e400ce 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1268,6 +1268,7 @@ struct gl_buffer_object GLenum Usage; /**< GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, etc. */ GLbitfield StorageFlags; /**< GL_MAP_PERSISTENT_BIT, etc. */ GLsizeiptrARB Size; /**< Size of buffer storage in bytes */ + GLsizeiptrARB BufferRangeSize; /**< Amount of data that can be read from or written to, in bytes */ GLubyte *Data; /**< Location of storage either in RAM or VRAM. */ GLboolean DeletePending; /**< true if buffer object is removed from the hash */ GLboolean Written; /**< Ever written to? (for debugging) */ |