diff options
author | Nanley Chery <[email protected]> | 2015-09-28 17:54:59 -0700 |
---|---|---|
committer | Nanley Chery <[email protected]> | 2015-11-09 15:41:41 -0800 |
commit | 3ee923f1c2ef0832ebd6da445548e0a651aaae80 (patch) | |
tree | bf05d111b21099b211480947558a4abf859c6285 /src/vulkan/anv_meta.c | |
parent | 17fa3d3572d7cafa95cfe31c365bbc15b3c789e3 (diff) |
anv: Rename cpp variable to "bs"
cpp (chars-per-pixel) is an integer that fails to give useful data
about most compressed formats. Instead, rename it to "bs" which
stands for block size (in bytes).
v2: Rename vk_format_for_bs to vk_format_for_size (Chad)
Use "block size" instead of "bs" in error message (Chad)
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/vulkan/anv_meta.c')
-rw-r--r-- | src/vulkan/anv_meta.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/vulkan/anv_meta.c b/src/vulkan/anv_meta.c index 0f670393112..b0f042f17ed 100644 --- a/src/vulkan/anv_meta.c +++ b/src/vulkan/anv_meta.c @@ -630,9 +630,9 @@ meta_finish_blit(struct anv_cmd_buffer *cmd_buffer, } static VkFormat -vk_format_for_cpp(int cpp) +vk_format_for_size(int bs) { - switch (cpp) { + switch (bs) { case 1: return VK_FORMAT_R8_UINT; case 2: return VK_FORMAT_R8G8_UINT; case 3: return VK_FORMAT_R8G8B8_UINT; @@ -642,7 +642,7 @@ vk_format_for_cpp(int cpp) case 12: return VK_FORMAT_R32G32B32_UINT; case 16: return VK_FORMAT_R32G32B32A32_UINT; default: - unreachable("Invalid format cpp"); + unreachable("Invalid format block size"); } } @@ -770,30 +770,30 @@ void anv_CmdCopyBuffer( /* First, we compute the biggest format that can be used with the * given offsets and size. */ - int cpp = 16; + int bs = 16; int fs = ffs(src_offset) - 1; if (fs != -1) - cpp = MIN2(cpp, 1 << fs); - assert(src_offset % cpp == 0); + bs = MIN2(bs, 1 << fs); + assert(src_offset % bs == 0); fs = ffs(dest_offset) - 1; if (fs != -1) - cpp = MIN2(cpp, 1 << fs); - assert(dest_offset % cpp == 0); + bs = MIN2(bs, 1 << fs); + assert(dest_offset % bs == 0); fs = ffs(pRegions[r].copySize) - 1; if (fs != -1) - cpp = MIN2(cpp, 1 << fs); - assert(pRegions[r].copySize % cpp == 0); + bs = MIN2(bs, 1 << fs); + assert(pRegions[r].copySize % bs == 0); - VkFormat copy_format = vk_format_for_cpp(cpp); + VkFormat copy_format = vk_format_for_size(bs); /* This is maximum possible width/height our HW can handle */ uint64_t max_surface_dim = 1 << 14; /* First, we make a bunch of max-sized copies */ - uint64_t max_copy_size = max_surface_dim * max_surface_dim * cpp; + uint64_t max_copy_size = max_surface_dim * max_surface_dim * bs; while (copy_size > max_copy_size) { do_buffer_copy(cmd_buffer, src_buffer->bo, src_offset, dest_buffer->bo, dest_offset, @@ -803,10 +803,10 @@ void anv_CmdCopyBuffer( dest_offset += max_copy_size; } - uint64_t height = copy_size / (max_surface_dim * cpp); + uint64_t height = copy_size / (max_surface_dim * bs); assert(height < max_surface_dim); if (height != 0) { - uint64_t rect_copy_size = height * max_surface_dim * cpp; + uint64_t rect_copy_size = height * max_surface_dim * bs; do_buffer_copy(cmd_buffer, src_buffer->bo, src_offset, dest_buffer->bo, dest_offset, max_surface_dim, height, copy_format); @@ -818,7 +818,7 @@ void anv_CmdCopyBuffer( if (copy_size != 0) { do_buffer_copy(cmd_buffer, src_buffer->bo, src_offset, dest_buffer->bo, dest_offset, - copy_size / cpp, 1, copy_format); + copy_size / bs, 1, copy_format); } } |