mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
anv: move xfb buffer storage to 64bit address + mocs
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33909>
This commit is contained in:
parent
3c0dcfeb0f
commit
648d843813
3 changed files with 16 additions and 14 deletions
|
|
@ -1155,14 +1155,17 @@ void anv_CmdBindTransformFeedbackBuffersEXT(
|
||||||
assert(firstBinding + bindingCount <= MAX_XFB_BUFFERS);
|
assert(firstBinding + bindingCount <= MAX_XFB_BUFFERS);
|
||||||
for (uint32_t i = 0; i < bindingCount; i++) {
|
for (uint32_t i = 0; i < bindingCount; i++) {
|
||||||
if (pBuffers[i] == VK_NULL_HANDLE) {
|
if (pBuffers[i] == VK_NULL_HANDLE) {
|
||||||
xfb[firstBinding + i].buffer = NULL;
|
xfb[firstBinding + i] = (struct anv_xfb_binding) { 0 };
|
||||||
} else {
|
} else {
|
||||||
ANV_FROM_HANDLE(anv_buffer, buffer, pBuffers[i]);
|
ANV_FROM_HANDLE(anv_buffer, buffer, pBuffers[i]);
|
||||||
xfb[firstBinding + i].buffer = buffer;
|
xfb[firstBinding + i] = (struct anv_xfb_binding) {
|
||||||
xfb[firstBinding + i].offset = pOffsets[i];
|
.addr = anv_address_physical(
|
||||||
xfb[firstBinding + i].size =
|
anv_address_add(buffer->address, pOffsets[i])),
|
||||||
vk_buffer_range(&buffer->vk, pOffsets[i],
|
.size = vk_buffer_range(&buffer->vk, pOffsets[i],
|
||||||
pSizes ? pSizes[i] : VK_WHOLE_SIZE);
|
pSizes ? pSizes[i] : VK_WHOLE_SIZE),
|
||||||
|
.mocs = anv_mocs(cmd_buffer->device, buffer->address.bo,
|
||||||
|
ISL_SURF_USAGE_STREAM_OUT_BIT),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3685,9 +3685,9 @@ struct anv_vertex_binding {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct anv_xfb_binding {
|
struct anv_xfb_binding {
|
||||||
struct anv_buffer * buffer;
|
uint64_t addr;
|
||||||
VkDeviceSize offset;
|
uint32_t mocs;
|
||||||
VkDeviceSize size;
|
VkDeviceSize size;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct anv_push_constants {
|
struct anv_push_constants {
|
||||||
|
|
|
||||||
|
|
@ -821,11 +821,10 @@ cmd_buffer_flush_gfx_state(struct anv_cmd_buffer *cmd_buffer)
|
||||||
sob._3DCommandSubOpcode = SO_BUFFER_INDEX_0_CMD + idx;
|
sob._3DCommandSubOpcode = SO_BUFFER_INDEX_0_CMD + idx;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cmd_buffer->state.xfb_enabled && xfb->buffer && xfb->size != 0) {
|
if (cmd_buffer->state.xfb_enabled &&
|
||||||
sob.MOCS = anv_mocs(cmd_buffer->device, xfb->buffer->address.bo,
|
xfb->addr != 0 && xfb->size != 0) {
|
||||||
ISL_SURF_USAGE_STREAM_OUT_BIT);
|
sob.MOCS = xfb->mocs;
|
||||||
sob.SurfaceBaseAddress = anv_address_add(xfb->buffer->address,
|
sob.SurfaceBaseAddress = anv_address_from_u64(xfb->addr);
|
||||||
xfb->offset);
|
|
||||||
sob.SOBufferEnable = true;
|
sob.SOBufferEnable = true;
|
||||||
sob.StreamOffsetWriteEnable = false;
|
sob.StreamOffsetWriteEnable = false;
|
||||||
/* Size is in DWords - 1 */
|
/* Size is in DWords - 1 */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue