summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cl_mem.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cl_mem.c b/src/cl_mem.c
index 5faef4bc..6b8ca7cd 100644
--- a/src/cl_mem.c
+++ b/src/cl_mem.c
@@ -334,6 +334,10 @@ cl_mem_new_buffer(cl_context ctx,
goto error;
}
+ /* HSW: Byte scattered Read/Write has limitation that
+ the buffer size must be a multiple of 4 bytes. */
+ sz = ALIGN(sz, 4);
+
/* Create the buffer in video memory */
mem = cl_mem_allocate(CL_MEM_BUFFER_TYPE, ctx, flags, sz, CL_FALSE, &err);
if (mem == NULL || err != CL_SUCCESS)