Commit Graph

4531 Commits

Author SHA1 Message Date
baldurk 0a20a544c7 Fix double-unwrap when fetching counters in vulkan. Closes #806 2017-11-20 20:01:01 +00:00
Cory Bloor f7b9f0be0d Optimized BFREV opcode in dxbc_debug
Main goal was to fix undefined behaviour, but it's also 50x faster...

cppcheck:
[renderdoc/driver/shaders/dxbc/dxbc_debug.cpp:1163]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
2017-11-18 00:17:06 +01:00
Cory Bloor 5e60d90dd4 Fix memory leak in posix_process
From cppcheck:
[renderdoc/os/posix/posix_process.cpp:319]: (error) Memory leak: argv
2017-11-18 00:17:06 +01:00
baldurk 2e508adb43 Fix compile issue about mismatched override/non-override in class 2017-11-17 17:52:15 +00:00
baldurk b118664bc2 Fix register space filling - resize before grabbing dest pointer 2017-11-17 16:33:06 +00:00
baldurk 016bc29609 Add a tool menu item that will recompress a capture file 2017-11-17 16:33:05 +00:00
baldurk 13de20612b Use typed enum for serialising VkMemoryType::propertyFlags 2017-11-17 16:33:05 +00:00
baldurk 6efb21b8e9 Fix replay of vulkan map commands passing the wrong range size 2017-11-17 16:33:04 +00:00
baldurk 7d501f6ef5 Check for live resources existing before translating to live ID. 2017-11-17 16:31:04 +00:00
baldurk c00a6ca8ef Add notion of UI modifications to a capture, saved in .rdc sections 2017-11-17 16:31:01 +00:00
baldurk bb6452c334 Expand IStackResolver into ICaptureAccess to allow section read/write 2017-11-17 16:31:01 +00:00
baldurk a238d3022a Move section data types into the public replay interface 2017-11-17 16:31:00 +00:00
baldurk 0f38c4770b Fix error in bitfield macro 2017-11-17 16:30:59 +00:00
baldurk 0b899d90b6 Add ability to replace sections in RDCFile 2017-11-17 16:30:59 +00:00
baldurk b1c0de3016 Add and tweak some FileIO OS-specific functions
* fflush is a no-op wrapper but nice to have for consistency.
* ftruncateat will take a file read-write handle and truncate it at a
  given length. Useful if re-writing a file and the new data ends up
  being shorter than the oldd ata.
* Move in addition to Copy, and success/fail bool return on both.
2017-11-17 16:30:58 +00:00
baldurk 824ec81864 Make sure Resource is properly null'd out in pipeline state if unbound 2017-11-17 16:30:56 +00:00
baldurk 1776b4e6c0 Declare ResourceId Qt metatype in public header so it's QVariant'able 2017-11-17 16:30:55 +00:00
baldurk 7c8628b237 Centralise resource naming with capture context to allow customisation
* We remove the now unneeded name fields in buffer/texture descriptions
  and some of the pipeline state structs.
* A single function will give the human-readable name for a resource id.
  This will look up a custom set of renames, on top of the names from
  the resource descriptions.
2017-11-17 16:30:53 +00:00
baldurk 3ac3e6c3f1 Fill out resource descriptions in each driver
* For Vulkan and D3D12, we now create a dummy command buffer to ensure
  that there's actually a chunk available to correspond to the command
  buffer that gets submitted or recorded to.
2017-11-17 16:30:50 +00:00
baldurk 1c614029d8 Add a way to return basic information about all resources in a capture
* This provides a way to find the name of any resource besides 'special'
  resources like textures and buffers. In a follow-up commit, the names
  will be removed from their descriptors.
* It also allows us to list which chunks in the structured file were
  used to initialise the resource, giving the ability to look up and
  display the initialisation parameters.
* At the same time we also list the derived/parent resources to better
  allow the user to browse between related resources.
2017-11-17 16:30:49 +00:00
baldurk 2d15fe2c05 Fix incorrect chunk type in PersistentMapMemoryBarrier 2017-11-17 16:30:43 +00:00
Peter Gal 2ae9e8a4bc [EGL] Move GLWindowingData creation into it's own method
The GLWindowingData creation was done at three places
with almost no difference.
2017-11-17 17:30:16 +01:00
Peter Gal ca95a9c3ab [EGL] Move symbol loading into one file
The EGL function pointer loading was scattered
in two files thus it is hard to keep track where
the symbols were loaded.

Introduced a class which holds all internally used
EGL function pointers with a helper method to
load the required pointers. Not all EGL pointers
are loaded just the used ones (just like before).
2017-11-17 17:30:16 +01:00
Peter Gal 9c84b7f716 [GL/GLES] Fix incorrect chunk type serialization
In some cases a few GL wrapper methods are called
with incorrect gl_CurChunk during serialization.

This can happen if the capturing application calls
a GL method - for which the gl_CurChunk will be set correctly -
and the wrapped method calls another wrapped GL method
but for that the gl_CurChunk will be incorrect.

Also during the ActivateContext call the gl_CurChunk
was not set.

For now do a hotfix for glDrawArrays and initial context.
2017-11-17 17:30:05 +01:00
baldurk 8133188a4c Make mesh viewer more robust if no ibuffer is bound on indexed draw 2017-11-10 18:36:05 +00:00
baldurk e8140e0459 Fix serialisation of GL generic vertex attrib functions 2017-11-10 18:36:04 +00:00
baldurk 335919a42c Add a fast path when skipping bytes in a file-based I/O reader. 2017-11-10 18:36:03 +00:00
baldurk 5c4f867bd9 Remove unnecessary copy in FillRegisterSpaces
* This was previously used because rdcarray wasn't runtime resizeable.
2017-11-10 13:05:56 +00:00
baldurk 3504d2741a Clear PostVS cache when a resource is replaced. Refs #729
* For now, resource replacement implicitly means shader edits, but other
  replacements could also affect the results of PostVS (e.g. buffer or
  state changes). Trying to capture all this state in the cache key is
  not very useful.
* The PostVS cache will be re-filled immediately after, as any
  replacement does a force-refresh of the current event.
2017-11-10 13:01:40 +00:00
baldurk 954a11de89 Implement shutting down individual replay outputs
* This means e.g. that if the mesh output view gets closed, we don't
  keep it around internally and keep calling InitPostVSBuffers for it.
2017-11-10 12:22:13 +00:00
baldurk 5b8d0aeee0 Fix code for SINGLE_FLUSH_VALIDATE path 2017-11-09 18:09:49 +00:00
Janos Pantos ce4aee7bdd Add workaround for reading back BGRA textures 2017-11-09 19:09:30 +01:00
baldurk 997248380e While structured exporting frame/context chunks need to save buffers too 2017-11-09 15:12:22 +00:00
baldurk ebe1318f72 When exporting struct buffers we must always allocate memory to readback
* If the external code has a NULL pointer and doesn't want to allocate
  but we are exporting buffer data, we still need to read the data
  somewhere so make a temporary allocation to read it into.
2017-11-09 15:12:06 +00:00
baldurk 13f4ac481e Fix incorrect arguments to error printf 2017-11-09 15:11:20 +00:00
baldurk 92ec567e9e Serialise vkMap offset before replaying MapMemory, so it includes offset 2017-11-09 15:11:04 +00:00
baldurk 35801dcd72 Don't try to fetch resource ID from already unwrapped image 2017-11-09 15:10:05 +00:00
baldurk 401705ec15 Mark barriers as containing optional resources 2017-11-09 15:09:51 +00:00
baldurk c49bb6fc7a Add simple in-line implementation of rdcarray::push_back
* Coverity can't figure out that a pointer being push_back'd isn't
  leaking, possibly due to the call to insert.
2017-11-09 12:41:17 +00:00
baldurk 2353421526 Add some hefty padding to reported image required size on AMD. Refs #795
* AMD reports image required sizes with some variation even for the same
  creation parameters. This can mean the same image is reported with
  less required size during capture compared to replay, meaning memory
  binds won't work.
* To get around this, we pad up the requirements to alignment * 4 and
  fudge to try and encompass any possible variation.
2017-11-09 12:03:31 +00:00
baldurk e9c4de1dd5 Suppress error for eGL_UNSIGNED_BYTE and eGL_BGRA 2017-11-08 18:24:49 +00:00
baldurk 7fa3ec51c9 Fix emulation of glMapNamedBuffer - pass correct map access bits 2017-11-08 18:24:48 +00:00
baldurk 6f500afe6d Re-enable D3D12 driver. (See commit msg if bisecting)
* This marks the end of "Temporarily remove driver support" which
  disabled drivers until they could be updated to the new serialisation.
2017-11-08 18:24:47 +00:00
baldurk 3aa8398ec2 Update D3D12 command list wrapping code to new serialisation 2017-11-08 18:24:47 +00:00
baldurk 5452940739 Update D3D12 command queue wrapping code to new serialisation 2017-11-08 18:24:46 +00:00
baldurk 5e4a919bc9 Update D3D12 device wrapping code to new serialisation 2017-11-08 18:24:45 +00:00
baldurk 40fd82a42a Update D3D12 initial state handling to new serialisation 2017-11-08 18:24:45 +00:00
baldurk 5dd6a819d4 Update non-wrapping code for D3D12 command queues and lists 2017-11-08 18:24:44 +00:00
baldurk 6fcfdf3a1b Update D3D12 device non-wrapping code to new serialisation scheme 2017-11-08 18:24:43 +00:00
baldurk dcd22abd13 Update D3D12Replay and initialisation to new code & RDCFile based system 2017-11-08 18:24:43 +00:00