Граф коммитов

32 Коммитов

Автор SHA1 Сообщение Дата
Jeff Noyle ac5630e8e6
Fixes for adding -Od (#3292)
A customer couldn't recompile their large shader with -Od for debugging in PIX.
-The symbol manager would quit early, so now it continues to discover other variables
-The value-to-declare pass was adding an incorrect debug location, which tripped up the verifier.
2020-12-03 16:36:51 -08:00
Jeff Noyle b85f1affc6
impl (#3200)
Co-authored-by: Jeff Noyle <jeffno@ntdev.microsoft.com>
2020-10-13 17:09:09 -07:00
Jeff Noyle 7e92bbc072
PIX value-to-declare pass: subprogram type members (#3140) 2020-09-17 09:17:51 -07:00
Jeff Noyle fcbf3766cc
PIX: Rely on debug info for struct packing (#2883)
Previously, this fragment iterator would attempt to figure out offsets for each struct fragment by itself. This was error-prone and unnecessary: the debug info already has this information.
In particular, the old code didn't handle natural alignment and the possible dead space between fragments that this might create.
Unfortunately the debug info is pretty hard to parse: things with the "member" tag are a few layers of type above the basic type that they actually represent, and contained structs' members have offsets relative to the start of that contained struct, not to the start of the whole struct. Both of these necessitate a recursive approach.
Subsequent work: run these tests with and without -enable-16bit-types and with different optimization levels. The latter is blocked behind bugs in the dbg.value-to-declare pass.
2020-05-13 17:31:22 -07:00
Jeff Noyle ed3d0ee0bf
Missed a commit from previous PR: Check for not-an-int (#2844)
Protect against null for subroutine params (dwarf type deref)
Fix pixtest build
2020-04-22 14:40:08 -07:00
Jeff Noyle 625c98fba3
PIX: Annotate structs for shader debugging of MS->AS payloads (#2826)
Three classes of fixes:

First a couple of trivial fixes in the DxcPix storage class, for >1-d arrays and embedded types.

Second, the addition of a new fragment iterator (now renamed "member iterator") that knows how to traverse the full structure of a struct, enabling the DxcPix* code to know bit offset and size for contained types.

Third, fixes to the numbering pass to know how to find alloca offsets via the various GetElementPtr statements that result when addressing struct members.

Lastly, a whole bunch of unit tests. Cuz this was really hard.

Remaining to do, as noted in the tests: the presence of a pointer-to-pointer type like floatNxM results in dbg.declare instructions not being emitted for structs. These tests (and perhaps some of the code) will need to be revisited if/when this is fixed.
2020-04-22 10:00:21 -07:00
Jeff Noyle 35769dabe1
Pix source-to-instruction offsets (#2835)
This is a direct implementation of a new API for PIX that shortcuts the large and unwieldy (and not-really-working-well) DIA equivalent to find the set of instructions that correspond to a given source location.
2020-04-17 17:21:42 -07:00
Jeff Noyle 816f3141d4
PIX: Add new API to retrieve info about compilation options (macros, target profile etc) (#2758)
This lets PIX call a much better-matched API than DIA to retrieve these things.
2020-03-10 13:11:55 -07:00
Tex Riddell 713c80ce4e
Rename 'module' to 'hModule' for C++20 compat (#2667)
* Rename 'module' to 'hModule' for C++20 compat
* Replace a bunch of unintended uses of new keyword 'module' with 'mod'
2020-03-01 18:12:31 -08:00
John Porto 63a3b45067
Adds the DxcPixDxilDebugInfo interface and friends. (#2715)
* Adds the DxcPixDxilDebugInfo interface and friends.

* Modifies the entrypoints to require InParam/OutParam for pointers, as well as CheckNotNull them

* Removes S_FALSE for happier Jeff

* Fixes broken test

* returns E_POINTER for nullptrs

* Returns S_FALSE from UnAlias for non-aliasing types.

* fails GetName for arrays

* Addresses CR comments
2020-02-25 17:50:23 -08:00
Adam Yang bfb8143b27
hlslFlags is now a null-terminator separated list of compiler options (excluding target, entry, and defines) (#2698) 2020-02-13 19:50:17 -08:00
Helena Kotas 5d741a0279
HLSL test infrastucture and other refactoring and helper classes (#2682)
* HLSL test infrastucture and other refactoring

Refactor common test infrastructure code into HLSLTestLib
Enable invocation of fxc and other executables via // RUN: commands in test files
Add latest d3dx12.h to include/dxc/Support and remove two other outdated copies
Improve DXIL container header validation on load
New helper classes DxilContainerReader and FixedSizeMemoryStream
Move LoadSubobjectsFromRDAT to DxilSubobjects.cpp

Co-authored-by: Greg Roth <grroth@microsoft.com>
2020-02-06 21:49:21 -08:00
Tex Riddell 45deef90b0
Add missing UTF8 for source and output filenames (#2674)
* Add missing UTF8 for source and output filenames

- These need to be converted back to UTF-16 after argument processing for
  a couple APIs and CA2W constructors were missing CP_UTF8 for the input
  encoding from the utf-8 argument strings.

* Add CP_UTF8 to more CW2A and CA2W uses
2020-02-06 18:23:31 -08:00
Tex Riddell f4965b71dd Integrate dxcapi v2 and other changes from internal (#2575)
* Integrate changes from internal.

- dxcapi v2
- new dxc options
- DxilValueCache
- PDB and NoOpt improvements
- noop / llvm::donothing() support

* Update dxrfallbacklayer for dxcapi internal changes

* Reorder diag block based on whether pDiag is set first.

* llvm::donothing() requires dxil 1.6 / SM 6.6 for now, lib as well.

* Fixes for spir-v, non-VC compiler and non-Windows builds

- DEFINE_CROSS_PLATFORM_UUIDOF for new interfaces
- add SAL annotations
- turn output argument validation for -P into warning
- handle warnings without concatenating them to main output
- update spirv preprocessing and compilation paths
- return E_NOTIMPL from IDxcUtils::CreateReflection
- cleanup: DxcContainerBuilder back to uft8, DxcTestUtils: remove comment

* Fix some warnings from clang/gcc.

* Fix unicode conversion problems on linux, where sizeof(wchar_t) == 4

Note this is an intermediate fix.
On linux, what we are calling utf16 is actually a wide string
that's probably utf32.  This change fixes issues introduced by
the new interface changes so things are consistent and pass tests.

A future fix should correct the encodings so they are correctly labeled
on platforms where wchar_t doesn't mean UTF16.

* Return false for IsBufferNullTerminated when CP_ACP.

One test for Disassembler was crashing because it created a pinned blob
with a size of 1 << 31 + 1 without actual memory backing this.  The
IsBufferNullTerminated would attempt to see if this was null terminated,
causing AV.

This change also removes CP_UTF8 from this test when it was creating
binary blobs, not UTF8 text blobs.
2019-11-13 16:16:45 -08:00
Adam Yang 3c20b0d808
Fixed dia requiring zero termination in binary bitcode and crashing when emitting warning. 2019-11-12 22:24:07 -08:00
Jeff Noyle 8ea40f8604
PIX DIA: Use min/max RVA of variable's uses as live range (#2548) 2019-10-24 15:54:57 -07:00
Jeff Noyle 73e2229bf3
PIX: (DIA front-end): Use module entry point as backup iteration start #2527 2019-10-16 13:56:00 -07:00
Adam Yang da5f591736
Fixed very long loop when subrange is negative (#2486) 2019-09-24 17:58:06 -07:00
Adam Yang 56222b94be
Fixed a failure with LexicalBlockFile (#2453) 2019-09-09 09:34:39 -07:00
Jeff Noyle d7e448455c
calculate offsets for embedded arrays (#2444) 2019-09-06 15:28:46 -07:00
Tristan Labelle 02ac47c26d
Replace std::make_unique with llvm::make_unique (#2367) 2019-07-25 18:32:10 -07:00
John Porto 3440e968fe
DxilDia bugfixes: (#2327)
1) avoids leaking exceptions during symbol initialization
2) returns E_FAIL when the scope for a local variable is not found
3) uses getInlinedAtScope when searching for the local variable's scopes.
2019-07-10 10:55:54 -07:00
Adam Yang 4070005bfc
Fixed a random crash because of invalid pointer (#2262) 2019-06-14 15:40:18 -07:00
Adam Yang 298076a941
An invalid dbg declare doesn't automatically fail everything. (#2252) 2019-06-11 16:23:54 -07:00
Adam Yang 2dec1cd0df
Putting debug info in PDB container (#2215) 2019-05-29 16:29:58 -07:00
John Porto 0e704e1ea2
DxilDia uses factories (not lambdas) for symbol creation (#2177)
* Modifies DxilDia's to use factories instead of lambdas for creating symbols

DxilDia used to hold a vector of lambdas -- constructors -- for the symbols
it knew about. When the user requested a symbol, said constructor was to be
invoked, creating a brand new symbol.

C++ lambdas can be hard to debug (i.e., how does one inspect the lambda's
state?), so the library is modified to hold a vector of factories -- i.e.,
objects with fields and a CreateSymbol method.

* fixes typo when creating Typedef symbols

* caches the VarInfo when creating the LocalVariable factories
2019-05-10 11:00:24 -07:00
Tristan Labelle b5f9280fa2
Remove shell api dependency. (#2141)
StringCompareOrdinal lives in kernel32.dll, better than previous implementations which pulled functions from user32.dll or shlwapi.dll.
2019-04-24 14:22:36 -07:00
John Porto 45acc2f87e
replaces StrCmpW/StrCmpIW with CComBSRT::operator != (#2133) 2019-04-19 12:36:12 -07:00
Tristan Labelle 41ef8bd2c8
Remove DXIL Dia's assert which makes assumptions about dwarf bit pieces. (#2094)
In the general case, bit_pieces might be only for part of a register or register range. For example a half in a VGPR or a SGPRx4 for which we only have debug info for the first register.
2019-04-01 15:43:22 -07:00
John Porto d432a02f77
Implements DIA Interfaces for HLSL variable-value mapping. (#2050) 2019-03-19 11:46:10 -07:00
John Porto 0862ca421f
[DxilDia] Splits the implementation into multiple files (#1793)
[DxilDia] Splits the implementation into multiple files
2018-12-20 04:12:16 -08:00
John Porto 8e3fc02435
moves Dxil DIA support out of dxcompiler (#1772)
* moves Dxil DIA support out of dxcompiler

* fixing travis
2018-12-13 19:59:08 -08:00