radv: add img debug flag
This is similar to AMD_DEBUG=tex, but for radv. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5734>
This commit is contained in:
@@ -557,6 +557,8 @@ RADV driver environment variables
|
|||||||
``hang``
|
``hang``
|
||||||
enable GPU hangs detection and dump a report to $HOME/radv_dumps_<pid>
|
enable GPU hangs detection and dump a report to $HOME/radv_dumps_<pid>
|
||||||
if a GPU hang is detected
|
if a GPU hang is detected
|
||||||
|
``img``
|
||||||
|
Print image info
|
||||||
``info``
|
``info``
|
||||||
show GPU-related information
|
show GPU-related information
|
||||||
``metashaders``
|
``metashaders``
|
||||||
|
@@ -58,6 +58,7 @@ enum {
|
|||||||
RADV_DEBUG_LLVM = 1 << 27,
|
RADV_DEBUG_LLVM = 1 << 27,
|
||||||
RADV_DEBUG_FORCE_COMPRESS = 1 << 28,
|
RADV_DEBUG_FORCE_COMPRESS = 1 << 28,
|
||||||
RADV_DEBUG_HANG = 1 << 29,
|
RADV_DEBUG_HANG = 1 << 29,
|
||||||
|
RADV_DEBUG_IMG = 1 << 30,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@@ -552,6 +552,7 @@ static const struct debug_control radv_debug_options[] = {
|
|||||||
{"llvm", RADV_DEBUG_LLVM},
|
{"llvm", RADV_DEBUG_LLVM},
|
||||||
{"forcecompress", RADV_DEBUG_FORCE_COMPRESS},
|
{"forcecompress", RADV_DEBUG_FORCE_COMPRESS},
|
||||||
{"hang", RADV_DEBUG_HANG},
|
{"hang", RADV_DEBUG_HANG},
|
||||||
|
{"img", RADV_DEBUG_IMG},
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1409,6 +1409,31 @@ radv_destroy_image(struct radv_device *device,
|
|||||||
vk_free2(&device->vk.alloc, pAllocator, image);
|
vk_free2(&device->vk.alloc, pAllocator, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
radv_image_print_info(struct radv_device *device, struct radv_image *image)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Image:\n");
|
||||||
|
fprintf(stderr, " Info: size=%" PRIu64 ", alignment=%" PRIu32 ", "
|
||||||
|
"width=%" PRIu32 ", height=%" PRIu32 ", "
|
||||||
|
"offset=%" PRIu64 "\n",
|
||||||
|
image->size, image->alignment, image->info.width,
|
||||||
|
image->info.height, image->offset);
|
||||||
|
for (unsigned i = 0; i < image->plane_count; ++i) {
|
||||||
|
const struct radv_image_plane *plane = &image->planes[i];
|
||||||
|
const struct radeon_surf *surf = &plane->surface;
|
||||||
|
const struct vk_format_description *desc =
|
||||||
|
vk_format_description(plane->format);
|
||||||
|
|
||||||
|
fprintf(stderr,
|
||||||
|
" Plane[%u]: vkformat=%s, offset=%" PRIu64 "\n",
|
||||||
|
i, desc->name, plane->offset);
|
||||||
|
|
||||||
|
ac_surface_print_info(stderr,
|
||||||
|
&device->physical_device->rad_info,
|
||||||
|
surf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VkResult
|
VkResult
|
||||||
radv_image_create(VkDevice _device,
|
radv_image_create(VkDevice _device,
|
||||||
const struct radv_image_create_info *create_info,
|
const struct radv_image_create_info *create_info,
|
||||||
@@ -1505,6 +1530,10 @@ radv_image_create(VkDevice _device,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device->instance->debug_flags & RADV_DEBUG_IMG) {
|
||||||
|
radv_image_print_info(device, image);
|
||||||
|
}
|
||||||
|
|
||||||
*pImage = radv_image_to_handle(image);
|
*pImage = radv_image_to_handle(image);
|
||||||
|
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
|
Reference in New Issue
Block a user