Commit Graph
58 Commits
Author SHA1 Message Date
baldurk 9f9419c21f Preprocess #line directives in SPIR-V debug info to get referenced files
* This matches the line number and source file references generated in the debug
  info
2022-04-27 13:46:02 +01:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
baldurk 22dda946fc Strip root signature to avoid false validation errors 2021-09-24 10:59:39 +01:00
baldurk 92efebd5f0 Fix some errors from unhandled PDB data 2021-07-21 15:55:08 +01:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk f717915738 Fix handling of separate debug info around fxc/dxc inconsistencies
* dxc emits a PDB which contains a stream with the debuginfo DXBC container,
  which we expected to happen for fxc too. Instead fxc just emits the bare SPDB
  chunk PDB. So we need to try to guess what to expect and/or handle both.
2021-01-12 12:52:26 +00:00
baldurk 580f96c8a1 Rename ShaderVariableType/Descriptor to ShaderConstant
* These structs are no longer used with ShaderVariable so the name is misleading
  at best.
2020-12-09 15:18:27 +00:00
baldurk 584746e406 Support capturing & replaying shader extensions with nvapi in DX11&12 2020-10-29 10:16:14 +00:00
baldurk 96ab4c25d6 Allow arrays to have a larger varOffset than 16 bytes in assert 2020-10-06 10:28:27 +01:00
baldurk 75020628a4 Only read exactly the right number of bytes for SPDB file data 2020-07-03 19:19:28 +01:00
baldurk 767f123c73 Handle debug search paths on D3D12 correctly
* We also need to unwrap the needless PDB wrapper on MS's separate debug info
  setup.
2020-06-29 18:34:07 +01:00
baldurk 01d7eaaca6 Fix assert that doesn't handle whole-array mappings 2020-06-19 14:46:00 +01:00
baldurk ad10f9ac01 Store shader profile in ShaderCompileFlags for D3D 2020-06-19 14:45:44 +01:00
baldurk d0ff7a1f64 Fix mapping for arrays with float4 stride but partial last element
* The size won't quite be a multiple of the stride when the last element isn't a
  multiple of a float4
2020-06-08 16:48:43 +01:00
baldurk b83e7516c5 Handle busted debug info coming back from FXC for arrays
* This seems to only happen in SM5.1 builds for some reason, if an array has 0
  length and 1 stride then we try to auto-calculate the stride and length when
  needed in structs.
2020-05-08 20:43:25 +01:00
baldurk 267798b240 Add boolean vartype 2020-04-24 20:14:48 +01:00
baldurk f11e6a067e Fix mapping for arrays when element is selected. Closes #1736 2020-02-24 18:10:55 +00:00
baldurk 0e0ff8714c Add fake source-mapping information for constants in debug traces
* cbuffer and input registers no longer have any names elided into them, they
  are 'raw' registers. The source mapping provides the information of where they
  come from as best as possible.
* Since we're now using source-mapping for constants, fix some source mapping
  issues with arrays, nested structs/arrays, and matrix major-ness.
2020-02-06 17:58:41 +00:00
baldurk 66cebe0a4c Refactor shader debug trace to have single mutable variable array
* Moving away from 'registers' explicitly being stored, we now have a single
  variable array where the shader representation is responsible for allocating
  it.
* In DXBC we calculate the number of each type of mutable variable (temps,
  indexable temps, and outputs) and assign slots linearly.
* We also update some naming - high-level variables aren't "locals" since they
  could be globals too, and debugging variables aren't "registers" but simply
  the variables we use for debugging which may be more complex than float4 for
  other APIs.
* The local variable matching by string name is unnecessary for this change
  but will be more useful in future after further refactors where there isn't
  a single list of variables to index into at the upper level.
2020-02-06 17:58:41 +00:00
baldurk 01461db738 Store mapping from instruction to disassembly line in shader debug trace
* This avoids having the UI need to do a scan and expecting to find
  "instruction:" on the start of a line.
* We also move the callstack to be stored per-step, and not in the line info
  mapping.
2020-02-06 17:58:41 +00:00
baldurk 68b9d223b0 Add explicit comparisons where we were implicitly checking for non-zero
* This fixes some warnings from PVS Studio, though none of these checks were
  actually wrong it's better to be explicit.
2020-01-21 18:28:56 +00:00
Daniel Craig b3d15996b2 Add headers required to build windows files without precompiled header 2020-01-13 13:02:46 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk 3dcdeb55b9 Don't force register mapping component to 0 for built-ins. Closes #1646 2019-12-19 08:56:25 +00:00
baldurk 1772222d66 Remove std::string/std::vector from shader projects 2019-12-16 18:10:31 +00:00
baldurk f68645bddc Reduce dependencies pulled in by common.h 2019-12-16 17:06:16 +00:00
baldurk 5f33403849 Switch string_utils to use rdc types 2019-12-16 17:06:15 +00:00
baldurk ff08748238 Ensure all files have trailing new-lines and enforce with clang warning 2019-12-02 20:28:05 +00:00
baldurk e53b8d82d0 In SPDB processing, try normalising filenames if we don't get a match
* Sometimes it seems like the filenames will differ between if \ is used or /,
  so try again with normalising everything to /
2019-10-24 20:16:39 +01:00
baldurk e0ea5ed3da Split out DXBC bytecode to be separate from DXBC container 2019-10-18 23:02:19 +01:00
baldurk 91c9afb655 Move reflection data into separate struct in DXBC 2019-10-18 21:33:39 +01:00
baldurk cd020007d2 Rename dxbc_inspect.* to dxbc_container.*, and DXBCFile -> DXBCContainer 2019-10-18 20:57:35 +01:00
baldurk 6cee53a36d Fix out of bounds access on invalid SPDB inline data 2019-09-16 21:27:21 +01:00
baldurk 7206a0cd25 Removing 'use std::vector' 2019-05-17 16:32:56 +01:00
baldurk e48065c96b Replace use of std::pair with rdcpair wherever possible
* Only remaining uses in our code is when we're interacting with std::map where
  it uses std::pair internally
2019-05-17 16:32:56 +01:00
baldurk a965a3a703 Remove 'using std::string'
* This will make it easier to replace std::string with rdcstr in future
2019-05-17 16:32:56 +01:00
baldurk fb333ebc9b Remove 'using std::map'
* This will make it easier to replace std::map in future
2019-05-15 14:12:17 +01:00
baldurk fbb6b23b23 Support advanced cbuffer layouts
* This includes 8/16/64-bit integers, 16-bit/64-bit floats, and scalar block
  packing
2019-02-07 15:23:06 +00:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
baldurk 2c58f4092a Support typedefs in SPDB type decoding 2018-08-07 12:42:51 +01:00
baldurk 59529d4f42 Don't infinite loop if encountering invalid characters in hlslDefines 2018-08-01 18:09:32 +01:00
baldurk 880f529fda Change mapping representation to be gather-based per variable
* Instead of having an N:N mapping of parts of variables to parts of registers,
  instead we gather everything together under each variable and it has a list of
  registers that comprise it.
* Any gaps are represented as undefined register mappings, for components that
  aren't available in any register.
2018-06-22 19:28:33 +01:00
baldurk 7f117c6356 Support builtin input variables in debugging 2018-06-22 19:28:33 +01:00
baldurk 7751a5749a Limit the section of code we search for inline sites 2018-06-22 19:28:33 +01:00
baldurk f7b5cca1ab Handle geometry shader register types 2018-06-22 19:28:32 +01:00
baldurk 8381a1955e Fix some processing of inline site encoded function annotations 2018-06-22 19:28:32 +01:00
baldurk 568cac2b65 Handle register mapping to special non-indexed builtin output variables 2018-06-22 19:28:32 +01:00
baldurk 233fbedf35 Store more type information to resolve struct members in reg mapping
* Also adds support for arrays in the type info
* We allow register mapping aliasing since it can happen during function calls
  if the same local is declared in two places - the PDB doesn't seem to add a
  gap for the 'parent' variable unfortunately.
2018-06-22 19:28:31 +01:00
baldurk 38acb9175a Indexable temp registers always start at component 0 2018-06-22 19:28:31 +01:00
baldurk 52e9a6c01d Pass through line-mapping information for each instruction to UI
* This lets the UI highlight the source line as stepping happens, as well as
  allowing stepping purely in HLSL.
2018-06-22 19:28:30 +01:00