mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 17:00:13 +01:00
radv/meta: use radv_get_copy_flags_from_bo() more
Cleanups. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35550>
This commit is contained in:
parent
270035fdce
commit
203aacf064
6 changed files with 23 additions and 25 deletions
|
|
@ -426,3 +426,16 @@ radv_meta_bind_descriptors(struct radv_cmd_buffer *cmd_buffer, VkPipelineBindPoi
|
|||
|
||||
radv_CmdSetDescriptorBufferOffsets2EXT(radv_cmd_buffer_to_handle(cmd_buffer), &descriptor_buffer_offsets);
|
||||
}
|
||||
|
||||
enum radv_copy_flags
|
||||
radv_get_copy_flags_from_bo(const struct radeon_winsys_bo *bo)
|
||||
{
|
||||
enum radv_copy_flags copy_flags = 0;
|
||||
|
||||
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
||||
copy_flags |= RADV_COPY_FLAGS_DEVICE_LOCAL;
|
||||
if (bo->is_virtual)
|
||||
copy_flags |= RADV_COPY_FLAGS_SPARSE;
|
||||
|
||||
return copy_flags;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,6 +289,8 @@ void radv_meta_bind_descriptors(struct radv_cmd_buffer *cmd_buffer, VkPipelineBi
|
|||
VkPipelineLayout _layout, uint32_t num_descriptors,
|
||||
const VkDescriptorGetInfoEXT *descriptors);
|
||||
|
||||
enum radv_copy_flags radv_get_copy_flags_from_bo(const struct radeon_winsys_bo *bo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -15,19 +15,6 @@
|
|||
|
||||
#include "radv_cs.h"
|
||||
|
||||
static enum radv_copy_flags
|
||||
radv_get_copy_flags_from_bo(const struct radeon_winsys_bo *bo)
|
||||
{
|
||||
enum radv_copy_flags copy_flags = 0;
|
||||
|
||||
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
||||
copy_flags |= RADV_COPY_FLAGS_DEVICE_LOCAL;
|
||||
if (bo->is_virtual)
|
||||
copy_flags |= RADV_COPY_FLAGS_SPARSE;
|
||||
|
||||
return copy_flags;
|
||||
}
|
||||
|
||||
struct fill_constants {
|
||||
uint64_t addr;
|
||||
uint32_t max_offset;
|
||||
|
|
|
|||
|
|
@ -637,8 +637,8 @@ fixup_gfx9_cs_copy(struct radv_cmd_buffer *cmd_buffer, const struct radv_meta_bl
|
|||
cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_CS_PARTIAL_FLUSH | RADV_CMD_FLAG_INV_L2 | RADV_CMD_FLAG_INV_VCACHE;
|
||||
}
|
||||
|
||||
if (image->bindings[0].bo && (image->bindings[0].bo->initial_domain & RADEON_DOMAIN_VRAM))
|
||||
img_copy_flags |= RADV_COPY_FLAGS_DEVICE_LOCAL;
|
||||
if (image->bindings[0].bo)
|
||||
img_copy_flags |= radv_get_copy_flags_from_bo(image->bindings[0].bo);
|
||||
mem_copy_flags |= buf_bsurf->copy_flags;
|
||||
|
||||
for (uint32_t y = 0; y < mip_extent.height; y++) {
|
||||
|
|
|
|||
|
|
@ -217,10 +217,8 @@ radv_CmdCopyBufferToImage2(VkCommandBuffer commandBuffer, const VkCopyBufferToIm
|
|||
VK_FROM_HANDLE(radv_image, dst_image, pCopyBufferToImageInfo->dstImage);
|
||||
struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
|
||||
const struct radv_physical_device *pdev = radv_device_physical(device);
|
||||
enum radv_copy_flags src_copy_flags = 0;
|
||||
|
||||
if (src_buffer->bo->initial_domain & RADEON_DOMAIN_VRAM)
|
||||
src_copy_flags |= RADV_COPY_FLAGS_DEVICE_LOCAL;
|
||||
const enum radv_copy_flags src_copy_flags = radv_get_copy_flags_from_bo(src_buffer->bo);
|
||||
|
||||
radv_suspend_conditional_rendering(cmd_buffer);
|
||||
|
||||
|
|
@ -370,10 +368,8 @@ radv_CmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, const VkCopyImageToBuf
|
|||
VK_FROM_HANDLE(radv_image, src_image, pCopyImageToBufferInfo->srcImage);
|
||||
VK_FROM_HANDLE(radv_buffer, dst_buffer, pCopyImageToBufferInfo->dstBuffer);
|
||||
struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
|
||||
enum radv_copy_flags dst_copy_flags = 0;
|
||||
|
||||
if (dst_buffer->bo->initial_domain & RADEON_DOMAIN_VRAM)
|
||||
dst_copy_flags |= RADV_COPY_FLAGS_DEVICE_LOCAL;
|
||||
const enum radv_copy_flags dst_copy_flags = radv_get_copy_flags_from_bo(dst_buffer->bo);
|
||||
|
||||
radv_suspend_conditional_rendering(cmd_buffer);
|
||||
|
||||
|
|
|
|||
|
|
@ -103,10 +103,10 @@ radv_fixup_copy_dst_metadata(struct radv_cmd_buffer *cmd_buffer, const struct ra
|
|||
dst_image->planes[0].surface.fmask_offset + dst_image->planes[0].surface.fmask_size ==
|
||||
dst_image->planes[0].surface.cmask_offset);
|
||||
|
||||
if (src_image->bindings[0].bo && (src_image->bindings[0].bo->initial_domain & RADEON_DOMAIN_VRAM))
|
||||
src_copy_flags |= RADV_COPY_FLAGS_DEVICE_LOCAL;
|
||||
if (dst_image->bindings[0].bo && (dst_image->bindings[0].bo->initial_domain & RADEON_DOMAIN_VRAM))
|
||||
dst_copy_flags |= RADV_COPY_FLAGS_DEVICE_LOCAL;
|
||||
if (src_image->bindings[0].bo)
|
||||
src_copy_flags |= radv_get_copy_flags_from_bo(src_image->bindings[0].bo);
|
||||
if (dst_image->bindings[0].bo)
|
||||
dst_copy_flags |= radv_get_copy_flags_from_bo(dst_image->bindings[0].bo);
|
||||
|
||||
/* Copy CMASK+FMASK. */
|
||||
size = src_image->planes[0].surface.cmask_size + src_image->planes[0].surface.fmask_size;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue