Class EXTDebugReport
- java.lang.Object
-
- org.lwjgl.vulkan.EXTDebugReport
-
public class EXTDebugReport extends java.lang.Object
Due to the nature of the Vulkan interface, there is very little error information available to the developer/application. By enabling optional validation layers and using the Debug Report extension a developer has much more detailed feedback on the application's use of Vulkan.This extension adds two entrypoints (
CreateDebugReportCallbackEXT
,DestroyDebugReportCallbackEXT
) and an extension structure that together define a way for layers and the implementation to call back to the application for events of interest to the application.Using the
VK_EXT_debug_report
extension allows an application to register multiple callbacks with the validation layers. Some callbacks may log the information to a file, others may cause a debug break point or other application defined behavior. An application can register callbacks even when no validation layers are enabled, but they will only be called for loader and, if implemented, driver events.To capture issues found while creating an instance an application can link a
VkDebugReportCallbackCreateInfoEXT
structure to thepNext
element of theVkInstanceCreateInfo
structure given toCreateInstance
. This callback is only valid for the duration of thevkCreateInstance
call. UseCreateDebugReportCallbackEXT
to create persistent callback objects.
-
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static int
vkCreateDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackCreateInfoEXT pCreateInfo, VkAllocationCallbacks pAllocator, long[] pCallback)
Array version of:CreateDebugReportCallbackEXT
static int
vkCreateDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackCreateInfoEXT pCreateInfo, VkAllocationCallbacks pAllocator, java.nio.LongBuffer pCallback)
Registers a callback.static void
vkDebugReportMessageEXT(VkInstance instance, int flags, int objectType, long object, long location, int messageCode, java.nio.ByteBuffer pLayerPrefix, java.nio.ByteBuffer pMessage)
Injects a custom message into the debug stream.static void
vkDebugReportMessageEXT(VkInstance instance, int flags, int objectType, long object, long location, int messageCode, java.lang.CharSequence pLayerPrefix, java.lang.CharSequence pMessage)
Injects a custom message into the debug stream.static void
vkDestroyDebugReportCallbackEXT(VkInstance instance, long callback, VkAllocationCallbacks pAllocator)
Destroys aVkDebugReportCallbackEXT
.
-
-
-
Field Detail
-
VK_EXT_DEBUG_REPORT_SPEC_VERSION
public static final int VK_EXT_DEBUG_REPORT_SPEC_VERSION
The extension specification version.- See Also:
- Constant Field Values
-
VK_EXT_DEBUG_REPORT_EXTENSION_NAME
public static final java.lang.String VK_EXT_DEBUG_REPORT_EXTENSION_NAME
The extension name.- See Also:
- Constant Field Values
-
VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT
public static final int VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT
VkStructureType- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT
public static final int VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT
VkDebugReportObjectTypeEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_ERROR_NONE_EXT
public static final int VK_DEBUG_REPORT_ERROR_NONE_EXT
VkDebugReportErrorEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT
public static final int VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT
VkDebugReportErrorEXT- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_INFORMATION_BIT_EXT
public static final int VK_DEBUG_REPORT_INFORMATION_BIT_EXT
Indicates an informational message such as resource details that may be handy when debugging an application.- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_WARNING_BIT_EXT
public static final int VK_DEBUG_REPORT_WARNING_BIT_EXT
Indicates an unexpected use.E.g. Not destroying objects prior to destroying the containing object or potential inconsistencies between descriptor set layout and the layout in the corresponding shader, etc.
- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT
public static final int VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT
Indicates a potentially non-optimal use of Vulkan.E.g. using
vkCmdClearImage
when a RenderPassload_op
would have worked.- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_ERROR_BIT_EXT
public static final int VK_DEBUG_REPORT_ERROR_BIT_EXT
Indicates an error that may cause undefined results, including an application crash.- See Also:
- Constant Field Values
-
VK_DEBUG_REPORT_DEBUG_BIT_EXT
public static final int VK_DEBUG_REPORT_DEBUG_BIT_EXT
Indicates diagnostic information from the loader and layers.- See Also:
- Constant Field Values
-
VK_ERROR_VALIDATION_FAILED_EXT
public static final int VK_ERROR_VALIDATION_FAILED_EXT
VkResult- See Also:
- Constant Field Values
-
-
Method Detail
-
vkCreateDebugReportCallbackEXT
public static int vkCreateDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackCreateInfoEXT pCreateInfo, VkAllocationCallbacks pAllocator, java.nio.LongBuffer pCallback)
Registers a callback.For each
VkDebugReportCallbackEXT
that is created the flags determine when that function is called.A callback will be made for issues that match any bit set in its flags. The callback will come directly from the component that detected the event, unless some other layer intercepts the calls for its own purposes (filter them in different way, log to system error log, etc.)
An application may receive multiple callbacks if multiple
VkDebugReportCallbackEXT
objects were created. A callback will always be executed in the same thread as the originating Vulkan call. A callback may be called from multiple threads simultaneously (if the application is making Vulkan calls from multiple threads).Valid Usage
instance
must be a validVkInstance
handlepCreateInfo
must be a pointer to a validVkDebugReportCallbackCreateInfoEXT
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure pCallback
must be a pointer to aVkDebugReportCallbackEXT
handle
- Parameters:
instance
- the instance the callback will be logged onpCreateInfo
- points to aVkDebugReportCallbackCreateInfoEXT
structure which defines the conditions under which this callback will be calledpAllocator
- controls host memory allocationpCallback
- a pointer to record the sname:VkDebugReportCallbackEXT object created
-
vkDestroyDebugReportCallbackEXT
public static void vkDestroyDebugReportCallbackEXT(VkInstance instance, long callback, VkAllocationCallbacks pAllocator)
Destroys aVkDebugReportCallbackEXT
.Valid Usage
instance
must be a validVkInstance
handlecallback
must be a validVkDebugReportCallbackEXT
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure callback
must have been created, allocated or retrieved frominstance
- If
VkAllocationCallbacks
were provided wheninstance
was created, a compatible set of callbacks must be provided here - If no
VkAllocationCallbacks
were provided wheninstance
was created,pAllocator
must beNULL
Host Synchronization
- Host access to
callback
must be externally synchronized
- Parameters:
instance
- the instance where the callback was createdcallback
- theVkDebugReportCallbackEXT
object to destroypAllocator
- controls host memory allocation
-
vkDebugReportMessageEXT
public static void vkDebugReportMessageEXT(VkInstance instance, int flags, int objectType, long object, long location, int messageCode, java.nio.ByteBuffer pLayerPrefix, java.nio.ByteBuffer pMessage)
Injects a custom message into the debug stream.Valid Usage
instance
must be a validVkInstance
handleflags
must be a valid combination ofVkDebugReportFlagBitsEXT
valuesflags
must not be 0objectType
must be a validVkDebugReportObjectTypeEXT
valuepLayerPrefix
must be a pointer to a validpMessage
must be a pointer to a validinstance
must be a validVkInstance
handleflags
must be a combination of one or more ofVkDebugReportFlagBitsEXT
objType
must be one ofVkDebugReportObjectTypeEXT
,DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT
ifobject
isNULL
object
may be a {apiname} objectpLayerPrefix
must be aNULL
terminated string.pMsg
must be aNULL
terminated string.
The call will propagate through the layers and cause a callback to the application. The parameters are passed on to the callback in addition to the
pUserData
value that was defined at the time the callback was registered.- Parameters:
instance
- the instance the callback will be logged onflags
- indicates theVkDebugReportFlagBitsEXT
that triggered this callback. One of:DEBUG_REPORT_INFORMATION_BIT_EXT
DEBUG_REPORT_WARNING_BIT_EXT
DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT
DEBUG_REPORT_ERROR_BIT_EXT
DEBUG_REPORT_DEBUG_BIT_EXT
objectType
- the type of object being used / created at the time the event was triggered. One of:object
- the object where the issue was detected.object
may beNULL_HANDLE
if there is no object associated with the event.location
- a component (layer, driver, loader) defined value that indicates the "location" of the trigger. This is an optional value.messageCode
- a layer defined value indicating what test triggered this callbackpLayerPrefix
- abbreviation of the component making the callbackpMessage
- a null terminated string detailing the trigger conditions
-
vkDebugReportMessageEXT
public static void vkDebugReportMessageEXT(VkInstance instance, int flags, int objectType, long object, long location, int messageCode, java.lang.CharSequence pLayerPrefix, java.lang.CharSequence pMessage)
Injects a custom message into the debug stream.Valid Usage
instance
must be a validVkInstance
handleflags
must be a valid combination ofVkDebugReportFlagBitsEXT
valuesflags
must not be 0objectType
must be a validVkDebugReportObjectTypeEXT
valuepLayerPrefix
must be a pointer to a validpMessage
must be a pointer to a validinstance
must be a validVkInstance
handleflags
must be a combination of one or more ofVkDebugReportFlagBitsEXT
objType
must be one ofVkDebugReportObjectTypeEXT
,DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT
ifobject
isNULL
object
may be a {apiname} objectpLayerPrefix
must be aNULL
terminated string.pMsg
must be aNULL
terminated string.
The call will propagate through the layers and cause a callback to the application. The parameters are passed on to the callback in addition to the
pUserData
value that was defined at the time the callback was registered.- Parameters:
instance
- the instance the callback will be logged onflags
- indicates theVkDebugReportFlagBitsEXT
that triggered this callback. One of:DEBUG_REPORT_INFORMATION_BIT_EXT
DEBUG_REPORT_WARNING_BIT_EXT
DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT
DEBUG_REPORT_ERROR_BIT_EXT
DEBUG_REPORT_DEBUG_BIT_EXT
objectType
- the type of object being used / created at the time the event was triggered. One of:object
- the object where the issue was detected.object
may beNULL_HANDLE
if there is no object associated with the event.location
- a component (layer, driver, loader) defined value that indicates the "location" of the trigger. This is an optional value.messageCode
- a layer defined value indicating what test triggered this callbackpLayerPrefix
- abbreviation of the component making the callbackpMessage
- a null terminated string detailing the trigger conditions
-
vkCreateDebugReportCallbackEXT
public static int vkCreateDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackCreateInfoEXT pCreateInfo, VkAllocationCallbacks pAllocator, long[] pCallback)
Array version of:CreateDebugReportCallbackEXT
-
-