Commit Graph

8017 Commits

Author SHA1 Message Date
baldurk 76d91d5eef Don't allow static logfile string to destruct before RenderDoc singleton 2020-09-12 23:18:04 +01:00
baldurk ac8a90ebbe Fix refcounting of D3D12 shader objects 2020-09-12 23:16:15 +01:00
baldurk 433a51cf64 Fix replay refcounting of D3D11 objects 2020-09-12 23:15:44 +01:00
baldurk 50ebd8d379 Fix mistake enabling BDA capture replay if original BDA wasn't enabled 2020-09-12 23:15:17 +01:00
baldurk 6225c83d12 Fix handling of CreateCommandList1
* We would accidentally ignore the first Reset() call by attempting to avoid the
  fake Reset() that CreateCommandList creates.
2020-09-11 20:52:10 +01:00
baldurk 0d70327b21 Store resource type directly in VkResourceRecord
# Conflicts:
#	renderdoc/driver/vulkan/vk_resources.h
2020-09-11 16:31:10 +01:00
LukeRoss00 33a1c9b2c6 Update win32_callstack.cpp
Module offset was mistakenly being erased together with .pdb extension
2020-09-11 15:31:31 +01:00
baldurk 966db7bdb0 Add some more identified markers 2020-09-10 22:57:22 +01:00
baldurk 809b8f9f29 Add fallback on android if gpu debug layers are broken or inaccessible 2020-09-10 16:41:35 +01:00
baldurk d671c66bea Remove reliance on wrapped pool IsAlloc
* In most cases we either know the type, or we can use the generic parent
  WrappedDeviceChild11 to get what we want.
2020-09-10 14:45:46 +01:00
baldurk fdeea5204d Refactor and optimise D3D11 refcounting implementation
* In heavy D3D11 workloads the refcounting overhead especially during fast
  binding changes was significant. Refactoring the refcounting to work on a
  different model and deferring destruction of objects removes most of the
  overhead.
2020-09-10 13:35:32 +01:00
baldurk fb19ccb535 Don't pool-allocate D3D12 shaders 2020-09-10 13:35:16 +01:00
baldurk e9360a819f Don't pre-allocate such large wrapped pools
* The cost of searching a few more pools to check allocations isn't so bad
  especially if we can move IsAlloc() off the hot path. Better that than
  allocating 100MB in pools.
2020-09-10 13:35:16 +01:00
baldurk 3b04aa227b Reduce the memory footprint of D3D12 objects 2020-09-10 13:34:44 +01:00
baldurk 7cd7616401 Serialise max anisotropy level in GL texture & sampler initial states 2020-09-09 16:40:07 +01:00
baldurk 78f1f8f3d1 Remove volatile from Atomic parameter declarations
* This was leaky from windows' InterlockedIncrement etc declarations, and is not
  necessary.
2020-09-09 16:40:04 +01:00
baldurk 3f26f42541 Fix enabling of bufferDeviceAddressCaptureReplay
* We only enable this if we find an existing struct somewhere enabling the base
  feature. Otherwise we might try to enable this when it's not supported at all.
2020-09-09 16:40:00 +01:00
baldurk 75cb5d18d6 When memory has a dedicated allocation buffer, use it for wholeMemBuf 2020-09-08 12:57:01 +01:00
baldurk 3d5aabdd80 Make sure to enable bufferDeviceAddressCaptureReplay on replay
* We used to get this 'for free' by serialising our patched device next chains,
  but we no longer do that so we need to enable this bit on replay as well.
2020-09-08 12:57:01 +01:00
baldurk 218ce2abf7 Set NULL descriptor updates to valid offset/range 2020-09-08 12:57:01 +01:00
baldurk 515d4c5dc3 Ignore generated initial states for images with no memory bound 2020-09-08 12:57:00 +01:00
baldurk b1c12ce1ae Don't re-order chunks for indirect draws. Closes #2042
* If we insert chunks next to the recorded commands for indirect draws we need
  to update all other commands which are recorded but not submitted which have
  chunk indices. Updating this could be very complex if the command buffer
  record is only partially complete when the submit happens (which is quite
  possible if it's not submitted until later), so instead we abandon trying to
  have indirect chunks next to the recorded command chunks since it's not
  strictly necessary.
2020-09-07 18:09:04 +01:00
baldurk 8def317971 Don't use separate xfb objects without ARB_transform_feedback2 extension
* EXT_transform_feedback allow us to use what we want and is core in the minimum
  replay version (3.0 for GL/GLES), but it doesn't include separate xfb objects.
2020-09-07 16:58:49 +01:00
baldurk 9b46bf7c91 Don't reset chunk allocator mid-capture
* We may still need these chunks for previously submitted frames if we're saving
  everything in a capture.
2020-09-07 11:56:24 +01:00
baldurk b522224572 Fix the wrong context params being serialised for implicit thread switch 2020-09-07 11:44:57 +01:00
baldurk fb178c4602 Fix missing thread sync when checking for GCN ISA support 2020-09-07 11:44:42 +01:00
baldurk fb3c293621 Create a default SRV/UAV descriptor when needed. Closes #2040
* In D3D12 if the user passes NULL for the UAV or SRV descriptor when calling
  Create*View we don't have the runtime to generate a default one for us when we
  query, we'll just have nothing stored. So instead when we need to generate a
  default "whole resource" descriptor to look up.
2020-09-04 23:23:31 +01:00
baldurk a0eadf47f5 Push GCN ISA support checks onto separate thread
* The executables can take a little while to run, so we can do that in parallel
  while loading the capture.
2020-09-04 17:43:32 +01:00
baldurk 54db5aaf3b Store entries in vulkan shader cache for GLSL generation inputs
* GenerateGLSLShader is reasonably expensive because it uses glslang to
  preprocess the shaders. If we can cache the input hash and look up the cache
  with that hash then we can skip it entirely.
2020-09-04 16:53:38 +01:00
baldurk 2bfa2c0ced Move histogram/minmax shaders into vulkan shader cache
* This lets us cache all shaders instead of having some be regenerated outside
  the cache and looked up into it.
2020-09-04 16:39:42 +01:00
baldurk 9fc97f6097 Erase m_CurrentResources from the end not the beginning
* Since it's a sorted vector this avoids O(n^2) time to erase everything one by
  one.
2020-09-04 12:06:09 +01:00
baldurk d524eb8cc8 Fix overlay bugs with extended dynamic state 2020-09-04 11:29:12 +01:00
baldurk c96b05ec3b Fix primitive topology from extended dynamic state not being respected 2020-09-04 11:29:01 +01:00
baldurk 18a7e3c05c We shouldn't return physical device entry points in vkGetDeviceProcAddr
* The spec says we only return a function pointer for device or device-child
  functions. In practice the loader wraps instances and physical devices so when
  calling a direct GDPA returned function the loader won't unwrap it so we won't
  get our proper wrapped objects and will crash.
2020-09-04 10:32:17 +01:00
baldurk 0c71c71645 Store command buffer page set in baked commands. Closes #2039
* If we keep the page set in the command buffer and destroy it on reset, we'll
  free the pages behind the baked chunks that we stored. If a capture records
  and resets a command buffer multiple times within a capture we need to store
  multiple baked command buffers.
* So instead we give the baked commands ownership of those pages and reset them
  when the baked commands record is destroyed (either because the command buffer
  has been reset as it was before - or if we hold onto a reference during
  capture then after the capture is done).
2020-09-03 18:58:30 +01:00
baldurk 56f82f6bf1 Optimise UI for large descriptor arrays with few dynamically used binds
* We tune the pipeline state view and texture viewer to only iterate over a
  small list of dynamically used binds in the (vastly more common) case where
  unused binds are not being shown.
2020-09-03 18:09:47 +01:00
baldurk afe3bee92d Only lock in resource manager while capturing
* On replay currently we only have single-threaded access so the lock is just
  overhead
2020-09-03 18:08:39 +01:00
baldurk 54286833bf Switch some maps to unordered_map where we only use them for lookups 2020-09-03 18:08:35 +01:00
baldurk 4dbfca2390 Add std::hash overload for ResourceId to allow use in hashmaps/hashsets 2020-09-03 18:07:46 +01:00
baldurk d71d275dc4 Don't re-read entire logfile every time, only read from last position 2020-09-03 17:45:41 +01:00
baldurk 31b81ade3c Switch descriptor refs lock back to normal lock
* Unfortunately some programs have extreme contention on this lock due to
  multithreaded descriptor set writes enabled by UPDATE_AFTER_BIND.
2020-09-02 10:22:11 +01:00
Andreas Hollandt f32262ad24 support Intel performance counters on Windows 2020-09-01 16:59:08 +01:00
baldurk 10878bb5a9 Never clamp to an invalid index even for invalid inputs
* This prevents a crash as at least index 0 is always a valid scalar lookup.
2020-09-01 16:39:19 +01:00
baldurk 83f7a26ee9 Query which shader disassembly formats require a pipeline
* This allows us to be a bit more friendly in the UI when we don't have a
  particular pipeline associated with a shader.
2020-09-01 14:03:59 +01:00
baldurk 6b2f763bfa Ignore sets of empty name strings on resources 2020-09-01 11:09:03 +01:00
baldurk 9f5e6a725b Batch calls to UpdateBackgroundRefCache on descriptor copies 2020-09-01 10:42:42 +01:00
baldurk eb575e12ef Don't hook vulkan-1.dll, prevents layered implementations from recursing 2020-09-01 10:36:28 +01:00
baldurk d6b36f7abf Fix handling of saving cubemaps to disk in GL
* GL needs special handling because cubemaps need to be treated partially as
  arrays to select the target, then not as arrays when the data is retrieved.
2020-09-01 10:32:48 +01:00
baldurk 8b935a1c11 Wrap and serialise calls through ID3D12CompatibilityDevice 2020-08-31 10:51:32 +01:00
baldurk 052cd255e8 Don't initialise AMD extensions during capture 2020-08-31 10:43:19 +01:00