anv: Switch to the common VK_EXT_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
eef79aab1c
commit
bcdf481d13
@@ -83,7 +83,7 @@ compiler_debug_log(void *data, const char *fmt, ...)
|
||||
struct anv_device *device = (struct anv_device *)data;
|
||||
struct anv_instance *instance = device->physical->instance;
|
||||
|
||||
if (list_is_empty(&instance->debug_report_callbacks.callbacks))
|
||||
if (list_is_empty(&instance->vk.debug_report.callbacks))
|
||||
return;
|
||||
|
||||
va_list args;
|
||||
@@ -91,7 +91,7 @@ compiler_debug_log(void *data, const char *fmt, ...)
|
||||
(void) vsnprintf(str, MAX_DEBUG_MESSAGE_LENGTH, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
vk_debug_report(&instance->debug_report_callbacks,
|
||||
vk_debug_report(&instance->vk.debug_report,
|
||||
VK_DEBUG_REPORT_DEBUG_BIT_EXT,
|
||||
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT,
|
||||
0, 0, 0, "anv", str);
|
||||
@@ -738,13 +738,6 @@ VkResult anv_CreateInstance(
|
||||
instance->physical_devices_enumerated = false;
|
||||
list_inithead(&instance->physical_devices);
|
||||
|
||||
result = vk_debug_report_instance_init(&instance->debug_report_callbacks);
|
||||
if (result != VK_SUCCESS) {
|
||||
vk_instance_finish(&instance->vk);
|
||||
vk_free(pAllocator, instance);
|
||||
return vk_error(result);
|
||||
}
|
||||
|
||||
instance->pipeline_cache_enabled =
|
||||
env_var_as_boolean("ANV_ENABLE_PIPELINE_CACHE", true);
|
||||
|
||||
@@ -774,8 +767,6 @@ void anv_DestroyInstance(
|
||||
|
||||
VG(VALGRIND_DESTROY_MEMPOOL(instance));
|
||||
|
||||
vk_debug_report_instance_destroy(&instance->debug_report_callbacks);
|
||||
|
||||
glsl_type_singleton_decref();
|
||||
|
||||
driDestroyOptionCache(&instance->dri_options);
|
||||
@@ -2373,44 +2364,6 @@ PFN_vkVoidFunction vk_icdGetPhysicalDeviceProcAddr(
|
||||
return vk_instance_get_physical_device_proc_addr(&instance->vk, pName);
|
||||
}
|
||||
|
||||
|
||||
VkResult
|
||||
anv_CreateDebugReportCallbackEXT(VkInstance _instance,
|
||||
const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkDebugReportCallbackEXT* pCallback)
|
||||
{
|
||||
ANV_FROM_HANDLE(anv_instance, instance, _instance);
|
||||
return vk_create_debug_report_callback(&instance->debug_report_callbacks,
|
||||
pCreateInfo, pAllocator, &instance->vk.alloc,
|
||||
pCallback);
|
||||
}
|
||||
|
||||
void
|
||||
anv_DestroyDebugReportCallbackEXT(VkInstance _instance,
|
||||
VkDebugReportCallbackEXT _callback,
|
||||
const VkAllocationCallbacks* pAllocator)
|
||||
{
|
||||
ANV_FROM_HANDLE(anv_instance, instance, _instance);
|
||||
vk_destroy_debug_report_callback(&instance->debug_report_callbacks,
|
||||
_callback, pAllocator, &instance->vk.alloc);
|
||||
}
|
||||
|
||||
void
|
||||
anv_DebugReportMessageEXT(VkInstance _instance,
|
||||
VkDebugReportFlagsEXT flags,
|
||||
VkDebugReportObjectTypeEXT objectType,
|
||||
uint64_t object,
|
||||
size_t location,
|
||||
int32_t messageCode,
|
||||
const char* pLayerPrefix,
|
||||
const char* pMessage)
|
||||
{
|
||||
ANV_FROM_HANDLE(anv_instance, instance, _instance);
|
||||
vk_debug_report(&instance->debug_report_callbacks, flags, objectType,
|
||||
object, location, messageCode, pLayerPrefix, pMessage);
|
||||
}
|
||||
|
||||
static struct anv_state
|
||||
anv_state_pool_emit_data(struct anv_state_pool *pool, size_t size, size_t align, const void *p)
|
||||
{
|
||||
|
@@ -113,7 +113,7 @@ static void anv_spirv_nir_debug(void *private_data,
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "SPIR-V offset %lu: %s", (unsigned long) spirv_offset, message);
|
||||
|
||||
vk_debug_report(&instance->debug_report_callbacks,
|
||||
vk_debug_report(&instance->vk.debug_report,
|
||||
vk_flags[level],
|
||||
VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT,
|
||||
(uint64_t) (uintptr_t) debug_data->module,
|
||||
@@ -1404,7 +1404,7 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline,
|
||||
*/
|
||||
assert(found < __builtin_popcount(pipeline->active_stages));
|
||||
|
||||
vk_debug_report(&pipeline->base.device->physical->instance->debug_report_callbacks,
|
||||
vk_debug_report(&pipeline->base.device->physical->instance->vk.debug_report,
|
||||
VK_DEBUG_REPORT_WARNING_BIT_EXT |
|
||||
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
|
||||
VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT,
|
||||
|
@@ -1181,8 +1181,6 @@ struct anv_instance {
|
||||
|
||||
bool pipeline_cache_enabled;
|
||||
|
||||
struct vk_debug_report_instance debug_report_callbacks;
|
||||
|
||||
struct driOptionCache dri_options;
|
||||
struct driOptionCache available_dri_options;
|
||||
};
|
||||
|
@@ -64,7 +64,7 @@ __anv_perf_warn(struct anv_device *device, const void *object,
|
||||
|
||||
snprintf(report, sizeof(report), "%s: %s", file, buffer);
|
||||
|
||||
vk_debug_report(&device->physical->instance->debug_report_callbacks,
|
||||
vk_debug_report(&device->physical->instance->vk.debug_report,
|
||||
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
|
||||
type,
|
||||
(uint64_t) (uintptr_t) object,
|
||||
@@ -96,7 +96,7 @@ __vk_errorv(struct anv_instance *instance, const void *object,
|
||||
}
|
||||
|
||||
if (instance) {
|
||||
vk_debug_report(&instance->debug_report_callbacks,
|
||||
vk_debug_report(&instance->vk.debug_report,
|
||||
VK_DEBUG_REPORT_ERROR_BIT_EXT,
|
||||
type,
|
||||
(uint64_t) (uintptr_t) object,
|
||||
|
@@ -1231,7 +1231,7 @@ emit_cb_state(struct anv_graphics_pipeline *pipeline,
|
||||
is_dual_src_blend_factor(a->dstColorBlendFactor) ||
|
||||
is_dual_src_blend_factor(a->srcAlphaBlendFactor) ||
|
||||
is_dual_src_blend_factor(a->dstAlphaBlendFactor))) {
|
||||
vk_debug_report(&device->physical->instance->debug_report_callbacks,
|
||||
vk_debug_report(&device->physical->instance->vk.debug_report,
|
||||
VK_DEBUG_REPORT_WARNING_BIT_EXT,
|
||||
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
|
||||
(uint64_t)(uintptr_t)device,
|
||||
|
Reference in New Issue
Block a user