summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_image.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-08-21 13:58:27 +1000
committerDave Airlie <[email protected]>2017-08-24 01:14:14 +0100
commita74d98743115b928eaeabc0d58b63174158aa209 (patch)
tree67fe8394b487018a039155d4eeeadda980b41845 /src/amd/vulkan/radv_image.c
parent5378b5d0710be00d1316e42e692a52d4bc5d92fe (diff)
radv/image: don't rescale width/height if the format isn't changing
If the image view has the same format, we don't need to rescale the w/h. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "17.2" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_image.c')
-rw-r--r--src/amd/vulkan/radv_image.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 5e380411701..ddf15bc8361 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -947,10 +947,12 @@ radv_image_view_init(struct radv_image_view *iview,
.depth = radv_minify(image->info.depth , range->baseMipLevel),
};
- iview->extent.width = round_up_u32(iview->extent.width * vk_format_get_blockwidth(iview->vk_format),
- vk_format_get_blockwidth(image->vk_format));
- iview->extent.height = round_up_u32(iview->extent.height * vk_format_get_blockheight(iview->vk_format),
- vk_format_get_blockheight(image->vk_format));
+ if (iview->vk_format != image->vk_format) {
+ iview->extent.width = round_up_u32(iview->extent.width * vk_format_get_blockwidth(iview->vk_format),
+ vk_format_get_blockwidth(image->vk_format));
+ iview->extent.height = round_up_u32(iview->extent.height * vk_format_get_blockheight(iview->vk_format),
+ vk_format_get_blockheight(image->vk_format));
+ }
iview->base_layer = range->baseArrayLayer;
iview->layer_count = radv_get_layerCount(image, range);