diff options
author | Felix DeGrood <felix.j.degrood@intel.com> | 2023-03-22 18:04:42 +0000 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-04-07 15:51:20 +0000 |
commit | 0130a4f6676185ea47684f6d71f8bd7752b05dd3 (patch) | |
tree | 5bfafb3619c6e8bc938cf4232ea9ee69822c0e05 /src/intel/vulkan/anv_blorp.c | |
parent | 9d38c9ca2f3d1248e269e1d1eb19ed5a9603c209 (diff) |
anv/blorp: support surf generation for addresses
Already have support for anv_buff. Extended to support addresses.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
Diffstat (limited to 'src/intel/vulkan/anv_blorp.c')
-rw-r--r-- | src/intel/vulkan/anv_blorp.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index 8a11d335eca..575c2dccd02 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -141,22 +141,22 @@ anv_blorp_batch_finish(struct blorp_batch *batch) } static void -get_blorp_surf_for_anv_buffer(struct anv_device *device, - struct anv_buffer *buffer, uint64_t offset, - uint32_t width, uint32_t height, - uint32_t row_pitch, enum isl_format format, - bool is_dest, - struct blorp_surf *blorp_surf, - struct isl_surf *isl_surf) +get_blorp_surf_for_anv_address(struct anv_device *device, + struct anv_address address, + uint32_t width, uint32_t height, + uint32_t row_pitch, enum isl_format format, + bool is_dest, + struct blorp_surf *blorp_surf, + struct isl_surf *isl_surf) { bool ok UNUSED; *blorp_surf = (struct blorp_surf) { .surf = isl_surf, .addr = { - .buffer = buffer->address.bo, - .offset = buffer->address.offset + offset, - .mocs = anv_mocs(device, buffer->address.bo, + .buffer = address.bo, + .offset = address.offset, + .mocs = anv_mocs(device, address.bo, is_dest ? ISL_SURF_USAGE_RENDER_TARGET_BIT : ISL_SURF_USAGE_TEXTURE_BIT), }, @@ -178,6 +178,21 @@ get_blorp_surf_for_anv_buffer(struct anv_device *device, assert(ok); } +static void +get_blorp_surf_for_anv_buffer(struct anv_device *device, + struct anv_buffer *buffer, uint64_t offset, + uint32_t width, uint32_t height, + uint32_t row_pitch, enum isl_format format, + bool is_dest, + struct blorp_surf *blorp_surf, + struct isl_surf *isl_surf) +{ + get_blorp_surf_for_anv_address(device, + anv_address_add(buffer->address, offset), + width, height, row_pitch, format, + is_dest, blorp_surf, isl_surf); +} + /* Pick something high enough that it won't be used in core and low enough it * will never map to an extension. */ |