Commit Graph

12588 Commits

Author SHA1 Message Date
baldurk ff6d495c45 On debug pass encoded DXIL through validator just in case 2021-09-21 18:04:57 +01:00
baldurk fccaee058e Handle attribute sets with per-function-parameter attributes in DXIL
* This also fixes the string (not enum) attribute decoding
2021-09-21 18:04:57 +01:00
baldurk a67b0beb7f Don't warn on vector instructions - DXIL uses them sometimes 2021-09-21 18:04:57 +01:00
baldurk 012fedbb4a Fix basic block symtab entries 2021-09-21 18:04:57 +01:00
baldurk 1f68db5c08 Preserve value symtabs in exactly the order they come in
* Sometimes these are sorted, but that seems to be a recent dxc change.
2021-09-21 18:04:57 +01:00
baldurk 731c81e3c7 Fix encoding of constants with potential forward references 2021-09-21 18:04:57 +01:00
baldurk 976cb0e21a Preserve uselists through DXIL decode/encode 2021-09-21 18:04:57 +01:00
baldurk 097e6657e8 Write attached metadata in functions 2021-09-21 18:04:57 +01:00
baldurk 29c16d17e8 Encode function instructions 2021-09-21 18:04:57 +01:00
baldurk 410ee1472b Start emitting function blocks, with attached metadata and constants
* We now track the values in a simple array so getting value IDs amounts to just
  getting an index in this array. This avoids the need to iterate in an llvm-
  identical way to enumerate values. That does mean that we need to insert new
  values into the array in the correct order, which isn't too bad.
2021-09-21 18:04:57 +01:00
baldurk 3b8dee0233 Refactor DXIL handling to rely on pointers instead of indexing
* The indexing works fine and handles forward references nicer, but once we
  start modifying things all the indices will need to be rebased.
2021-09-21 18:04:57 +01:00
baldurk 606c011aac Emit global symbol table 2021-09-21 18:04:57 +01:00
baldurk 3ce8d68fba Emit metadata block 2021-09-21 18:04:57 +01:00
baldurk a2a5d8ec8a Emit the global constants block in DXIL 2021-09-21 18:04:56 +01:00
baldurk f6e8e78bbf Emit global var and function records in module
* The value IDs currently aren't fetched in LLVM-matching order so we don't have
  those yet for global var initialisers
2021-09-21 18:04:56 +01:00
baldurk 6d60d96fe6 Set up llvm encoder to handle abbrev selection, and write type lock 2021-09-21 18:04:56 +01:00
baldurk 045aad23ad Write param attr blocks
* We cheat slightly with the attributes - we combine these on load, so we lose
  information about multiple groups they may reference. So we save the groups
  that we read from and use that to write the attribute.
2021-09-21 18:04:56 +01:00
baldurk 9e3385d18d Emit root module block and blockinfo subblock
* It looks like LLVM (at DXC's version anyway) hardcodes a series of
  abbreviations, so we do the same
2021-09-21 18:04:56 +01:00
baldurk c77c9e8814 Add llvm bitstream writer 2021-09-21 18:04:56 +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
baldurk 6535e3b20c Don't fetch GPU descriptor address for non-shader-visible heaps
* Silences a D3D12 debug warning
2021-09-17 14:29:23 +01:00
baldurk 1b42dcc05f Fix crash returning serialiser's structured file to dummy driver
* If we hit a fatal error during initialisation, the structured file pointer
  still points at the temporary serialiser's structured file. It's not until we
  finish loading that we swap it into the driver-stored file that we can safely
  return and detach ownership of.
2021-09-17 14:29:05 +01:00
baldurk bffeb08a86 Try to do a version check on installed VC redist. Refs #2359
* Unfortunately there isn't an easy registry key to check to see if the
  2015-2019 redist that we need is installed. Instead we need to check the
  major/minor version to see if it's at least 14.20.
* This is complicated by the fact that windows installer returns DWORD registry
  values with an extra # but provides no built-in way to strip it so it can be
  compared numerically. The solution we've used here is a custom vbscript
  action, but apparently they are problematic. Worst case I believe this will
  try to install the runtime when not necessary, which might require an
  unnecessary reboot. Or alternatively it may misdetect the runtime as installed
  but the large majority of people have a compatible redist so this isn't too
  bad either.
2021-09-17 13:20:46 +01:00
baldurk 44abc701e0 Fix crash serialising glVertexArrayVertexBuffers with NULL buffer array 2021-09-17 12:50:39 +01:00
baldurk c3a93bf61b Fix potential crash reading empty descriptor array on D3D12 2021-09-17 12:50:05 +01:00
baldurk bcb70d3b9c Fix D3D11 debug messages being off by one event 2021-09-17 12:18:50 +01:00
baldurk a5dfc5b8b0 Properly reset all input assembly binding data in D3D11 pipeline state 2021-09-17 11:36:30 +01:00
baldurk fdaacf5f86 Add a couple of fatal error checks/protections around ExecuteIndirect 2021-09-16 17:05:52 +01:00
baldurk 8e1c6bb876 Fix error message accessing invalid tokens in filter 2021-09-16 12:40:11 +01:00
baldurk 5b18e4bdc6 Avoid crash when fetching vs out with expected index buffer unbound
* This is clearly invalid but it's trivial to protect against a divide by 0
  which we do on other APIs, so we do that here.
2021-09-16 11:45:36 +01:00
baldurk 36e17be519 Add some extra fatal error checks during early startup 2021-09-16 11:01:34 +01:00
baldurk 46ffa9de79 Ignore com.android activity that sometimes shows up in other packages 2021-09-15 11:31:54 +01:00
baldurk 21e5aa8bcf Update/remove some dated documentation notes when building on VS 2021-09-15 10:32:55 +01:00
baldurk 3d785b9b68 Try to rebind user DC first when pushing/popping GL contexts. Refs #2361
* In the old codepath for a valid existing window we'd create a cloned DC and
  use that to pop with. However that DC is then released so we have created the
  'stale DC' situation. This can cause problems with subsequent context
  activations when we try to push/pop to populate GL hooks and fail to pop
  properly as the queried DC is invalid.
2021-09-14 17:54:48 +01:00
baldurk 2752008d13 Ensure consistency when saving the current capture. Closes #2358
* If we save the current capture from a connection window we want to do that via
  the main window so the UI can be properly updated and so we can save it
  properly through the replay manager, so the old one can be removed safely.
2021-09-14 13:25:02 +01:00
baldurk 0054e534f8 Fix triangle size overlays breaking when postvs data doesn't have W=1.0 2021-09-14 13:02:56 +01:00
baldurk 33d36788a6 Always check mapped memory for changes if it has BDA buffers
* Normally we only check mapped memory when it's referenced during capture by
  some binding, but for BDA we don't have bindings so we have to conservatively
  check it every time.
2021-09-13 19:13:30 +01:00
baldurk fbe7462dbd Mark parameter as important in vkCmdSetScissorWithCountEXT 2021-09-13 19:12:34 +01:00
baldurk 90f3417039 Don't generate potentially unsupported vertex formats to ignore W
* When using VS In we want to ignore the W component, but that already happens
  explicitly for vulkan/GL in the shader. Mirror that same solution to D3D
  instead of trying to force a 3-component format which may not be supported
  (e.g. on AMD R16G16B16_*)
2021-09-13 19:11:28 +01:00
baldurk adb2b65951 Be more precise with handling pointer address spaces in DXIL 2021-09-09 12:37:55 +01:00
baldurk 44eee83aa2 Fix some differences with DXC's disassembly
* We also add an option to tweak our disassembly output to be more easily
  compared with dxc's
2021-09-09 12:35:19 +01:00
baldurk a42401c957 Unreachable instruction ends a block in DXIL 2021-09-09 12:29:09 +01:00
baldurk cfd6ed0e98 Hash any unhashed incoming shaders on D3D12
* This is possible when capturing a program that uses experimental feature to
  allow unhashed shaders. We don't replay this so it would fail. We could enable
  the feature, but this is just as easy and means it works even when
  ""development mode"" isn't enabled.
2021-09-09 12:28:54 +01:00
baldurk 587c411833 Add some new undocumented reflection values 2021-09-09 12:24:54 +01:00
baldurk 0af73f58d3 Ignore RDAT chunk 2021-09-09 12:24:42 +01:00
baldurk 5471bf2519 Handle new type of patch constant signature, and new interpolator types 2021-09-09 12:24:32 +01:00
baldurk 90a6e2b425 Specify file handles as explicitly non-inheriting on windows
* We never want to inherit these, and e.g. Qt process launches are hardcoded to
  always inherit handles so these need to be excluded so files don't stay open.
2021-09-09 12:24:17 +01:00
baldurk 2cd0bf593f Update copyright year in about dialog 2021-09-09 12:24:03 +01:00
baldurk 67e0623d33 Fix some DXIL disassembly issues 2021-09-09 10:39:20 +01:00
Dylan Barrie 1b19208323 Fixes for GS output in the Mesh Viewer in D3D12
- Ensure there is space for the Stream Out counters at the beginning of the SO buffer
- Fix use-after-Unmap of the SO statistics data
- Reset the state correctly after syncing every 1000 instances
- Unmap the SO buffer when no output instances are found
2021-09-02 01:06:27 +01:00