Commit Graph

6907 Commits

Author SHA1 Message Date
baldurk d6b6fcf2c1 Only export NULLs if something actually went wrong! 2018-02-02 16:09:24 +00:00
baldurk 0d1d7c482b Manually support fetching thumbnails from old captures
* This is just for the thumbnail preview where we still want to be able
  to display the thumbnail for old captures even if we can't open them
  directly.
2018-02-02 16:09:23 +00:00
baldurk 84ea588036 Move android support files into /plugins/android/ in the build
* We also don't copy out of the android SDK anymore as that has a
  licensing impact. Instead we ship our own builds from a local AOSP
  checkout, the same way as other plugins.
2018-02-01 20:21:50 +00:00
Jasper St. Pierre 2dd9531199 Fix GLSL shader editing
The "files" system expects other files to be #included, which won't make
sense for GLSL sources, which are expected to be concatenated. Use the
concatenated string as a single "main.glsl" file.
2018-02-01 19:55:48 +00:00
baldurk 427a89db0b Create parent directory for file transfers to remote server 2018-02-01 18:25:31 +00:00
baldurk f5aa915f3f Require explicit opt-in for interceptor-lib use, in case of local llvm
* CMake can find the local LLVM even without specifying LLVM_DIR, but
  we don't want to build it for interceptor-lib unless it's exactly the
  one we want, so we ask for explicit opt-in.
2018-02-01 18:25:30 +00:00
baldurk 26c6456c8e Don't query GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS if no subroutines
* Works around some mesa debug message spam if no subroutines exist.
2018-02-01 18:25:30 +00:00
baldurk bf457be9f1 Make sure to check created context during replay on linux/android 2018-02-01 18:25:30 +00:00
baldurk 4733a43d00 Optimise rendering and combining of many pips in timeline bar 2018-02-01 18:25:30 +00:00
michaelrgb 3d2bc2cdc9 Remove VK_IMAGE_USAGE_TRANSIENT to fix preparing initial state.
On some drivers vkCmdCopyImageToBuffer will crash if we sample from
transient images. The spec also forbids using it with USAGE_SAMPLED_BIT.
2018-02-01 14:01:13 +00:00
baldurk 6316a9747d Add missing Qt include 2018-02-01 00:25:05 +00:00
baldurk 7dc1c4f344 Fix clang-format issue that somehow snuck past commit filters 2018-01-31 23:18:50 +00:00
baldurk 5cda6a8d65 Refactor hook populating out to separate from context checking
* On EGL we want to populate our hooks immediately so we have them ready
  before anything is used, and it's valid because eglGetProcAddress is
  spec'd to return function pointers that can be used with any context.
* Then later when we have a context we can check extensions and emulate.
2018-01-31 22:08:16 +00:00
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