mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
radv: remove radv_device::use_global_bo_list
This is always TRUE now. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40466>
This commit is contained in:
parent
09f83982e2
commit
b24c18667d
6 changed files with 8 additions and 103 deletions
|
|
@ -8025,12 +8025,6 @@ radv_bind_descriptor_set(struct radv_cmd_buffer *cmd_buffer, VkPipelineBindPoint
|
|||
assert(set);
|
||||
assert(!(set->header.layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT));
|
||||
|
||||
if (!device->use_global_bo_list) {
|
||||
for (unsigned j = 0; j < set->header.buffer_count; ++j)
|
||||
if (set->descriptors[j])
|
||||
radv_cs_add_buffer(ws, cs->b, set->descriptors[j]);
|
||||
}
|
||||
|
||||
if (set->header.bo)
|
||||
radv_cs_add_buffer(ws, cs->b, set->header.bo);
|
||||
}
|
||||
|
|
@ -14305,9 +14299,6 @@ radv_CmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer,
|
|||
VkDeviceAddress indirectDeviceAddress)
|
||||
{
|
||||
VK_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
|
||||
|
||||
assert(device->use_global_bo_list);
|
||||
|
||||
VkTraceRaysIndirectCommand2KHR tables = {
|
||||
.raygenShaderRecordAddress = pRaygenShaderBindingTable->deviceAddress,
|
||||
|
|
@ -14330,9 +14321,6 @@ VKAPI_ATTR void VKAPI_CALL
|
|||
radv_CmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress)
|
||||
{
|
||||
VK_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
|
||||
|
||||
assert(device->use_global_bo_list);
|
||||
|
||||
radv_trace_rays(cmd_buffer, NULL, indirectDeviceAddress, radv_rt_mode_indirect2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,16 +38,6 @@ radv_write_texel_buffer_descriptor(struct radv_device *device, struct radv_cmd_b
|
|||
}
|
||||
|
||||
memcpy(dst, buffer_view->state, RADV_BUFFER_DESC_SIZE);
|
||||
|
||||
if (device->use_global_bo_list)
|
||||
return;
|
||||
|
||||
if (cmd_buffer) {
|
||||
struct radv_cmd_stream *cs = cmd_buffer->cs;
|
||||
radv_cs_add_buffer(device->ws, cs->b, buffer_view->bo);
|
||||
} else {
|
||||
*buffer_list = buffer_view->bo;
|
||||
}
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE void
|
||||
|
|
@ -82,22 +72,6 @@ radv_write_buffer_descriptor_impl(struct radv_device *device, struct radv_cmd_bu
|
|||
}
|
||||
|
||||
radv_write_buffer_descriptor(device, dst, va, range);
|
||||
|
||||
if (device->use_global_bo_list)
|
||||
return;
|
||||
|
||||
if (!buffer) {
|
||||
if (!cmd_buffer)
|
||||
*buffer_list = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (cmd_buffer) {
|
||||
struct radv_cmd_stream *cs = cmd_buffer->cs;
|
||||
radv_cs_add_buffer(device->ws, cs->b, buffer->bo);
|
||||
} else {
|
||||
*buffer_list = buffer->bo;
|
||||
}
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE void
|
||||
|
|
@ -178,30 +152,7 @@ radv_write_image_descriptor_impl(struct radv_device *device, struct radv_cmd_buf
|
|||
unsigned *dst, struct radeon_winsys_bo **buffer_list, VkDescriptorType descriptor_type,
|
||||
const VkDescriptorImageInfo *image_info)
|
||||
{
|
||||
VK_FROM_HANDLE(radv_image_view, iview, image_info->imageView);
|
||||
|
||||
radv_write_image_descriptor(dst, size, descriptor_type, image_info);
|
||||
|
||||
if (device->use_global_bo_list)
|
||||
return;
|
||||
|
||||
if (!iview) {
|
||||
if (!cmd_buffer)
|
||||
*buffer_list = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
const uint32_t max_bindings = sizeof(iview->image->bindings) / sizeof(iview->image->bindings[0]);
|
||||
for (uint32_t b = 0; b < max_bindings; b++) {
|
||||
if (cmd_buffer) {
|
||||
struct radv_cmd_stream *cs = cmd_buffer->cs;
|
||||
if (iview->image->bindings[b].bo)
|
||||
radv_cs_add_buffer(device->ws, cs->b, iview->image->bindings[b].bo);
|
||||
} else {
|
||||
*buffer_list = iview->image->bindings[b].bo;
|
||||
buffer_list++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE void
|
||||
|
|
@ -232,29 +183,7 @@ static ALWAYS_INLINE void
|
|||
radv_write_image_descriptor_ycbcr_impl(struct radv_device *device, struct radv_cmd_buffer *cmd_buffer, unsigned *dst,
|
||||
struct radeon_winsys_bo **buffer_list, const VkDescriptorImageInfo *image_info)
|
||||
{
|
||||
VK_FROM_HANDLE(radv_image_view, iview, image_info->imageView);
|
||||
|
||||
radv_write_image_descriptor_ycbcr(device, dst, image_info);
|
||||
|
||||
if (device->use_global_bo_list)
|
||||
return;
|
||||
|
||||
if (!iview) {
|
||||
if (!cmd_buffer)
|
||||
*buffer_list = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint32_t b = 0; b < ARRAY_SIZE(iview->image->bindings); b++) {
|
||||
if (cmd_buffer) {
|
||||
struct radv_cmd_stream *cs = cmd_buffer->cs;
|
||||
if (iview->image->bindings[b].bo)
|
||||
radv_cs_add_buffer(device->ws, cs->b, iview->image->bindings[b].bo);
|
||||
} else {
|
||||
*buffer_list = iview->image->bindings[b].bo;
|
||||
buffer_list++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE void
|
||||
|
|
|
|||
|
|
@ -1264,9 +1264,8 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
|
|||
? NULL
|
||||
: pdev->ws->copy_sync_payloads;
|
||||
|
||||
/* Enable the global BO list by default. */
|
||||
/* TODO: Remove the per cmdbuf BO list tracking after few Mesa releases if no blockers. */
|
||||
device->use_global_bo_list = pdev->info.has_vm_always_valid;
|
||||
/* VM_ALWAYS_VALID must be supported. */
|
||||
assert(pdev->info.has_vm_always_valid);
|
||||
|
||||
device->overallocation_disallowed = overallocation_disallowed;
|
||||
mtx_init(&device->overallocation_mutex, mtx_plain);
|
||||
|
|
|
|||
|
|
@ -203,9 +203,6 @@ struct radv_device {
|
|||
/* Whether to inline the compute dispatch size in user sgprs. */
|
||||
bool load_grid_size_from_user_sgpr;
|
||||
|
||||
/* Whether the driver uses a global BO list. */
|
||||
bool use_global_bo_list;
|
||||
|
||||
/* Whether anisotropy is forced with RADV_TEX_ANISO (-1 is disabled). */
|
||||
int force_aniso;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ radv_free_memory(struct radv_device *device, const VkAllocationCallbacks *pAlloc
|
|||
mtx_unlock(&device->overallocation_mutex);
|
||||
}
|
||||
|
||||
if (device->use_global_bo_list)
|
||||
device->ws->buffer_make_resident(device->ws, mem->bo, false);
|
||||
device->ws->buffer_make_resident(device->ws, mem->bo, false);
|
||||
radv_bo_destroy(device, &mem->base, mem->bo);
|
||||
mem->bo = NULL;
|
||||
}
|
||||
|
|
@ -227,10 +226,7 @@ radv_alloc_memory(struct radv_device *device, const VkMemoryAllocateInfo *pAlloc
|
|||
flags |= RADEON_FLAG_GTT_WC;
|
||||
} else if (!import_info) {
|
||||
/* neither export nor import */
|
||||
flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
|
||||
if (device->use_global_bo_list) {
|
||||
flags |= RADEON_FLAG_PREFER_LOCAL_BO;
|
||||
}
|
||||
flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING | RADEON_FLAG_PREFER_LOCAL_BO;
|
||||
}
|
||||
|
||||
if (flags_info && flags_info->flags & VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT)
|
||||
|
|
@ -309,11 +305,9 @@ radv_alloc_memory(struct radv_device *device, const VkMemoryAllocateInfo *pAlloc
|
|||
}
|
||||
|
||||
if (!wsi_info) {
|
||||
if (device->use_global_bo_list) {
|
||||
result = device->ws->buffer_make_resident(device->ws, mem->bo, true);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
}
|
||||
result = device->ws->buffer_make_resident(device->ws, mem->bo, true);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
*pMem = radv_device_memory_to_handle(mem);
|
||||
|
|
|
|||
|
|
@ -29,9 +29,7 @@ radv_wsi_set_memory_ownership(VkDevice _device, VkDeviceMemory _mem, VkBool32 ow
|
|||
VK_FROM_HANDLE(radv_device, device, _device);
|
||||
VK_FROM_HANDLE(radv_device_memory, mem, _mem);
|
||||
|
||||
if (device->use_global_bo_list) {
|
||||
device->ws->buffer_make_resident(device->ws, mem->bo, ownership);
|
||||
}
|
||||
device->ws->buffer_make_resident(device->ws, mem->bo, ownership);
|
||||
}
|
||||
|
||||
static struct vk_queue *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue