crocus: Reduce SSBO alignment requirements from 64B to 4B.

Mirroring a change in iris; see the previous commit for rationale.
One difference is that crocus does sometimes use CPU maps on Atoms
for *reads*...but writes don't go through CPU caches.  Should be OK.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11727>
This commit is contained in:
Kenneth Graunke
2021-07-02 12:47:38 -07:00
committed by Marge Bot
parent 96d8e48ed5
commit 4bf764d53d
+1 -8
View File
@@ -305,14 +305,7 @@ crocus_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
return CROCUS_MAP_BUFFER_ALIGNMENT;
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
/* Choose a cacheline (64 bytes) so that we can safely have the CPU and
* GPU writing the same SSBO on non-coherent systems (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.
*/
return devinfo->ver >= 7 ? 64 : 0;
return devinfo->ver >= 7 ? 4 : 0;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return devinfo->ver >= 7 ? (1 << 27) : 0;
case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT: