mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 08:30:10 +01:00
i965: Use 64-byte offset alignment for shader storage buffers
This should be a cacheline (64 bytes) so that we can safely have the CPU and GPU writing the same SSBO on non-cachecoherent systems (our Atom CPUs). With UBOs, the GPU never writes, so there's no problem. For an SSBO, the GPU and the CPU can be updating disjoint regions of the buffer simultaneously and that will break if the regions overlap the same cacheline. v2: - Use cacheline size (64 bytes) instead of 16 bytes (Kristian). - Update commit log and add a comment in the code explaining why we use cacheline size (Ben). Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
This commit is contained in:
parent
4cf908f9cb
commit
332ff009ff
1 changed files with 9 additions and 0 deletions
|
|
@ -567,6 +567,15 @@ brw_initialize_context_constants(struct brw_context *brw)
|
|||
* However, unaligned accesses are slower, so enforce buffer alignment.
|
||||
*/
|
||||
ctx->Const.UniformBufferOffsetAlignment = 16;
|
||||
|
||||
/* ShaderStorageBufferOffsetAlignment should be a cacheline (64 bytes) so
|
||||
* that we can safely have the CPU and GPU writing the same SSBO on
|
||||
* non-cachecoherent systems (our Atom CPUs). With UBOs, the GPU never
|
||||
* writes, so there's no problem. For an SSBO, the GPU and the CPU can
|
||||
* be updating disjoint regions of the buffer simultaneously and that will
|
||||
* break if the regions overlap the same cacheline.
|
||||
*/
|
||||
ctx->Const.ShaderStorageBufferOffsetAlignment = 64;
|
||||
ctx->Const.TextureBufferOffsetAlignment = 16;
|
||||
ctx->Const.MaxTextureBufferSize = 128 * 1024 * 1024;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue