Commit Graph

13318 Commits

Author SHA1 Message Date
baldurk 98a93408c6 Handle subpasses with unused color attachments in pixel history v1.21 2022-07-27 14:56:43 +01:00
baldurk a33eb5fcb1 Allow reinterpreting formats of constant blocks that have bytes backing
* Even without a true buffer, as long as we have access to the bag of bytes and
  a non-opaque layout we can allow reinterpreting.
2022-07-25 10:08:59 +01:00
baldurk 5d51b524c6 Fix interpreting and declaring buffer formats that include pointers 2022-07-25 10:08:59 +01:00
Jake Turner ce60dd40b1 Tweak to compile with Apple Clang v13.0
macos-11 Apple Clang does not support -Wno-unused-but-set-variable

To fix CI

error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
2022-07-22 18:45:45 +01:00
Jake Turner f6baad2a0f Update mac CI to use macos-11 instead of 10.15
To fix Mac CI

The macOS-10.15 environment is deprecated, consider switching to macos-11(macos-latest), macos-12 instead. For more details see https://github.com/actions/virtual-environments/issues/5583
2022-07-22 18:45:45 +01:00
Jake Turner 529ed4ffe8 Fix new compile errors in Metal EndFrameCapture
Enabling -Wshorten-64-to-32 PR overlapped with this code landing
2022-07-22 18:45:45 +01:00
baldurk 6e33222115 Fix missing documentation type declaration 2022-07-22 18:45:20 +01:00
baldurk c98b16fd8c Fix compile warnings 2022-07-22 18:16:09 +01:00
baldurk 0b187934de Track bytes written for hidden SO counters. Closes #2662
* The D3D11 spec is unclear but checking sources including D3D11On12 it looks
  like the defined behaviour for SO counters is to calculate the number of bytes
  written and divide that by the VB stride on draw.
* Old captures can't be updated to work with this because the stride is unknown,
  but new captures will work correctly as well as any data that is stream'd out
  mid-capture.
2022-07-22 16:10:59 +01:00
baldurk aafd0ec788 Fix a bug with variables in loop coming into existence multiple times 2022-07-22 16:10:59 +01:00
baldurk e6100167aa Don't track first pointer writes when we have debug info 2022-07-22 16:10:59 +01:00
baldurk a967805a24 Don't use StringFormat for SPIR-V GetRawName 2022-07-22 16:10:59 +01:00
baldurk fda5c4819a Scroll shader viewer to entry point file & line using debug info 2022-07-22 16:10:59 +01:00
baldurk c053912608 Add explicit DXIL shader encoding 2022-07-22 16:10:59 +01:00
Jake Turner ac719cecd8 Fix Clang 14 compile warning
Disable "-Wtautological-constant-out-of-range-compare" when compiling "3rdparty/compressonator/BC6_Encode_kernel.cpp"
2022-07-21 11:49:49 +01:00
Jake Turner 240fcf3373 Disable -Wshadow & -Wshorten-64-to-32 for ihv/arm
Error triggers in 3rdParty code ie.

renderdoc/driver/ihv/arm/official/lizard/include/lizard/lizard_counter.hpp:66:5: error: declaration shadows a variable in namespace 'lizard' [-Werror,-Wshadow]
2022-07-21 11:49:49 +01:00
Jake Turner cb2e4f1253 Fix "-Wshorten-64-to-32" errors in Apple code
Also rename AndroidCallstack -> AppleCallstack in apple_callstack.cpp
2022-07-21 11:49:49 +01:00
Jake Turner 9ab43e6c5a Fix "-Wshorten-64-to-32" errors in socket APIs
socket APIs take an int for the socket file descriptor
send() and recv() return ssize_t not int
bind() takes "socklen_t" for the length of the sockaddr structure
2022-07-21 11:49:49 +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 fb04266122 Disable Clang "-Wshorten-64-to-32" for files
3rdParty source files and some renderdoc files which include 3rdparty header files

Disable "-Wshorten-64-to-32" for the whole of qrenderdoc render_python.cxx triggers the warning
2022-07-21 11:49:49 +01:00
Jake Turner 0d02425a87 Enable Clang warning "-Wshorten-64-to-32" 2022-07-21 11:49:49 +01:00
Jake Turner 955695d948 Fix "-Wshadow" errors in Apple code
WrappedMTLDevice CaptureCmdBufCommit() & CaptureCmdBufEnqueue() rename parameter "record" to "cbRecord"
2022-07-21 11:49:49 +01:00
Jake Turner 062bc2b470 Fix "-Wshadow" error on "read" variable 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 d7f286fb7d Enable Clang warning "-Wshadow" 2022-07-21 11:49:49 +01:00
Jake Turner 97efa7cf04 Capture support for the presented MTLDrawable
Generate the capture thumbnail image from the presented `MTLTexture`
Serialize the capture `PresentedImage` ID in the `CaptureEnd` chunk.
2022-07-21 10:32:32 +01:00
Jake Turner 9e8be2400f Deleted ObjC::CAMetalLayer_Set_framebufferOnly
Use the metal-cpp implementation instead of the helper version
2022-07-21 10:32:32 +01:00
Jake Turner 8a0af20c1e metal-cpp : add CA::MetalLayer::setFramebufferOnly
Minor code formatting tidy on a couple of previous changes to better match the surrounding code style
2022-07-21 10:32:32 +01:00
Nicola Cerone 43462ea3c9 Fix arcball navigation by updating the basis matrix. 2022-07-20 10:38:38 +01:00
baldurk 3b00cf247e Fix crash when structured exporting on D3D 2022-07-19 10:11:31 +01:00
Ryan Houdek fb91e7360a Add support for vulkan layer suffixes
While Renderdoc already supported multiarch for where to install the
libraries with the LIB_SUFFIX option. The Vulkan layer was left out of
this loop.

Vulkan layers living in `/usr/share/vulkan/implicit_layer.d/` will use a
suffix before the `.json` to separate libraries of different
architectures. These layer files will then point to the architecture
specific `library_path` inside that json file.

Also updates the check in `LayerRegistrationPath` so it handles the
suffix as well. This way `renderdoccmd` won't complain about conflicting
json files.
2022-07-18 19:40:55 +01:00
Jake Turner fca14eac32 Apple minimal Nuklear implementation using AppKit 2022-07-18 13:13:37 +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
Jake Turner 2d34834a19 Add CAMetalLayer::device() to Metal-CPP 2022-07-18 12:41:44 +01:00
baldurk 234262649f Fix calculation of small mip co-ordinates for NPOT textures 2022-07-15 18:07:08 +01:00
baldurk 123509166e Compile shaders in debug when self-hosting captures 2022-07-15 18:00:38 +01:00
baldurk 1494a8f71e Checking for the upload location variable being set in CI
* This helps downstream forks to run CI without seeing a false negative in the
  mac release build due to being unable to upload the final package to the
  server.
2022-07-15 16:04:13 +01:00
baldurk c3a6a8a9d6 If there's no fixed data don't fetch the whole buffer 2022-07-14 14:01:08 +01:00
baldurk b3ad3a2031 Don't overwrite secondary command buffer renderpass state if inactive
* With dynamic rendering, secondary command buffers don't always inherit
  renderpass state from the primary, they can start their own.
2022-07-13 12:11:35 +01:00
baldurk 2833ea4a84 Handle state changes on first event in a command buffer. Closes #2648
* When selecting the first event in a command buffer the render state wouldn't
  properly be updated. This is particularly bad if the state that changed is
  being in/out of a renderpass.
2022-07-13 12:10:40 +01:00
baldurk c7e41000c3 Remove hacky 'validation' of draws in render passes
* This was an extremely old bit of code from before vulkan 1.0 to detect a
  common error. RenderDoc does not validate in general so delete this rather
  than keep it up to date.
2022-07-13 12:09:31 +01:00
baldurk bbe9624b95 Rejig some code around to avoid stack size explosion in vulkan serialise 2022-07-13 11:32:18 +01:00
baldurk 6095606b41 Don't replay initial states for GL texture buffers with no buffer 2022-07-12 14:36:46 +01:00
baldurk 7c68746fd9 Add missing reference to struct in python docs 2022-07-11 13:48:28 +01:00
baldurk 5ef8294375 Pass through include paths properly when compiling shaders. Closes #2646 2022-07-11 13:03:54 +01:00
baldurk c14fad42c0 Put quotes around the right parameter in disassembled debug printfs 2022-07-11 13:02:35 +01:00
baldurk 7bdf26d329 Implement location tracking and goto for GS printfs
* We can't debug geometry shaders but we can scroll to them, as long as we have
  the primitive. We can't differentiate instances currently without passing that
  data through from the VS (and through tessellation, if it exists).
* This also disables the debug and goto buttons for printfs from shader stages
  that don't support those operations.
2022-07-11 13:02:23 +01:00
baldurk d39197a499 Arrays of float3 with a stride of 12 is only possible in scalar packing
* Previously this would be treated as std430 due to being 'tight' array packed,
  even though std430 only allows as tight as the base alignment - which for a
  float3 is 16-bytes still.
2022-07-11 13:00:18 +01:00
baldurk 52c00efb75 Apply matrix stride to inner children for multi-dimensional arrays 2022-07-11 12:59:49 +01:00
baldurk 83bff08fd1 Don't enable global hook if short paths are unavailable. Closes #2645
* AppInit_DLLs requires short paths to be specified, if they can't be created on
  the volume we can't reliably enable the global hook.
* Detecting this programmatically is quite complex, but since we know the shim
  file is always longer than 8.3, if we detect that the short path is the same
  length as the long path we know short names weren't used.
2022-07-08 11:25:57 +01:00