Commit Graph

6894 Commits

Author SHA1 Message Date
baldurk 29f5d7e53d Update file selection whenever an item is selected, not just clicked.
* This catches when you use typing to find an item, or select with the
  arrow keys.
2018-01-31 21:08:24 +00:00
baldurk edb85d834e Check for errors when invoking AMD DXBC disassembler 2018-01-31 21:03:10 +00:00
baldurk c744638471 Check for LLVM 4.0 specifically - don't compile against 5.0 2018-01-31 19:46:36 +00:00
baldurk 1e52a57a25 Fix library linking on X11 and pthreads 2018-01-31 18:57:02 +00:00
baldurk 77569fa75d Patch checkerboard.frag for GLES compat (input/output precise match) 2018-01-31 18:24:17 +00:00
baldurk 627d23b937 Recreate proxy preview window if it's out of date 2018-01-31 18:24:16 +00:00
baldurk 2147cb0b9f Create and destroy PThreadLocks globally
* If we destroy them at the end of android_main we might destroy them
  while the thread is running and cause incorrect code flows where we
  try to join and restart the thread while it's blocking.
* Don't get me started on why android_main exits when you get alt-tabbed
  away from...
2018-01-31 18:24:15 +00:00
baldurk b7e6d33f0f Fix incorrect size check (checking string length instead of line count) 2018-01-31 18:24:14 +00:00
baldurk 4a6462b63b Compile in interceptor-lib if LLVM is found, and use to hook on android
* Note we still have to use PLT hooking for android_dlopen_ext that
  libvulkan uses to load layers, since interceptor-lib can't hook that,
  and otherwise libvulkan will load our library multiple times into the
  process instead of re-using the existing injected library.
2018-01-31 18:24:14 +00:00
baldurk addc95d790 Compile posix_libentry into a static library to ensure it's linked last
* If we want our global constructor to run after even static linked
  libaries (which we will soon for LLVM) then we must make it a static
  library as well. We do some tricks to ensure the symbols are still
  pulled in even though it's otherwise "unused".
2018-01-31 18:24:13 +00:00
baldurk 64c9e93831 Commit interceptor-lib from GAPID @ 9492539f1
* This library will be used to replace the PLT hooking for most core
  functions, and is generally more reliable. It still fails in some
  cases though when the target function is not patchable.
* To build, it requires LLVM. See README.md for instructions on building
  a compatible LLVM for use.
2018-01-31 18:24:12 +00:00
baldurk b7aa522769 Wait for the API to be presenting before android package is "started"
* This closely resembles the behaviour before, when at least for vulkan
  the library wouldn't be loaded and open the connection until the
  instance is created and the layer is loaded.
* When injecting our libraries, the connection is made very early but it
  may be some time before the program initialises vulkan - we can't
  setprop debug.vulkan.layers back to empty until it has, so instead we
  wait for the API to be presenting.
2018-01-31 14:39:06 +00:00
baldurk 1778e4028d Don't do any injection if the library is already present
* We assume that if the user injected libVkLayer_GLES_RenderDoc.so then
  it's either a vulkan app and that's sufficient, or they linked
  against it.
* Injecting our libraries over the top of that could cause problems -
  at worst crashes, or at best we could end up with nested hooking with
  double overhead, or the loaded renderdoc library won't be the one that
  hooks and the workflow will break.
2018-01-31 14:36:56 +00:00
baldurk 969fdaa499 Add the ability to patch android binary XML manifests in-place
* This lets us add the debuggable flag we need, at the cost of needing
  to re-sign the APK. It works in many cases although sometimes it does
  fail - but this is provided just as a 'best effort' and not as a
  recommended workflow.
2018-01-29 22:37:55 +00:00
baldurk 83d921ea84 Install if we don't have all the server ABIs correctly 2018-01-29 22:22:26 +00:00
baldurk b3d5704809 Don't try to make package debuggable if remote server has disconnected 2018-01-29 18:02:23 +00:00
baldurk 06267312a2 Fix android hooks accidentally marking libraries processed too soon 2018-01-29 18:01:28 +00:00
baldurk 280fe9ade2 clang compile fix - add braces around initialisation of union 2018-01-26 22:15:59 +00:00
baldurk ec7b2807d0 Build each architecture into its own APK
* This means we can have all the architectures we care about installed,
  and load the right library regardless of what the app does.
2018-01-26 21:19:16 +00:00
baldurk 077402bf11 Add failsafe so we don't wait the whole timeout if an apk closes/crashes 2018-01-26 21:19:15 +00:00
baldurk 79f3f54b84 Add a spinner progress bar while running remote server command 2018-01-26 21:19:15 +00:00
baldurk cb34a2daea Revamp android patching to only check for (& change) the debuggable flag
* We don't consider anything else, this includes permissions or the
  library being present. Since we no longer expect to patch in the
  library we also don't check its version (however we leave the tag in
  case it is useful in the future).
* If the user has root access we will never warn, assuming the injection
  will work fine even without the debuggable flag.
2018-01-26 21:19:14 +00:00
baldurk a019797f88 Move vulkan layer name and android library filename to global defines 2018-01-26 21:19:13 +00:00
baldurk 047bff7261 Add an new android hooking method using JDWP to inject & PLT hooks
* This is based on the GAPID method of injection, using the same steps
  to connect with JDWP and debug the application, breakpointing on key
  init-time steps to patch vulkan layer search paths and load libraries
  from our installed apk.
* We diverge by then using PLT hooks instead of trampolines to hook the
  EGL/GL calls - and so we also hook dlopen.
* This should work on any debuggable application - not currently checked
  but does not replace/break any of the previous injection, which can
  still work.
2018-01-26 21:19:13 +00:00
baldurk ec71b05173 Split out android patching code into separate file 2018-01-26 16:30:47 +00:00
baldurk 5527c57e68 Split out some miscellaneous utility functions
* We also wrap up and cache the fetching of friendly names by serial
  number to avoid some adb traffic.
2018-01-26 16:30:16 +00:00
baldurk 1be3e8bfac Split out handling of android tools: locating&precedence, executing, etc 2018-01-26 16:24:54 +00:00
baldurk ae7300e524 Move android files to separate subfolder 2018-01-26 15:49:09 +00:00
baldurk b22f93f458 Avoid remote server timing out if starting android packages.
* Android::StartAndroidPackageForCapture can take a long time, and we
  want to preserve the connection, so we spin up a temporary thread to
  continually Ping().
2018-01-26 15:42:15 +00:00
baldurk 643db8042b Tweak live capture again - feels more natural with buttons on the right 2018-01-26 15:33:18 +00:00
baldurk 24db8dbffc Add an 'internal' flag when launching processes, to reduce log spam 2018-01-26 15:33:17 +00:00
baldurk ddb8e76add Add EndianSwap function using platform intrinsics 2018-01-26 15:33:17 +00:00
baldurk 6614c37440 fix compilation on linux/android 2018-01-26 00:55:36 +00:00
baldurk 9c247a87ae Fix check that was precisely backwards. Caught by unit tests! 2018-01-26 00:06:53 +00:00
baldurk 64dd86c332 Don't set Vulkan as active API when we're calling D3D12... 2018-01-25 19:47:42 +00:00
baldurk 503fd1a858 Adjust padding in LiveCapture dialog 2018-01-25 18:55:54 +00:00
baldurk b17790e5c2 Batch vulkan initial state related allocations together
* We allocate chunks of 32MB - 256MB then suballocate as needed.
2018-01-25 18:18:47 +00:00
baldurk d452230782 Refactor resource manager initial content data to be driver-specific
* This allows more flexible construction of what params/resources need
  to be saved with initial contents data, as well as allowing better
  type safety where possible by using driver-specific types for the
  stored data.
* Especially it tidies up the ugly 'all data that tags along must be
  a written into a single allocated byte pointer'.
* The initial content struct is responsible for destroying itself and
  freeing any data.
2018-01-25 15:30:20 +00:00
baldurk 6fdc2a011c Don't query status of non-existant shader with glCreateShaderProgramv
* In glCreateShaderProgramv there is no shader object, so we pass 0, so
  we just treat this as implicitly successfully compiled.
2018-01-25 15:24:40 +00:00
baldurk 736d991d6a Pass configuration parameters to ResourceManager in struct
* Otherwise adding new parameters becomes impractical
2018-01-25 11:30:25 +00:00
baldurk 0268ba8b66 Don't read from char[] string in writing mode 2018-01-25 10:48:56 +00:00
baldurk ad841a0341 Add a limit for warning on unknown GUID QueryInterface calls 2018-01-25 10:36:16 +00:00
baldurk fb0772b828 Android internal compiler error fix 2018-01-25 10:09:05 +00:00
baldurk 8d265284ee Add some python valgrind suppressions 2018-01-24 22:52:31 +00:00
baldurk a159af9cfe Fix overrunning vector bounds if vertex attributes use high locations 2018-01-24 22:52:25 +00:00
baldurk 77f767394b Remove invariant decorations in vulkan PostVS vertex->compute transform 2018-01-24 18:44:26 +00:00
baldurk 904511afb0 Support composite types on vertex shader inputs, in vulkan PostVS fetch 2018-01-24 18:44:15 +00:00
baldurk 7636d370f4 Don't give patched entry point a debug name, as it breaks amdvlk 2018-01-24 17:12:23 +00:00
baldurk 158dff0287 Remove test code, committed by accident. 2018-01-24 16:15:49 +00:00
baldurk 8f405a2197 Render mesh data with instanced properties correctly. 2018-01-24 16:14:22 +00:00