i965: Require a UBO offset alignment of 32 bytes.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 25 Jan 2016 23:23:24 +0000 (15:23 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 14 Jul 2017 02:56:49 +0000 (19:56 -0700)
Soon, we're going to start providing UBO data to shaders as push
constants, rather than requiring them to issue pull loads.  The
3DSTATE_CONSTANT_* commands require 32 byte aligned pointers.

So, we need to increase this from 16 to 32.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_context.c

index d8f187ff7e716793a35ee5b60b979e3ebffd2dd7..b23e811f305779772a3fe698c8e8fcb99efbf542 100644 (file)
@@ -614,8 +614,11 @@ brw_initialize_context_constants(struct brw_context *brw)
     *      the element in the buffer."
     *
     * However, unaligned accesses are slower, so enforce buffer alignment.
+    *
+    * In order to push UBO data, 3DSTATE_CONSTANT_XS imposes an additional
+    * restriction: the start of the buffer needs to be 32B aligned.
     */
-   ctx->Const.UniformBufferOffsetAlignment = 16;
+   ctx->Const.UniformBufferOffsetAlignment = 32;
 
    /* ShaderStorageBufferOffsetAlignment should be a cacheline (64 bytes) so
     * that we can safely have the CPU and GPU writing the same SSBO on