diff options
author | Samuel Pitoiset <[email protected]> | 2018-10-24 08:50:24 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-10-26 10:50:03 +0200 |
commit | 02ccef7874c270da28f2c04c3273fbd95a451b72 (patch) | |
tree | c6d1f88e6ec9a10b162d2ac4f3597f3866e2ae93 | |
parent | 468c33e2f7e517adc7f57a50edbbf41ef7fd0848 (diff) |
radv: add get_image_stride_for_r32g32b32() helper
For the special R32G32B32 paths.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/vulkan/radv_meta_bufimage.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/amd/vulkan/radv_meta_bufimage.c b/src/amd/vulkan/radv_meta_bufimage.c index 6a5058693f4..de7e0b1e3e3 100644 --- a/src/amd/vulkan/radv_meta_bufimage.c +++ b/src/amd/vulkan/radv_meta_bufimage.c @@ -1420,6 +1420,21 @@ create_bview_for_r32g32b32(struct radv_cmd_buffer *cmd_buffer, }); } +static unsigned +get_image_stride_for_r32g32b32(struct radv_cmd_buffer *cmd_buffer, + struct radv_meta_blit2d_surf *surf) +{ + unsigned stride; + + if (cmd_buffer->device->physical_device->rad_info.chip_class >= GFX9) { + stride = surf->image->surface.u.gfx9.surf_pitch; + } else { + stride = surf->image->surface.u.legacy.level[0].nblk_x * 3; + } + + return stride; +} + static void itob_bind_descriptors(struct radv_cmd_buffer *cmd_buffer, struct radv_image_view *src, @@ -1560,11 +1575,7 @@ radv_meta_buffer_to_image_cs_r32g32b32(struct radv_cmd_buffer *cmd_buffer, radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_COMPUTE, pipeline); - if (cmd_buffer->device->physical_device->rad_info.chip_class >= GFX9) { - stride = dst->image->surface.u.gfx9.surf_pitch; - } else { - stride = dst->image->surface.u.legacy.level[0].nblk_x * 3; - } + stride = get_image_stride_for_r32g32b32(cmd_buffer, dst); for (unsigned r = 0; r < num_rects; ++r) { unsigned push_constants[4] = { @@ -1802,11 +1813,7 @@ radv_meta_clear_image_cs_r32g32b32(struct radv_cmd_buffer *cmd_buffer, radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_COMPUTE, pipeline); - if (cmd_buffer->device->physical_device->rad_info.chip_class >= GFX9) { - stride = dst->image->surface.u.gfx9.surf_pitch; - } else { - stride = dst->image->surface.u.legacy.level[0].nblk_x * 3; - } + stride = get_image_stride_for_r32g32b32(cmd_buffer, dst); unsigned push_constants[4] = { clear_color->uint32[0], |