anv: Cache VB/IB in L3$ for Gfx12

Gfx12 enables caching of Vertex and Index Buffers in L3.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9834>
This commit is contained in:
Felix DeGrood
2021-03-24 09:08:58 -07:00
committed by Marge Bot
parent 00f01f5226
commit 6c345ddbe4
4 changed files with 16 additions and 0 deletions

View File

@@ -379,6 +379,10 @@ blorp_fill_vertex_buffer_state(struct GENX(VERTEX_BUFFER_STATE) *vb,
vb[idx].BufferAccessType = stride > 0 ? VERTEXDATA : INSTANCEDATA; vb[idx].BufferAccessType = stride > 0 ? VERTEXDATA : INSTANCEDATA;
vb[idx].MaxIndex = stride > 0 ? size / stride : 0; vb[idx].MaxIndex = stride > 0 ? size / stride : 0;
#endif #endif
#if GFX_VER >= 12
vb[idx].L3BypassDisable = true;
#endif
} }
static void static void

View File

@@ -3537,6 +3537,9 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
.BufferPitch = stride, .BufferPitch = stride,
.BufferStartingAddress = anv_address_add(buffer->address, offset), .BufferStartingAddress = anv_address_add(buffer->address, offset),
.NullVertexBuffer = offset >= buffer->size, .NullVertexBuffer = offset >= buffer->size,
#if GFX_VER >= 12
.L3BypassDisable = true,
#endif
#if GFX_VER >= 8 #if GFX_VER >= 8
.BufferSize = size, .BufferSize = size,
@@ -3726,6 +3729,9 @@ emit_vertex_bo(struct anv_cmd_buffer *cmd_buffer,
.MOCS = addr.bo ? anv_mocs(cmd_buffer->device, addr.bo, .MOCS = addr.bo ? anv_mocs(cmd_buffer->device, addr.bo,
ISL_SURF_USAGE_VERTEX_BUFFER_BIT) : 0, ISL_SURF_USAGE_VERTEX_BUFFER_BIT) : 0,
.NullVertexBuffer = size == 0, .NullVertexBuffer = size == 0,
#if GFX_VER >= 12
.L3BypassDisable = true,
#endif
#if (GFX_VER >= 8) #if (GFX_VER >= 8)
.BufferStartingAddress = addr, .BufferStartingAddress = addr,
.BufferSize = size .BufferSize = size

View File

@@ -92,6 +92,9 @@ genX(cmd_buffer_so_memcpy)(struct anv_cmd_buffer *cmd_buffer,
.BufferStartingAddress = src, .BufferStartingAddress = src,
.BufferPitch = bs, .BufferPitch = bs,
.MOCS = anv_mocs(cmd_buffer->device, src.bo, 0), .MOCS = anv_mocs(cmd_buffer->device, src.bo, 0),
#if GFX_VER >= 12
.L3BypassDisable = true,
#endif
#if (GFX_VER >= 8) #if (GFX_VER >= 8)
.BufferSize = size, .BufferSize = size,
#else #else

View File

@@ -803,6 +803,9 @@ void genX(CmdBindIndexBuffer)(
ib.MOCS = anv_mocs(cmd_buffer->device, ib.MOCS = anv_mocs(cmd_buffer->device,
buffer->address.bo, buffer->address.bo,
ISL_SURF_USAGE_INDEX_BUFFER_BIT); ISL_SURF_USAGE_INDEX_BUFFER_BIT);
#if GFX_VER >= 12
ib.L3BypassDisable = true;
#endif
ib.BufferStartingAddress = anv_address_add(buffer->address, offset); ib.BufferStartingAddress = anv_address_add(buffer->address, offset);
ib.BufferSize = buffer->size - offset; ib.BufferSize = buffer->size - offset;
} }