anv/cmd_buffer: Pull add_surface_state_reloc into genX_cmd_buffer.c
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
@@ -1245,17 +1245,6 @@ struct anv_state
|
|||||||
anv_cmd_buffer_alloc_dynamic_state(struct anv_cmd_buffer *cmd_buffer,
|
anv_cmd_buffer_alloc_dynamic_state(struct anv_cmd_buffer *cmd_buffer,
|
||||||
uint32_t size, uint32_t alignment);
|
uint32_t size, uint32_t alignment);
|
||||||
|
|
||||||
static inline void
|
|
||||||
anv_cmd_buffer_add_surface_state_reloc(struct anv_cmd_buffer *cmd_buffer,
|
|
||||||
struct anv_state state,
|
|
||||||
struct anv_bo *bo, uint32_t offset)
|
|
||||||
{
|
|
||||||
const struct isl_device *isl_dev = &cmd_buffer->device->isl_dev;
|
|
||||||
|
|
||||||
anv_reloc_list_add(&cmd_buffer->surface_relocs, &cmd_buffer->pool->alloc,
|
|
||||||
state.offset + isl_dev->ss.addr_offset, bo, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
VkResult
|
VkResult
|
||||||
anv_cmd_buffer_new_binding_table_block(struct anv_cmd_buffer *cmd_buffer);
|
anv_cmd_buffer_new_binding_table_block(struct anv_cmd_buffer *cmd_buffer);
|
||||||
|
|
||||||
|
@@ -151,6 +151,17 @@ genX(cmd_buffer_emit_state_base_address)(struct anv_cmd_buffer *cmd_buffer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
add_surface_state_reloc(struct anv_cmd_buffer *cmd_buffer,
|
||||||
|
struct anv_state state,
|
||||||
|
struct anv_bo *bo, uint32_t offset)
|
||||||
|
{
|
||||||
|
const struct isl_device *isl_dev = &cmd_buffer->device->isl_dev;
|
||||||
|
|
||||||
|
anv_reloc_list_add(&cmd_buffer->surface_relocs, &cmd_buffer->pool->alloc,
|
||||||
|
state.offset + isl_dev->ss.addr_offset, bo, offset);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup anv_cmd_state::attachments for vkCmdBeginRenderPass.
|
* Setup anv_cmd_state::attachments for vkCmdBeginRenderPass.
|
||||||
*/
|
*/
|
||||||
@@ -278,7 +289,7 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
.view = &view,
|
.view = &view,
|
||||||
.mocs = cmd_buffer->device->default_mocs);
|
.mocs = cmd_buffer->device->default_mocs);
|
||||||
|
|
||||||
anv_cmd_buffer_add_surface_state_reloc(cmd_buffer,
|
add_surface_state_reloc(cmd_buffer,
|
||||||
state->attachments[i].color_rt_state, iview->bo, iview->offset);
|
state->attachments[i].color_rt_state, iview->bo, iview->offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -827,8 +838,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
format, bo_offset, 12, 1);
|
format, bo_offset, 12, 1);
|
||||||
|
|
||||||
bt_map[0] = surface_state.offset + state_offset;
|
bt_map[0] = surface_state.offset + state_offset;
|
||||||
anv_cmd_buffer_add_surface_state_reloc(cmd_buffer, surface_state,
|
add_surface_state_reloc(cmd_buffer, surface_state, bo, bo_offset);
|
||||||
bo, bo_offset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map->surface_count == 0)
|
if (map->surface_count == 0)
|
||||||
@@ -929,8 +939,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bt_map[bias + s] = surface_state.offset + state_offset;
|
bt_map[bias + s] = surface_state.offset + state_offset;
|
||||||
anv_cmd_buffer_add_surface_state_reloc(cmd_buffer, surface_state,
|
add_surface_state_reloc(cmd_buffer, surface_state, bo, bo_offset);
|
||||||
bo, bo_offset);
|
|
||||||
}
|
}
|
||||||
assert(image == map->image_count);
|
assert(image == map->image_count);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user