# We don't care about problems in the ICD or loader
# Many of these could be false positives, since valgrind doesn't know about GPU access
{
  IntelVulkanAddr8
  Memcheck:Addr8
  ...
  obj:*libvulkan_intel.so*
}
{
  IntelVulkanAddr4
  Memcheck:Addr4
  ...
  obj:*libvulkan_intel.so*
}
{
  IntelVulkanAddr2
  Memcheck:Addr2
  ...
  obj:*libvulkan_intel.so*
}
{
  IntelVulkanAddr1
  Memcheck:Addr1
  ...
  obj:*libvulkan_intel.so*
}
{
  IntelVulkanCond
  Memcheck:Cond
  ...
  obj:*libvulkan_intel.so*
}
{
  IntelVulkanValue8
  Memcheck:Value8
  ...
  obj:*libvulkan_intel.so*
}
{
  IntelVulkanLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  obj:*libvulkan_intel.so*
}
{
  VulkanLoaderLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  obj:*libvulkan.so*
}
{
  MesaCond
  Memcheck:Cond
  ...
  obj:*libGLX_mesa.so*
}
{
  MesaCond
  Memcheck:Cond
  ...
  fun:__glXInitialize
}
{
  LLVMCond
  Memcheck:Cond
  ...
  obj:*libLLVM*.so*
}
{
  XcbLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  obj:*libxcb.so*
}
{
  XcbLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  obj:*radeonsi_dri.so*
}

# Qt
{
  QtAccessibilityLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  fun:_ZN11QAccessible19updateAccessibilityEP16QAccessibleEvent
}
{
  ExpatLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  obj:*libexpat.so*
}
{
  DBusLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  obj:*libdbus-1.so*
}
{
  GTKLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  obj:*libgtk-3.so*
}
{
  ResourcesLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  fun:_ZN9Resources10InitialiseEv
}
{
   QtPostEventLeak
   Memcheck:Leak
   match-leak-kinds: all
   ...
   fun:_ZN16QCoreApplication9postEventEP7QObjectP6QEventi
   fun:_ZN13ReplayManager11CloseThreadEv
}
{
   QtThreadFinishedLeak
   Memcheck:Leak
   match-leak-kinds: all
   ...
   fun:_ZN11QMetaObject8activateEP7QObjectiiPPv
   fun:_ZN7QThread8finishedENS_14QPrivateSignalE
}

# There's an invalid read in PCRE2 where it seems to do a wide load beyond the string
# It's not a real bug, and unfortunately we have to be reasonably general with the
# suppression to catch it in JIT'd code.
{
	PCRE2 JIT wide loads
	Memcheck:Addr16
	obj:???
}
{
	PCRE2 JIT wide loads
	Memcheck:Cond
	obj:???
}

# Python
{
  PythonLeak
  Memcheck:Leak
  match-leak-kinds: all
  ...
  obj:*libpython*.so*
}
{
  PythonRead
  Memcheck:Addr4
  ...
  obj:*libpython*.so*
}
{
  PythonRead
  Memcheck:Value8
  ...
  obj:*libpython*.so*
}
{
  PythonRead
  Memcheck:Cond
  ...
  obj:*libpython*.so*
}

# Unknown cause but not important leak
{
  UnknownLeak1
  Memcheck:Leak
  match-leak-kinds: all
  fun:malloc
  ...
  fun:_dl_init
}

# Try to suppress only access from mapped pointers, to avoid false negatives
{
  InitialStateMemcpy
  Memcheck:Addr8
  fun:memcpy@@GLIBC_2.14
  ...
  fun:_ZN13WrappedVulkan22Serialise_InitialStateE10ResourceIdP12WrappedVkRes
}
{
  InitialStateMemcpy
  Memcheck:Addr4
  fun:memcpy@@GLIBC_2.14
  ...
  fun:_ZN13WrappedVulkan22Serialise_InitialStateE10ResourceIdP12WrappedVkRes
}
{
  InitialStateMemcpy
  Memcheck:Addr2
  fun:memcpy@@GLIBC_2.14
  ...
  fun:_ZN13WrappedVulkan22Serialise_InitialStateE10ResourceIdP12WrappedVkRes
}
{
  InitialStateMemcpy
  Memcheck:Addr1
  fun:memcpy@@GLIBC_2.14
  ...
  fun:_ZN13WrappedVulkan22Serialise_InitialStateE10ResourceIdP12WrappedVkRes
}
{
  DebugInitMemcpy
  Memcheck:Addr8
  fun:memcpy@@GLIBC_2.14
  fun:_ZN18VulkanDebugManagerC1EP13WrappedVulkanP10VkDevice_T
}
{
  UnmapMemcpy
  Memcheck:Addr8
  fun:memcpy@@GLIBC_2.14
  fun:_ZN13WrappedVulkan23Serialise_vkUnmapMemoryEP10SerialiserP10VkDevice_TP16VkDeviceMemory_T
}
{
  UnmapMemcpy
  Memcheck:Addr4
  fun:memcpy@@GLIBC_2.14
  fun:_ZN13WrappedVulkan23Serialise_vkUnmapMemoryEP10SerialiserP10VkDevice_TP16VkDeviceMemory_T
}
{
  UnmapMemcpy
  Memcheck:Addr2
  fun:memcpy@@GLIBC_2.14
  fun:_ZN13WrappedVulkan23Serialise_vkUnmapMemoryEP10SerialiserP10VkDevice_TP16VkDeviceMemory_T
}
{
  UnmapMemcpy
  Memcheck:Addr1
  fun:memcpy@@GLIBC_2.14
  fun:_ZN13WrappedVulkan23Serialise_vkUnmapMemoryEP10SerialiserP10VkDevice_TP16VkDeviceMemory_T
}
{
  FlushMemcpy
  Memcheck:Addr8
  fun:memcpy@@GLIBC_2.14
  fun:_ZN13WrappedVulkan35Serialise_vkFlushMappedMemoryRangesEP10SerialiserP10VkDevice_TjPK19VkMappedMemoryRange
}
{
  FlushMemcpy
  Memcheck:Addr4
  fun:memcpy@@GLIBC_2.14
  fun:_ZN13WrappedVulkan35Serialise_vkFlushMappedMemoryRangesEP10SerialiserP10VkDevice_TjPK19VkMappedMemoryRange
}
{
  FlushMemcpy
  Memcheck:Addr2
  fun:memcpy@@GLIBC_2.14
  fun:_ZN13WrappedVulkan35Serialise_vkFlushMappedMemoryRangesEP10SerialiserP10VkDevice_TjPK19VkMappedMemoryRange
}
{
  FlushMemcpy
  Memcheck:Addr1
  fun:memcpy@@GLIBC_2.14
  fun:_ZN13WrappedVulkan35Serialise_vkFlushMappedMemoryRangesEP10SerialiserP10VkDevice_TjPK19VkMappedMemoryRange
}
{
  GetTextureDataMemcpy
  Memcheck:Addr8
  fun:memcpy@@GLIBC_2.14
  fun:_ZN12VulkanReplay14GetTextureDataE10ResourceIdjj19FormatComponentTypebbffRm
}
{
  GetTextureDataMemcpy
  Memcheck:Addr4
  fun:memcpy@@GLIBC_2.14
  fun:_ZN12VulkanReplay14GetTextureDataE10ResourceIdjj19FormatComponentTypebbffRm
}
{
  GetTextureDataMemcpy
  Memcheck:Addr2
  fun:memcpy@@GLIBC_2.14
  fun:_ZN12VulkanReplay14GetTextureDataE10ResourceIdjj19FormatComponentTypebbffRm
}
{
  GetTextureDataMemcpy
  Memcheck:Addr1
  fun:memcpy@@GLIBC_2.14
  fun:_ZN12VulkanReplay14GetTextureDataE10ResourceIdjj19FormatComponentTypebbffRm
}
{
  GetBufferDataMemcpy
  Memcheck:Addr8
  fun:memcpy@@GLIBC_2.14
  fun:_ZN18VulkanDebugManager13GetBufferDataE10ResourceIdmmRSt6vectorIhSaIhEE
}
{
  GetBufferDataMemcpy
  Memcheck:Addr4
  fun:memcpy@@GLIBC_2.14
  fun:_ZN18VulkanDebugManager13GetBufferDataE10ResourceIdmmRSt6vectorIhSaIhEE
}
{
  GetBufferDataMemcpy
  Memcheck:Addr2
  fun:memcpy@@GLIBC_2.14
  fun:_ZN18VulkanDebugManager13GetBufferDataE10ResourceIdmmRSt6vectorIhSaIhEE
}
{
  GetBufferDataMemcpy
  Memcheck:Addr1
  fun:memcpy@@GLIBC_2.14
  fun:_ZN18VulkanDebugManager13GetBufferDataE10ResourceIdmmRSt6vectorIhSaIhEE
}
{
  InitPostVSDataMemcpy
  Memcheck:Addr8
  fun:memcpy@@GLIBC_2.14
  fun:_ZN18VulkanDebugManager17InitPostVSBuffersEj
}
{
  InitPostVSDataMemcpy
  Memcheck:Addr4
  fun:memcpy@@GLIBC_2.14
  fun:_ZN18VulkanDebugManager17InitPostVSBuffersEj
}
{
  InitPostVSDataMemcpy
  Memcheck:Addr2
  fun:memcpy@@GLIBC_2.14
  fun:_ZN18VulkanDebugManager17InitPostVSBuffersEj
}
{
  InitPostVSDataMemcpy
  Memcheck:Addr1
  fun:memcpy@@GLIBC_2.14
  fun:_ZN18VulkanDebugManager17InitPostVSBuffersEj
}
# We read from mapped memory here rather than just memcpy'ing, have to suppress the whole thing
# near/far calculations
{
  InitPostVSDataRead
  Memcheck:Addr4
  fun:_ZN18VulkanDebugManager17InitPostVSBuffersEj
}
# manual depth/stencil packing
{
  InitPostVSDataRead
  Memcheck:Addr4
  fun:_ZN12VulkanReplay14GetTextureDataE10ResourceIdjj19FormatComponentTypebbffRm
}
{
  InitPostVSDataRead
  Memcheck:Addr2
  fun:_ZN12VulkanReplay14GetTextureDataE10ResourceIdjj19FormatComponentTypebbffRm
}
{
  InitPostVSDataRead
  Memcheck:Addr1
  fun:_ZN12VulkanReplay14GetTextureDataE10ResourceIdjj19FormatComponentTypebbffRm
}

# This seems to just be an implementation detail that allocates error messages
{
  dlerrorLeak
  Memcheck:Leak
  fun:calloc
  fun:_dlerror_run
  ...
}

{
  dlinitLeak
  Memcheck:Leak
  match-leak-kinds: reachable
  fun:_Znwm
  fun:__cxx_global_var_init
  ...
}

# No shutdown function for XinitThreads, so ignore it leaking
{
  XInitThreadsLeak
  Memcheck:Leak
  fun:malloc
  fun:XInitThreads
  ...
}

# Temporary leak - to be fixed, but has to happen upstream
{
  glslangLeaks
  Memcheck:Leak
  match-leak-kinds: all
  ...
  fun:_Z17InitSPIRVCompilerv
}

# These are deliberate leaks, only once per program run, or once per API load
{
  GlobalLogfileString
  Memcheck:Leak
  match-leak-kinds: reachable
  fun:_Znwm
  fun:_ZL7logfilev
}
{
  GlobalLogfileString2
  Memcheck:Leak
  match-leak-kinds: reachable
  fun:_Znwm
  ...
  fun:_Z15rdclog_filenamePKc
}
{
  GlobalLogfileString3
  Memcheck:Leak
  match-leak-kinds: reachable
  fun:malloc
  ...
  fun:_Z15rdclog_filenamePKc
}
{
  GlobalLogfileLock
  Memcheck:Leak
  match-leak-kinds: reachable
  fun:_Znwm
  fun:_Z13rdclog_directlj7LogTypePKcS1_jS1_z
}
{
  GlobalLogfileLock2
  Memcheck:Leak
  match-leak-kinds: reachable
  fun:_Znwm
  fun:_Z15rdclogprint_int7LogTypePKcS1_
}
{
  LoadVulkanModule
  Memcheck:Leak
  match-leak-kinds: reachable
  ...
  fun:_ZN7Process10LoadModuleEPKc
  fun:_Z25Vulkan_CreateReplayDevicePKcPP13IReplayDriver
}
{
	ConfigStrings
	Memcheck:Leak
  match-leak-kinds: all
  ...
  fun:_ZN9RenderDoc13ProcessConfigEv
}
