public void DestroyDebugReportCallbackEXT(DebugReportCallbackExt callback, AllocationCallbacks pAllocator = null)
 {
     unsafe
     {
         vkDestroyDebugReportCallbackEXT(this.m, callback != null ? callback.m : default(UInt64), pAllocator != null ? pAllocator.m : null);
     }
 }
Ejemplo n.º 2
0
        public void EnableDebug(DebugReportCallback d, DebugReportFlagsExt flags = DebugReportFlagsExt.Debug | DebugReportFlagsExt.Error | DebugReportFlagsExt.Information | DebugReportFlagsExt.PerformanceWarning | DebugReportFlagsExt.Warning)
        {
            if (vkCreateDebugReportCallbackEXT == null)
            {
                throw new InvalidOperationException("vkCreateDebugReportCallbackEXT is not available, possibly you might be missing VK_EXT_debug_report extension. Try to enable it when creating the Instance.");
            }

            var debugCreateInfo = new DebugReportCallbackCreateInfoExt()
            {
                Flags       = flags,
                PfnCallback = Marshal.GetFunctionPointerForDelegate(d)
            };

            if (debugCallback != null)
            {
                DestroyDebugReportCallbackEXT(debugCallback);
            }
            debugCallback = CreateDebugReportCallbackEXT(debugCreateInfo);
        }
        public DebugReportCallbackExt CreateDebugReportCallbackEXT(DebugReportCallbackCreateInfo pCreateInfo, AllocationCallbacks pAllocator = null)
        {
            Result result;
            DebugReportCallbackExt pCallback;

            unsafe
            {
                pCallback = new DebugReportCallbackExt();

                fixed(UInt64 *ptrpCallback = &pCallback.m)
                {
                    result = vkCreateDebugReportCallbackEXT(this.m, pCreateInfo != null ? pCreateInfo.m : (Interop.DebugReportCallbackCreateInfoExt *) default(IntPtr), pAllocator != null ? pAllocator.m : null, ptrpCallback);
                }

                if (result != Result.Success)
                {
                    throw new ResultException(result);
                }

                return(pCallback);
            }
        }