Commit Graph

342 Commits

Author SHA1 Message Date
baldurk 6e3a0201a8 Determine python version from python module directly 2026-03-13 13:07:44 +00:00
Chia-I Wu 8552eec7a1 Fix android compile errors on NDK 27+
ALooper_pollAll was obsoleted since NDK 27 and resulted in

  renderdoccmd_android.cpp:526:8: error: 'ALooper_pollAll' is
  unavailable: obsoleted in Android 1 - ALooper_pollAll may ignore
  wakes. Use ALooper_pollOnce instead. See The API documentation for
  more information

Since we poll from within a loop, we can replace it by ALooper_pollOnce
directly. But to be on the safe side, do this only on NDK 27+.
2026-02-01 03:15:38 +09:00
Chia-I Wu 4f0e117359 Fix android compile errors on JDK 20+
Java 7 support was dropped since JDK 20. We should be able to target
Java 8 without compatibility concerns because we run the bytecode
through dex which desugars (or fails at build time which does not
happen). But to be on the safe side, print a warning.
2026-02-01 03:15:38 +09:00
baldurk 856c838def Update copyright years to 2026 and fix copyright ranges
* In a previous update in 2021 many copyright ranges were truncated
  accidentally, and some files have been copy-pasted with wrong years. These
  dates have been fixed based on git history and original copyright messages.
2026-01-05 14:17:28 +00:00
David McFarland d26f634aeb Pass -rdynamic to renderdoccmd link
This ensures replay marker sym is exported, and matches qrenderdoc.
2025-11-27 20:11:34 +09:00
baldurk 9bfcb76e0b Try to de-elevate after applying an update to not run UI as admin 2025-07-31 17:10:14 +01:00
baldurk 2322e165de Update copyright years to 2025 2025-03-14 18:54:37 +00:00
baldurk 1a6f62cecf Workaround new windows SDK not compiling on VS2015 2025-02-19 13:35:51 +00:00
Aliya Pazylbekova 9ebd796cd8 Remove GGP support 2024-07-08 14:19:42 +01:00
yudong 4725b73181 use NoTitleBar style to prevent crash on HarmonyOS devices 2024-05-22 11:29:51 +01:00
Jacob Thomas 7e976c04a8 Fix 'android-<version>.jar' search path on MacOS
The renderdoccmd android build assumes all files in '${ANDROID_SDK_ROOT_PATH}/platforms' are valid 'android-<version>.jar' platform libraries. Unfortunately because MacOS litters its directories with metadata files called .DS_Store, that file actually wins this sorting logic and is incorrectly selected.
This fixes the lib search logic to only consider android libraries.
2024-04-15 16:18:15 +01:00
baldurk 9f4f0e6aa1 Update copyright years to 2024 2024-02-12 11:04:52 +00:00
Er2 dcbbcee6a8 Add some fixes. 2023-11-06 14:42:45 +00:00
Er2 86cb3ebf80 Add FreeBSD operating system support. 2023-11-06 14:42:45 +00:00
baldurk 4d180b300f Fix missing include for some android SDKs 2023-10-13 10:36:37 +01:00
baldurk b25253a83c Fade android logo every 45 minutes to avoid burn-in 2023-10-12 17:55:18 +01:00
baldurk 9d39b8e1a8 Reformat code for clang-format 15 2023-09-05 11:02:08 +01:00
baldurk 7c1164e060 Tidy up and implement support for self capture on linux 2023-07-31 15:45:32 +01:00
baldurk 0f851df6c2 Batch prepare and allow limited buffering for vulkan initial states
* We add a capture option that defines a soft limit we aim to keep under for
  memory overhead during capture, excess initial states after that will be
  stored temporarily on disk.
2023-06-02 18:53:45 +01:00
baldurk d47e79ae07 Update copyright years to 2023 2023-02-01 12:23:32 +00:00
baldurk 3f9bf1ab27 Fix crash handler not launching as expected in official builds 2022-11-01 16:33:37 +00:00
baldurk 0a39b3d6e8 Add a wrap script with env var to work around Android bug. Refs #2651 2022-08-05 16:17:17 +01:00
Robin Liu b06df5dd47 Supress shadow warning for ggp platform. 2022-08-03 17:43:35 +01:00
Jake Turner 8c37978212 Fix "-Wshorten-64-to-32" error with ftell() use
ftell() returns a long not an int
2022-07-21 11:49:49 +01:00
Jake Turner 1622667bf8 Disable Clang "-Wshadow" for specific files
3rdParty source files and some renderdoc files which include 3rdparty header files

Disable "-Wshadow" for the whole of qrenderdoc render_python.cxx triggers the warning
2022-07-21 11:49:49 +01:00
Jake Turner 2d6290bab1 Basic Metal capture support
Captures can be manually triggered from renderdoccmd capture <application> using F12 or from the UI on the in-development Metal replay branch.
The captures can be loaded and replayed on the in-development Metal replay branch.

The command buffer tracking and serialization are done by GPU submission order which is not necessarily the same as CPU commit order. The command buffer tracking for GPU submission order is currently using an rdcarray, this might change in the future to use a linked list if the performance of appending and deleting from the rdcarray becomes a performance bottleneck.

Does not include support for the presented MTLDrawable ie.
* Thumbnail generation of the final presented image.
* Serializing the presented texture ID.

Does not include support for initial state data.
No MTLBuffer data contents are serialized.

There is a lot missing and a lot of TODOs. 
This is the basic structure for capturing which is then built upon. 

Includes:
* register the Metal device as a frame capturer ie. AddDeviceFrameCapturer
* logic for triggering captures at Present ie. AddActiveDriver, StartFrameCapture, EndFrameCapture.
* Stopped declaring MetalResourceManager as a friend of WrappedMTLDevice which meant making the initial state-related APIs public instead of private.
* IFrameCapturer interface APIs
* Command buffer tracking for including in the output capture CaptureCmdBufCommit and CaptureCmdBufEnqueue.
* Serialise_MTLCreateSystemDefaultDevice(SerialiserType &ser)
* A helper class MetalCapturer which is derived from IFrameCapturer and registered with the RenderDoc instance. This is because Wrapped Metal classes can't have virtual tables as a requirement for how the C++ and Objective C overlay is implemented.
* The frame capture chunk and API AddFrameCaptureRecordChunk
* MetalInitParams data and serialization.

Helper Methods and Members in MTLDevice
* WaitForGPU()
* MTL::CommandQueue *m_mtlCommandQueue which is used to implement WaitForGPU()
* CaptureClearSubmittedCmdBuffers() & CaptureCmdBufSubmit()
* RegisterMetalLayer() & UnregisterMetalLayer() used to track active Metal swapchains

Details on the memory lifetime for WrappedMTLCommandBuffer

retain the real resource in WrappedMTLCommandBuffer::commit()
release the real resource when no longer needed to be tracked: for background capture in during WrappedMTLDevice::CaptureCmdBufSubmit, for active capture in WrappedMTLDevice::EndFrameCapture.

During capture (Background or Active)
* AddRef() record when command buffer is enqueued (explicit or implicit)
* Delete() record at end of command buffer submit

During Active capture
* AddRef() record in command buffer submit
* Delete() submitted command buffers as part of finalizing the capture

Added TrackedCAMetalLayer & ObjCTrackedCAMetalLayer to track the lifetime of CA::MetalLayer.
The CA::MetalLayer is tracked in the hook for CAMetalLayer::nextDrawable(), with ObjCTrackedCAMetalLayer set as an association to the CAMetalLayer. Then ObjCTrackedCAMetalLayer::dealloc() triggers ending the tracking.
2022-07-18 12:41:44 +01:00
baldurk 6870329a9e Detect java not being in PATH at all, document java PATH requirement 2022-06-30 13:51:26 +01:00
Remi Palandri 44f4fdafbc fix preview window bug post-activity destruction 2022-06-29 11:03:38 +01:00
baldurk 8aa0390948 Add string messages to returned result codes to display to user
* Most of the main entry points that can fail with relevant reasons now has a
  way of specifying a message to return with it. This message can be displayed
  to the user to give more information or context about an error.
2022-04-26 16:21:54 +01:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
baldurk 99adcc614f Allow multiple remote servers on one hostname, on different ports
* When a port is specified (with the usual :12345 suffix on the hostname) we use
  that for remote replay connections. We disable target control enumeration
  since that requires a port _range_ and captured applications self-assign those
  ports. Those can still be accessed via a normal unsuffixed remote specifier -
  even if there is no remote server running on the default port.
2022-02-15 17:15:48 +00:00
Remi Palandri 0151c5ce88 add explicit folder name to d8 commandline
d8 on cmd/powershell doesn't handle asterisks properly for folders, so replacing it by current ABI folder name
2021-10-11 12:22:40 +01:00
Marijn Suijten 544a8eb51f renderdoccmd: Use Android d8 instead of dx dexer
build-tools 31.0.0 doesn't ship with `dx` anymore, and Android Studio
switched to `d8` back in April 2018 [1].

The fallback for `dx` remains, in case older build-tools are used that
do not support `d8` just yet.

[1]: https://android-developers.googleblog.com/2018/04/android-studio-switching-to-d8-dexer.html
2021-09-21 12:48:06 +01:00
Jake Turner 833a63e639 Add missing renderdoccmd .h file to sources
Helpful for IDE project generation from CMake ie. xcode project
2021-08-24 21:33:51 +01:00
baldurk 7149302680 Rename 'draw' or 'drawcall' to action
* There's not a good accepted terminology for this kind of event, and for
  historical reasons 'drawcall' has been the accepted term, even though
  that can be quite confusing when a dispatch or a copy is a 'drawcall'.
* This is particularly highlighted by the event browser filters where
  $draw() includes draws and dispatches, but $dispatch() only includes
  dispatches, it's hard to intuitively understand why $draw() matches all
  of these calls.
* As a result we've defined the term 'action' to cover these types of
  events in the same way that we defined 'event' in the first place to
  mean a single atomic API call.
2021-07-01 15:15:05 +01:00
baldurk 4aab637f3f Copy libasan library and wrapper script on android when asan is enabled 2021-06-25 20:17:53 +01:00
baldurk 91db918362 Try to link with ASAN on android when enabled (doesn't seem to work) 2021-06-25 18:28:03 +01:00
Jake Turner f3b6e38db4 Apple implementation of DisplayRendererPreview 2021-04-07 11:54:46 +01:00
Ricardo Quesada cd5d0ede44 RenderdocCmd: add x86/x86_64 support for APKs
This commit adds x86/x86_64 support for RenderdocCmd APKs for Android.
This is needed mostly to support Chromebook devices. Many of them are
based on x86_64 CPUs.
2021-03-30 15:14:44 +01:00
baldurk 72095ff35c Update cmake strip scripts on android to work with latest NDK 2021-03-26 16:55:27 +00:00
baldurk 7c73e31050 Fix path separators on windows just in case 2021-03-23 12:56:59 +00:00
baldurk 79e42bc365 Compile android_native_app_glue.c as C
* It doesn't compile as C++ in latest compilers so we can't include it in-line
  in the C++ source
2021-03-23 12:56:41 +00:00
baldurk 6a0dff050c Try to unbreak broken android cmake flags
* cmake's built in platforms/Android.cmake for some reason sets
  CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH to OFF which prevents any subsequent
  find_program or find_package from locating any executables in the system PATH.
  This can break finding java among other things.
2021-03-23 12:24:54 +00:00
Jake Turner 9c787bd05d Tidyup the Apple RPATH usage
Use @rpath for build and install to reference dynamic libraries
Set RPATH to "@executable_path/../lib" when linking
2021-03-14 11:17:31 +00:00
sebastianpick 329b092cfb Fixed user level registration of vulkan layers.
Corrected a conditional that incorrectly checked for the inverse of the expected condition.
2021-02-18 15:41:31 +00:00
sebastianpick c700204037 Ensure CMAKE_EXE_LINKER_FLAGS are included during linking. 2021-02-18 15:41:18 +00:00
baldurk bddbc53226 Fix compile error in official builds 2021-01-27 16:56:47 +00:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk e5f4ca7bb8 Remove use of const char * in public API and OS specific where possible
* This prevents unnecessary conversions back and forth between rdcstr and const
  char * when going through interfaces. In the OS specific layer this is rarely
  an issue because most of the implementations don't convert to rdcstr, but it
  is convenient to be able to pass in an rdcstr directly. The few cases where
  there's an unecessary construction of an rdcstr is acceptable.
* A couple of places in the public API need to return a string from a global
  function, so can't return an rdcstr due to C ABI, so they still return a const
  char *.
* Similarly const char * is kept for logging, to avoid a dependency on rdcstr
  and because that's one place where unnecessary conversions/constructions may
  be impactful.
2020-12-07 17:44:50 +00:00
baldurk 6803f32ab8 Print a message when stripping android libraries, and keep unstripped 2020-12-05 09:57:40 +00:00