vulkan: Use vk_object_base::type for debug_report
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>
This commit is contained in:

committed by
Marge Bot

parent
c41eaf0add
commit
41318a5819
@@ -287,11 +287,8 @@ static void radv_spirv_nir_debug(void *private_data,
|
|||||||
snprintf(buffer, sizeof(buffer), "SPIR-V offset %lu: %s",
|
snprintf(buffer, sizeof(buffer), "SPIR-V offset %lu: %s",
|
||||||
(unsigned long)spirv_offset, message);
|
(unsigned long)spirv_offset, message);
|
||||||
|
|
||||||
vk_debug_report(&instance->vk.debug_report,
|
vk_debug_report(&instance->vk.debug_report, vk_flags[level],
|
||||||
vk_flags[level],
|
&debug_data->module->base, 0, 0, "radv", buffer);
|
||||||
VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT,
|
|
||||||
(uint64_t)(uintptr_t)debug_data->module,
|
|
||||||
0, 0, "radv", buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void radv_compiler_debug(void *private_data,
|
static void radv_compiler_debug(void *private_data,
|
||||||
@@ -311,9 +308,7 @@ static void radv_compiler_debug(void *private_data,
|
|||||||
*/
|
*/
|
||||||
vk_debug_report(&instance->vk.debug_report,
|
vk_debug_report(&instance->vk.debug_report,
|
||||||
vk_flags[level] | VK_DEBUG_REPORT_DEBUG_BIT_EXT,
|
vk_flags[level] | VK_DEBUG_REPORT_DEBUG_BIT_EXT,
|
||||||
VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT,
|
&debug_data->module->base, 0, 0, "radv", message);
|
||||||
(uint64_t)(uintptr_t)debug_data->module,
|
|
||||||
0, 0, "radv", message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -114,9 +114,8 @@ __vk_errorv(struct radv_instance *instance, const void *object,
|
|||||||
|
|
||||||
if (instance) {
|
if (instance) {
|
||||||
vk_debug_report(&instance->vk.debug_report,
|
vk_debug_report(&instance->vk.debug_report,
|
||||||
VK_DEBUG_REPORT_ERROR_BIT_EXT, type,
|
VK_DEBUG_REPORT_ERROR_BIT_EXT,
|
||||||
(uint64_t)(uintptr_t) object, line, 0, "radv",
|
object, line, 0, "radv", report);
|
||||||
report);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "%s\n", report);
|
fprintf(stderr, "%s\n", report);
|
||||||
|
@@ -93,8 +93,7 @@ compiler_debug_log(void *data, const char *fmt, ...)
|
|||||||
|
|
||||||
vk_debug_report(&instance->vk.debug_report,
|
vk_debug_report(&instance->vk.debug_report,
|
||||||
VK_DEBUG_REPORT_DEBUG_BIT_EXT,
|
VK_DEBUG_REPORT_DEBUG_BIT_EXT,
|
||||||
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
|
NULL, 0, 0, "anv", str);
|
||||||
0, 0, 0, "anv", str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -113,10 +113,8 @@ static void anv_spirv_nir_debug(void *private_data,
|
|||||||
|
|
||||||
snprintf(buffer, sizeof(buffer), "SPIR-V offset %lu: %s", (unsigned long) spirv_offset, message);
|
snprintf(buffer, sizeof(buffer), "SPIR-V offset %lu: %s", (unsigned long) spirv_offset, message);
|
||||||
|
|
||||||
vk_debug_report(&instance->vk.debug_report,
|
vk_debug_report(&instance->vk.debug_report, vk_flags[level],
|
||||||
vk_flags[level],
|
&debug_data->module->base,
|
||||||
VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT,
|
|
||||||
(uint64_t) (uintptr_t) debug_data->module,
|
|
||||||
0, 0, "anv", buffer);
|
0, 0, "anv", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1407,9 +1405,7 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline,
|
|||||||
vk_debug_report(&pipeline->base.device->physical->instance->vk.debug_report,
|
vk_debug_report(&pipeline->base.device->physical->instance->vk.debug_report,
|
||||||
VK_DEBUG_REPORT_WARNING_BIT_EXT |
|
VK_DEBUG_REPORT_WARNING_BIT_EXT |
|
||||||
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
|
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
|
||||||
VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT,
|
&cache->base, 0, 0, "anv",
|
||||||
(uint64_t)(uintptr_t)cache,
|
|
||||||
0, 0, "anv",
|
|
||||||
"Found a partial pipeline in the cache. This is "
|
"Found a partial pipeline in the cache. This is "
|
||||||
"most likely caused by an incomplete pipeline cache "
|
"most likely caused by an incomplete pipeline cache "
|
||||||
"import or export");
|
"import or export");
|
||||||
|
@@ -64,11 +64,9 @@ __anv_perf_warn(struct anv_device *device,
|
|||||||
|
|
||||||
snprintf(report, sizeof(report), "%s: %s", file, buffer);
|
snprintf(report, sizeof(report), "%s: %s", file, buffer);
|
||||||
|
|
||||||
VkObjectType object_type = object ? object->type : VK_OBJECT_TYPE_UNKNOWN;
|
|
||||||
vk_debug_report(&device->physical->instance->vk.debug_report,
|
vk_debug_report(&device->physical->instance->vk.debug_report,
|
||||||
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
|
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
|
||||||
object_type, (uint64_t)(uintptr_t)object,
|
object, line, 0, "anv", report);
|
||||||
line, 0, "anv", report);
|
|
||||||
|
|
||||||
mesa_logw("%s:%d: PERF: %s", file, line, buffer);
|
mesa_logw("%s:%d: PERF: %s", file, line, buffer);
|
||||||
}
|
}
|
||||||
@@ -93,11 +91,9 @@ __vk_errorv(struct anv_instance *instance,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (instance) {
|
if (instance) {
|
||||||
VkObjectType object_type = object ? object->type : VK_OBJECT_TYPE_UNKNOWN;
|
|
||||||
vk_debug_report(&instance->vk.debug_report,
|
vk_debug_report(&instance->vk.debug_report,
|
||||||
VK_DEBUG_REPORT_ERROR_BIT_EXT,
|
VK_DEBUG_REPORT_ERROR_BIT_EXT,
|
||||||
object_type, (uint64_t)(uintptr_t)object,
|
object, line, 0, "anv", report);
|
||||||
line, 0, "anv", report);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mesa_loge("%s", report);
|
mesa_loge("%s", report);
|
||||||
|
@@ -1233,9 +1233,7 @@ emit_cb_state(struct anv_graphics_pipeline *pipeline,
|
|||||||
is_dual_src_blend_factor(a->dstAlphaBlendFactor))) {
|
is_dual_src_blend_factor(a->dstAlphaBlendFactor))) {
|
||||||
vk_debug_report(&device->physical->instance->vk.debug_report,
|
vk_debug_report(&device->physical->instance->vk.debug_report,
|
||||||
VK_DEBUG_REPORT_WARNING_BIT_EXT,
|
VK_DEBUG_REPORT_WARNING_BIT_EXT,
|
||||||
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
|
&device->vk.base, 0, 0, "anv",
|
||||||
(uint64_t)(uintptr_t)device,
|
|
||||||
0, 0, "anv",
|
|
||||||
"Enabled dual-src blend factors without writing both targets "
|
"Enabled dual-src blend factors without writing both targets "
|
||||||
"in the shader. Disabling blending to avoid GPU hangs.");
|
"in the shader. Disabling blending to avoid GPU hangs.");
|
||||||
entry.ColorBufferBlendEnable = false;
|
entry.ColorBufferBlendEnable = false;
|
||||||
|
@@ -96,8 +96,8 @@ vk_destroy_debug_report_callback(struct vk_debug_report_instance *instance,
|
|||||||
vk_object_base_finish(&callback->base);
|
vk_object_base_finish(&callback->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
vk_debug_report(struct vk_debug_report_instance *instance,
|
debug_report(struct vk_debug_report_instance *instance,
|
||||||
VkDebugReportFlagsEXT flags,
|
VkDebugReportFlagsEXT flags,
|
||||||
VkDebugReportObjectTypeEXT object_type,
|
VkDebugReportObjectTypeEXT object_type,
|
||||||
uint64_t handle,
|
uint64_t handle,
|
||||||
@@ -129,6 +129,21 @@ vk_debug_report(struct vk_debug_report_instance *instance,
|
|||||||
mtx_unlock(&instance->callbacks_mutex);
|
mtx_unlock(&instance->callbacks_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
vk_debug_report(struct vk_debug_report_instance *instance,
|
||||||
|
VkDebugReportFlagsEXT flags,
|
||||||
|
const struct vk_object_base *object,
|
||||||
|
size_t location,
|
||||||
|
int32_t messageCode,
|
||||||
|
const char* pLayerPrefix,
|
||||||
|
const char *pMessage)
|
||||||
|
{
|
||||||
|
VkDebugReportObjectTypeEXT object_type =
|
||||||
|
object ? object->type : VK_OBJECT_TYPE_UNKNOWN;
|
||||||
|
debug_report(instance, flags, object_type, (uint64_t)(uintptr_t)object,
|
||||||
|
location, messageCode, pLayerPrefix, pMessage);
|
||||||
|
}
|
||||||
|
|
||||||
VkResult
|
VkResult
|
||||||
vk_common_CreateDebugReportCallbackEXT(VkInstance _instance,
|
vk_common_CreateDebugReportCallbackEXT(VkInstance _instance,
|
||||||
const VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
|
const VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
|
||||||
@@ -163,6 +178,6 @@ vk_common_DebugReportMessageEXT(VkInstance _instance,
|
|||||||
const char* pMessage)
|
const char* pMessage)
|
||||||
{
|
{
|
||||||
VK_FROM_HANDLE(vk_instance, instance, _instance);
|
VK_FROM_HANDLE(vk_instance, instance, _instance);
|
||||||
vk_debug_report(&instance->debug_report, flags, objectType,
|
debug_report(&instance->debug_report, flags, objectType,
|
||||||
object, location, messageCode, pLayerPrefix, pMessage);
|
object, location, messageCode, pLayerPrefix, pMessage);
|
||||||
}
|
}
|
||||||
|
@@ -69,8 +69,7 @@ vk_destroy_debug_report_callback(struct vk_debug_report_instance *instance,
|
|||||||
void
|
void
|
||||||
vk_debug_report(struct vk_debug_report_instance *instance,
|
vk_debug_report(struct vk_debug_report_instance *instance,
|
||||||
VkDebugReportFlagsEXT flags,
|
VkDebugReportFlagsEXT flags,
|
||||||
VkDebugReportObjectTypeEXT object_type,
|
const struct vk_object_base *object,
|
||||||
uint64_t handle,
|
|
||||||
size_t location,
|
size_t location,
|
||||||
int32_t messageCode,
|
int32_t messageCode,
|
||||||
const char* pLayerPrefix,
|
const char* pLayerPrefix,
|
||||||
|
Reference in New Issue
Block a user