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

417 Коммитов

Автор SHA1 Сообщение Дата
Helena Kotas a5315e009b
Update version to 1.5.2005 (#2894) 2020-05-19 17:44:39 -07:00
Vishal Sharma 983c50e78c
Update hctdb (#2886) 2020-05-14 08:02:31 -07:00
Helena Kotas f0d4419ff5
Unify hctbuild option to all use '-' (#2880) 2020-05-12 18:40:06 -07:00
Helena Kotas 1f767d7194
hcttest.cmd: Enable running standalone dxilconv tests (#2878)
Adds an option to hcttest to specify a custom set of binaries to copy to a test folder
plus a custom location of dxilconv.dll
2020-05-12 12:25:40 -07:00
Minmin Gong 5731e77620
Fix compiling issues in x86 configuration (#2875)
Fix compiling issues in x86 configuration when using a target other than x64

The script didn't set the -A parameter that vs2019 depends on in any but the x64 case

Additional simplifications and documentation to configandbuild function
2020-05-11 14:38:46 -07:00
Helena Kotas 3049f4541b
CMake customization and bug fixes (#2874)
Add new options to hctbuild that enable passing in additional arguments to cmake invocation
and also cmake customization hooks that will be included at the beginning and end of DXC's CMakeLists.txt.

Rework library search in FindD3D12.cmake and add one more library to look for.

Fix case in FindDiaSDK.cmake - fixes a cmake warning.
2020-05-11 12:23:20 -07:00
Ehsan 00a8233c30
Support for printf intrinsic (#2829)
* Frontend changes for supporting printf.

* [spirv] Add support for printf using SPV_KHR_non_semantic_info.

* Address code review comments.

* [spirv] Address SPIR-V backend comments.
2020-05-07 16:42:15 -05:00
Greg Roth a0196bcc22
Use Attribute to designate wave-sensitive intrinsics (#2853)
* Use Attribute to designate wave-sensitive intrinsics

This adds an intrinsic attribute to indicate wave-sensitivity that can
be indicated in gen_intrin_main.txt. This and other attributes are
passed along through function representations and lowerings. The
wave-sensitivity needs to be maintained specifically through SROA passes
since it is used by the CleanupDxbreak pass that comes after them.

Specifically this is done to allow extension intrinsics to indicate
wave-sensitivity, but the same mechanism is now used for builtin
intrinsics.

Most intrinsics get a mostly nameless function to represent them between
Codegen and dxilgen. This allows any that have the same prototype to
share the same function. For wave-sensitive intrinsics, they need a
different function or else the attrubute would be similarly shared with
intrinsics matching the prototype. So a minor change is made to their
function names to prevent this.

Adds testing for all these ops and a dummy extension one.
2020-04-28 18:19:51 -07:00
Xiang Li 49310e2b2c
Skip copy-in/copy-out for constant global variables. (#2836)
* Skip copy-in/copy-out for constant global variables.

* Enable copy for noinline.
TODO: analysis for global variable alias with parameter.

* Use SetVector and skip resource when copy.

* Disable mayAliasWithGlobal because optimization already covered case not replace when have alias.
When replace const global to a normal value has store, mark it non-constant.
2020-04-23 19:08:03 -07:00
Tex Riddell d3d9b19ec8
Fix WriteSamplerFeedback and Gather as gradient (or not) (#2845)
* Gather should not be considered a gradient operation.
* Mark WriteSamplerFeedback[Bias] as gradient
* Remove SampleCmpLevelZero from DxilConvergent
* Add WriteSamplerFeedback[Bias] to DxilConvergent
2020-04-22 18:37:37 -07:00
Ehsan d07ef0921e
Fix cmake params for Linux build. (#2840) 2020-04-22 14:11:57 -05:00
Greg Roth d3af7f1237
Conditionalize breaks to keep them in loops (#2795)
* Conditionalize breaks to keep them in loops

This introduces dx.break, a temporary builtin that is applied as a
condition to any unconditional break in order to keep the basic block
inside the loop. Because it remains in the loop, operations that depend
on wave operations inside the loop will be able to get the right values.

Such builtins have to be added at finishcodegen time or else clang
throws an error for an undefined function. Consequently, the creation of
these is split in two. First the branch is created with just a
constant true conditional. Then at finishcodegen, it is converted to the
result of the dx.break() builtin.

By using the result of a temporary builtin function, the optimization
passes don't touch the false conditional like they might if we started
with the global constant. 

Normal break blocks don't need this conditional, but we don't know that
at code generation. So a later pass identifies break blocks with wave
sensitive operations that depend on wave ops that are inside the loop they
are breaking out of and preserves those conditionals while removing all
the rest.

As part of dxil finalization, the dx.break() function is removed and all
branches that depended on it are made to depend on function-local
loads and compares of a global variable dx.break.cond.

The DxBreak Fixup pass depends on dxil-mem2reg. It is placed immediately
after to allow as many optimizations to go as they would without this
change in shaders that don't have any wave ops.
2020-03-30 19:02:04 -07:00
Helena Kotas cf0560b493
DxilConv update - bug fixes and pre/post convert hooks (#2760)
* DxilConv update - bug fixes and pre/post convert hooks

* Fix tests
2020-03-10 16:55:54 -07:00
Helena Kotas d7c339e989
Skip dxilconv tests when dxilconv.dll was not built. (#2750) 2020-03-05 11:52:17 -08:00
Tex Riddell cd48b34db0
Allow Wave intrinsics in DXR shader stages. (#2742) 2020-03-04 21:21:22 -08:00
Adam Yang 9bf9701ca7
Separated dead block removal to its own pass. Fixed bug where dead resources are not removed (#2744) 2020-03-04 19:04:27 -08:00
Helena Kotas b053bfbaae
Add option to hctbuild.cmd to skip building dxilconv.dll and related tools (#2739) 2020-03-03 17:25:12 -08:00
Helena Kotas ed6b888f17
Update version to 1.5.2003 (#2734) 2020-03-03 11:20:19 -08:00
Adam Yang 227c8e6f5a
Added instructions to preserve intermediate values of computations. (#2721) 2020-03-03 00:29:42 -08:00
Tex Riddell 5c4e942e86
Fix /Odump test and file cleanup in hcttestcmds.cmd (#2719) 2020-02-27 12:59:46 -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
Tex Riddell 367dd44879
Fix outputs -Fre, -Fsh, -Frs, and -Fc with -Fh (#2716)
- Fix output naming for StringRef
- Support /Fc when /Fh is provided
- Fix root sig strip flag
- Create root sig stream output
- Validate -Frs root sig output for signing with DXIL.dll
- Move outputs under valHR success branch
- Add test for -Fre, -Fsh, -Frs, and -Fc with -Fh
- Rework hcttestcmds.cmd completely: checks a lot more stuff and is way more robust,
  while being much easier to read, add to, and maintain, I hope.
2020-02-25 11:02:48 -08:00
Jeff Noyle eb33030b03
Pix mesh shader output instrumentation (#2709)
This is a pass for PIX that adds instructions to write mesh shader output (vertices and indices) to a UAV for later ingestion by PIX in order to present a view of that output.
2020-02-21 10:25:34 -08:00
Greg Roth b8bc6a6af8
Correct generated version race condition (#2704)
When run on a fast system with a lot of threading, the custom cmake
commands to generate version include information ran into a problem
because the two include files both depended on the same intermediate
file for some builds. As a result, when the first thread started writing
to it, the second thread couldn't access it if it started to try before
the first finished. The result was an empty header and no defined
version macros

By elminating the common intermediate file and giving each output file
their own intermediate file, the generation should proceed no matter how
many threads and unnecessary recompilation won't result when
regeneration results in no changes.

To facilitate this, I've added a cmake macro that handles both cases.
The peculiarities of how they are generated are all handled outside the
macro.
2020-02-18 17:31:23 -07:00
Greg Roth de35705c77
Separate generation of DXC macro version info (#2681)
The original generation of HLSL macros containing version information
used the same generated header file as the RC file. This was fine except
when building in xbtools where the version information in the RC is
overridden to match the GDK.

To maintain the DXC macros as communicating the version of the DXC
component to better enable workarounds based on that information, the
same generator script is used, but the header file is separate and
doesn't abide by the fixed version location provided via cmake defines.
This way it will always contain DXC information while the RC file can
continue to contain the version information as it did before.

To allow for the case where the headers are not the same, a preliminary
version.gen file is created according to the dxc version requirements
and copied to the dxc header. In most cases, it is copied to the RC
header as well. When an explicit path is specified for the fixed
version, the DXC version uses the "offficial" generated header and the
RC file gets the version specified by the file in the given location.

Reverts the changes to the target_version_vertex.hlsl test since it
should always succeed now.
2020-02-14 17:26:49 -07:00
Xiang Li 8156151a58
Update name and fix nonuniformindex. (#2697)
* Add nonUniformIndex for CreateHandleFromHeap and change name to CreateResourceFromHeap.

* Check group when lower CreateResourceFromHeap.
2020-02-14 15:24:36 -08:00
Xiang Li 91fe12f0eb
Add GetResourceFromHeap. (#2691)
Add GetResourceFromHeap for hlsl.
For Dxil, add CreateHandleFromHeap and AnnotateHandle.

All handles ( createHandle, createHandleForLib, createHandleFromHeap ) must be annotated with AnnotateHandle before use.

TODO: add AnnotateHandle for pix passes.
            cleanup code about resource.
2020-02-12 21:50:02 -08:00
Helena Kotas 912c37dbd5
Enable parallel build by default (#2689) 2020-02-11 20:32:34 -08:00
Helena Kotas aab170028b
When in detached head state do not include "HEAD" in product version string (#2690) 2020-02-11 16:34:16 -08:00
Helena Kotas a42ffbf491
DXBC to DXIL Converter + unit tests (#2685)
Includes dxilconv-specific DXIL optimization passes added to opt.exe tool.
2020-02-11 12:07:26 -08:00
Helena Kotas a7d6beba00
Update version to 1.5.2002 (#2684) (#2686) 2020-02-10 14:07:43 -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
Greg Roth d9242790d4
Add HLSL macros with version information (#2665)
* Add HLSL macros with version information

Adds three sets of version information as defined macros available
to the shader.

The DXC version is included as __DXC_VERSION_{MAJOR|MINOR|RELEASE|COMMITS}
The values of these are set at compile time and derived from version.inc
RELEASE and COMMITS information varies according to the criteria
described in gen_version.py.

The HLSL Version is included as __HLSL_VERSION. It may be taken from
the -HV argument with which dxc was invoked, derived from other
arguments, or the default.

The shader target stage and version information is taken from the
-T argument with which dxc was invoked. For the stage, defined
constants representing each stage are defined at compile time that
correspond to the enum values used internally. The shader stage
specified by -T is determined at runtime and set to the corresponding
enum value. The major and minor versions are similarly derived from
the -T argument at runtime.

The runtime defines are set in InitializeStandardPredefinedMacros()
This allows them to be set just once and the same way for any way
that dxc is invoked including testing.

This makes some changes to how the version.inc file is generated and
found in cmake files in order to generate it regardless of the need
for a .rc resource file as it was before.

A series of hlsl tests are added that test for the defines presence
and values in order to add versus subtract with checks for the adds.
Since many of the defines are determined by arguments at runtime, a
few different tests were needed, but as much consolidation as possible
was done to reduce the number of individual test runs.
2020-01-30 16:54:59 -07:00
Greg Roth 656308dce4
Correct official versioning in master branch (#2658)
According to the description at the top of gen_version.py and the
commit that introduced it, the "Official build" versioning is meant
to add 10000 to the number of commits since the last official release
when the build is in the master branch. However, because of the use
of "is" instead of "==", the comparison between the variable and
the string literal in the python script was never succeeding. The
"is" operator only succeeds when it compares two variables that
have been assigned the same variable or one has been assigned to
the other. For comparisons of contents, "==" should be used.
2020-01-23 14:23:09 -07:00
Greg Roth 87fa34ec2b
Clear Cmake defines on reuse of hctbuild (#2659)
After initial generation, subsequent invocations of cmake will
only alter the defines that are specified by that command. Any
defines that were set previously retain their earlier settings
by being stored in the CMakeCache.txt in the build directory.

hctbuild.cmd allows specifying certain defines when arguments are
passed to it, but many of these do not allow resetting the defines
they set. So if you define an official versioned build, every
subsequent build with use the official version unless the cmake
cache is edited or the whole build directory is wiped clean. This
is true of several other settings.

This change sets the defines hctbuild cares about every time it is
invoked regardless of arguments. If the official build is specified
the official define is set to ON. If it isn't, it is set to OFF.
This way these flags can easily be switched on the same build dir.
2020-01-23 12:22:31 -07:00
Xiang Li 2f440d0462
Move wave sensitive check from validation into DxilValidateWaveSensit… (#2640)
* Move wave sensitive check from validation into DxilValidateWaveSensitivity pass.
2020-01-10 13:43:01 -08:00
Xiang Li 9e5bd8b870
Bump to shader model 6.6 (#2631) 2020-01-06 11:04:44 -08:00
Xiang Li 9c89a1c2c6
Make shader model related code generated. (#2629)
* Make shader model related code generated.
2019-12-30 12:37:07 -08:00
Helena Kotas d0e9147ab8
Update version to 1.5.1911 (#2606)
* Update version to 1.5.1911
2019-11-27 13:27:46 -08:00
Tex Riddell 540104fc0e SV_ShadingRate should be allowed in MSPOut
- removed _65 from MS stages, since that's handled by the shader target.
2019-11-20 11:58:17 -08:00
amarpMSFT 42a511cb77
Add missing intrinsics to query InstanceContributionToHitGroupIndex via RayQuery (#2578)
* Add Candidate_ and Committed_InstanceContributionToHitGroupIndex() intrinsics to RayQuery object
2019-11-07 13:16:36 -08:00
Helena Kotas 07a970d3c1
Update version for 1910 release branch (#2552) 2019-10-25 13:59:16 -07:00
Tex Riddell 6357448a38 Update type validation to support legal UDT case.
New Rules:
outer type may be: [ptr to][1 dim array of]( UDT struct | scalar )
inner type (UDT struct member) may be: [N dim array of]( UDT struct | scalar )
scalar type may be: ( float(16|32|64) | int(16|32|64) )

- Disallow pointers to pointers, and pointers in structs
- Disallow multi-dim arrays at top-level, but allow within struct
2019-10-22 09:48:19 -07:00
Xiang Li 9610b51caa
Decide unsigned for atomic on parameter 0. (#2533) 2019-10-17 23:15:53 -07:00
Adam Yang 97ec60accd
Added pass to remove regions with no escaping values or side effects. (#2508)
* Erase dead region

* Pass dependencies

* Simpler heuristic, only checking that Begin dominates End and End post dominates Begin

* Small cleanups. No longer iterating whole block to find PHIs

* A few optimizations. Fixed infinite loops caused by self-loops
2019-10-08 15:45:22 -07:00
Vishal Sharma bd57c4413e
Fix handling of boolean expressions in Wave Intrinsics (#2502) 2019-10-02 22:11:44 -07:00
Tex Riddell 2a01c58f73
Fix RayQuery allocation for CSE, DCE, statics, arrays, and lifetimes (#2469)
Fixes problems like:
- extra AllocateRayQuery calls, or improper location (for lifetime)
- proper array support
- static global RayQuery

This RayQuery allocation changes:
- Add a constructor to RayQuery
- Set init sequence to use constructor in InitializeInitSequenceForHLSL, just for RayQuery
- For array: modify EmitCXXAggrConstructorCall to
  - loop over index instead of pointer to allow SROA of RayQuery struct
  - mark the loop as HlslForceUnroll
- Add hidden flag for HL intrinsics to allow internal intrinsic not produced
  by HLSL directly - mangle name so it can't be matched during parse.
- Add hidden HL AllocateRayQuery intrinsic
- Translate constructor call on ptr to HL AllocateRayQuery intrinsic call producing handle i32 during FinishCodeGen
- Translate RayQuery ptr to load i32 handle value for intrinsic methods during SROA_HLSL
- Flatten RayDesc for TraceRayInline
  (otherwise /Od fails validation since RayDesc type may still be present)
- No longer skip RayQuery for SROA_HLSL
- Update lowering for AllocateRayQuery, i32 handle, and flattened RayDesc
- Remove ReadNone attribute from AllocateRayQuery to prevent incorrect CSE optimizations
- Manually cleanup unused RayQuery allocations
2019-09-27 12:50:43 -07:00
JohnMcPMS c3862216b8 Enable non-C VS installs (#2463)
* Move to use vswhere for 2017/2019 and add const to make 2019 STL happy

* Add hardcoded 2017 paths back as vswhere was not in 2017 from the beginning
2019-09-17 17:13:38 -07:00
Tex Riddell 9e16e99895
Change SV_CullPrimitive to NotPacked (#2462) 2019-09-17 12:38:15 -07:00
Helena Kotas a04a0be741
Update version for 1909 release branch (#2454) 2019-09-10 09:24:24 -07:00
Alex Paige cad61c1978 Adding test fixes and more support for SM6.5 WaveMultiPrefix functions (#2421)
* Adding test fixes and more support for SM6.5 WaveMultiPrefix functions

1)	Ensure wave lane-id’s are sorted when accumulating result
2)	Fix made for HLSL in ShaderOpArithTable.xml to ensure the input aligns with what is being tested
3)	Added support for the “UBit” version for all of these tests.
2019-08-30 07:14:11 +02:00
Tex Riddell 892765cc4b Default to stripping reflection from DXIL and fix a bunch of fallout.
Two test options, -Qstrip_reflect_from_dxil and -Qkeep_reflect_in_dxil
for making tests work with reflection removed, since many tests are relying
on main module disassembly-reassembly between test phases and reflection
metadata will no longer be present there.  The strip option is for the
few cases where tests don't want the reflection kept in DXIL by default.

Validator no longer requires function annotations for no reason.

Fix places where remove global hook was not being called when functions
were removed manually from the list.

StripReflection now deletes function annotations, unless targeting lib or
old validator that required them.  Preserve global constructor list and
add annotation for 1.4 validator.  The global hook fixes were required
here, otherwise annotations would refer to dead functions during linking.
Struct annotations may not be removed in library case when they still need
translation to legacy types.

Allow missing struct annotation when not necessary to upgrade the layout.

Preserve usage in reflection by upgrading the module, emitting metadata,
cloning for reflection, then restoring validator version and re-emit
metadata.

Fix size for 16-bit type for usage and reflected size.

Make various batch reflection tests require validator 1.5, since these
tests rely on module disassembly->assembly, which will not preserve extra
usage metadata for reflection in 1.4.

Include reflection part in IDxcAssembler, but don't strip from module,
since there are no options to prevent this from breaking a lot of tests.

Don't strip reflection from offline lib target.
2019-08-19 00:39:39 -07:00
czw831024 5fca2b49e1 add DXIL tests to verify mesh shader's output size and payload plus output size 2019-08-01 12:21:45 -07:00
Helena Kotas 8180eadfea
Cleanup - remove packages.config and nuget.config (#2379) 2019-08-01 21:19:36 +02:00
Tex Riddell c012b4d0f5
Fix intrinsic arguments for WriteSamplerFeedback operations (#2387)
- Align coord dimensions with Sample for future flexibility and alignment
- Fix ddx and ddy arguments to support the correct number of dimensions
- Rewrite lowering, using SamplerHelper
- Clean up SampleHelper a bit, adding additional asserts/checks
- Set components to zero for default offset, not undef
2019-07-30 18:34:19 -07:00
Helena Kotas e31a098452
Enable build without git enlistment (#2386) 2019-07-30 23:40:42 +02:00
Tex Riddell 2facceae0b
Store mesh payload in function props, fix Wave/Quad/Barrier validation (#2361)
- Compute mesh payload size before final object serialization
  - During CodeGen for MS based on payload parameter
  - During CollecShaderFlagsForModule for AS based on DispatchMesh call
- Store payload sizes in corresponding funtion properties, serializing
  these properly for HL and Dxil Modules
- Use payload sizes from function props for PSV0 data during serialization
- Validate measured and declared payload sizes, don't just fill in
  properties during validation
- Fix Wave/Quad allowed shader stages, enabling Quad* with CS-like models
- rename payloadByteSize members to payloadSizeInBytes
- Add GetMinShaderModelAndMask overload taking CallInst for additional
  detail required to produce correct SM mask for Barrier operations
2019-07-24 10:22:28 -07:00
Tristan Labelle 0332b4bd90
Update FeedbackTexture2D types to be templated (#2347)
- Update the HLSL syntax from FeedbackTexture2DMinLod to FeedbackTexture2D<SAMPLER_FEEDBACK_MIN_MIP>
- Update DXIL to only have two UAV types for FeedbackTexture2D[Array] and use an extra metadata field to distinguish between the sampler feedback type.
2019-07-23 12:27:05 -07:00
Helena Kotas ec912b2ec9
Change WaveMultiPrefix test data to be generated by hctdb_test.py (#2334)
The tests were manually added to ShaderOpArithTable.xml in PR #1867,
but ShaderOpArithTable.xml should be generated by hctdb_test.py script.
No actual changes to the test data, just the order of the tests is different
because of rearranging done by the script XML processing.

Added a check for shader model 6.5 so the tests will be skipped on lower
shader models.
2019-07-22 18:55:05 -07:00
Xiang Li c0e692bc0b
Support vs2019 x64 build. (#2351) 2019-07-17 15:00:09 -07:00
Tex Riddell dc835b8892 Set AllocateRayQuery to ReadNone to allow DCE on unused RayQuery alloc 2019-07-12 12:11:52 -07:00
Tex Riddell afbe50930c Merge rayquery into merge-dxil-1-5 2019-07-11 17:20:38 -07:00
Amar Patel (GRAPHICS) 4b4d5ca5f6 Merged PR 122: Add GeometryIndex() to any hit, closest hit, and intersection shaders, with raytracing_tier_1_1 feature bit 2019-07-12 00:14:59 +00:00
Tex Riddell cd9fee2291 Merge rayquery into merge-dxil-1-5 2019-07-11 17:06:38 -07:00
Tristan Labelle b7868f8081 This change implements the `FeedbackTexture2D[Array](MinLOD|Tiled)` types in HLSL and the backing `WriteSamplerFeedback[Bias|Level|Grad]` DXIL intrinsics. 2019-07-11 16:51:16 -07:00
Sahil Parmar 968fe41136 Merged PR 116: Add support for HLSL Meshlets
This PR adds support for new HLSL mesh and amplification shaders.
2019-07-11 20:19:23 +00:00
Amar Patel (GRAPHICS) 6bac49fd65 Merged PR 120: Adding RayQuery intrinsics 2019-07-11 13:49:03 +00:00
Tex Riddell 3b08f59edb Update version for 1907 release branch 2019-07-10 11:32:12 -07:00
Tex Riddell 2209844cda Add RayQuery object, TraceRayInline method + template arg annotations 2019-07-09 18:55:55 -07:00
Tex Riddell b6d67a3851 Fix validation for legacy cbuffer layout
- base of struct should always be aligned - or internal bug
- offset for array member must always be aligned - (new) validation error
- alloc and verify struct layouts even when not array field
- out of bound check would have missed OOB on last array element
2019-07-05 18:27:50 -07:00
Helena Kotas bf94df70ca
Enable detection of SDK version and path from environment variables (#2305) 2019-07-02 16:49:39 -07:00
Tristan Labelle d1eab936a1
Support intrinsics taking Vector3 args. (#2310) 2019-07-02 13:10:45 -07:00
Tristan Labelle c0cf2018e6
Enable validation of rawbufferload/rawbufferstore (#2300)
The validation code was written for these but never ran due to this omission.
2019-07-01 18:45:53 -07:00
Helena Kotas 5edbabb2b1
Generate new version for each DX Compiler build (#2200)
Added generating of new version for each DX Compiler build. 

There are 3 kinds of version:
1. **Official build**
Built by using `hctbuild -official`. The version is based on the current DXIL version, latest official release and a number of commits since then. The format is `dxil_major.dxil_minor.release_no.commit_count`. For example a current official version would be something like `1.5.1905.42`. The latest release information is read from `utils\version\latest-release.json`. The `1905` corresponds to `dxil-2019-05-16` release branch and `42` is the number of commits since that release branch was created. For master branch the `commit_count` will be incremented by 10000 to distinguish it from stabilized official release branch builds. So the current official version of master would be someting like `1.5.1905.10042`.

2. **Dev build**
Build by using `hctbuild` with no other version-related option. The format is `dxil_major.dxil_minor.0.commit_count` where commit_count is the number of total commits since the beginning of the project.

3. **Fixed version build**
Build by using `hctbuild -fv`. Enables overriding of the version information. The fixed version is read from `utils\version\version.inc`. Location of the version file can be overriden by `-fvloc` option on `hctbuild`.

In addition to the numbered version the product version string on the binaries will also include branch name and last commit sha - `"1.5.1905.10042 (master, 47e31c8a)"`. This product version string is included in `dxc -?` output.
2019-06-28 15:16:34 -07:00
Patrice Vignola 4386f9465b Separate Dot instrinsic tests (#2247) 2019-06-10 10:40:09 -07:00
Adam Yang e32833cac7
Loop count for all trivial form loops. Mem2Reg only when necessary. (#2250)
* Comments and small adjustments

* Deleting loops from scalar evolution correctly

* Better error/warning message
2019-06-07 18:40:43 -07:00
Helena Kotas 53e49d7289
Move nuget.config and packages.config to hct directory (#2225)
Remove files that are no longer needed and delete pkges directory
2019-05-31 13:08:41 -07:00
Helena Kotas bbdf4ee1fe
hctstart.cmd - look for Python 3 instead of Python 2 if python.exe is not on the path (#2224) 2019-05-31 13:07:57 -07:00
Adam Yang 2dec1cd0df
Putting debug info in PDB container (#2215) 2019-05-29 16:29:58 -07:00
Tex Riddell 04fb1d6468 Merge remote-tracking branch 'ms/master' into dxil-1-5 2019-05-22 15:34:19 -07:00
JasperNV cc64a35288 hctgettaef: Update for Python 3 (#2195)
Python 2 was dropped from the project, but this utility still required it.
2019-05-21 11:01:45 -07:00
Tex Riddell ba668cf13e Merge remote-tracking branch 'ms/master' into dxil-1-5 2019-05-20 11:49:53 -07:00
Tristan Labelle f89e3b7150
Add support for RWRawByteBuffer.Store<T> (#2176)
Adds support for templatized RWRawByteBuffer.Store<T>. To avoid SROA making us lose the original layout of any struct arguments, a new pass runs before SROA and breaks down such cases into per-element stores. So better be careful with the likes of buf.Store(0, (int[65536])0);...
2019-05-09 11:51:38 -07:00
Helena Kotas df954a7d48
Add parallel build option to hctbuild.cmd (#2167) 2019-05-03 13:16:04 -07:00
Tex Riddell 638d988e8f
Fix issues with -Qstrip_reflect and -Qstrip_debug (#2164)
-Qstrip_reflect would reserialize the root signature, leading to
validation failure #2162.  Fixed by moving root sig to writer to clear
from module and prevent re-serialization to metadata.

Fixed -Qstrip_debug with -Zi and no output location still embeding
debug module.
2019-05-03 08:06:31 -07:00
Helena Kotas 4ee998c89f
Add option to hctbuild.cmd to disable audible announcements (#2155) 2019-04-30 21:47:54 -07:00
Tex Riddell 47d2600312 Emit warning for auto-embed behavior and update tests 2019-04-24 17:45:58 -07:00
Tex Riddell 69882a0394 Add -Qembed_debug, don't embed debug info by default
- New -Qembed_debug is required to embed PDB in shader container
- -Zi used without -Qembed_debug will not embed debug info anymore,
  and will issue a warning from CompileWithDebug().
- When compiling with Compile() and -Zi, -Qembed_debug is assumed
  for compatibility reasons (lots of breaks without it)
- In dxc and CompileWithDebug() -Fd implies -Qstrip_debug
- Debug name is based on -Fd, unless path ends with '\', meaning you
  want auto-naming and file written under the specified directory
- Debug name always embedded when debug info used, or -Fd used
- -Fd without -Zi just embeds debug name for CompileWithDebug(),
  still error with dxc, since it can't write to your file.
- If not embedding debug info, it doesn't get written to the container,
  only to be stripped out again.
- Fix padding for alignment in DebugName part.
- Default to DebugNameForBinary instead of DebugNameForSource if no
  DebugInfo enabled

- Also fixed missing dependency on table gen options from libclang
2019-04-19 19:57:25 -07:00
Tex Riddell faacd80b74
Allow clip/cull elements to be declared as array [2] (#2109)
* Allow clip/cull elements to be declared as array [2]

- This approach fixes validation and packing to handle this case.
- There could be implications to runtime ViewID validation
- fix some issues found in packing related to rowsUsed result from Pack
  functions.  Make these return 0 on failure, instead of startRow.
- Split PackNext into FindNext and PackNext that uses it for greater
  flexibility.
2019-04-10 17:37:47 -07:00
Helena Kotas f7a93def0c
[pkges] Move Pkges files to utils\pkges; remove email script (#2087)
Move Pkges file to utils\pkges for consistency with directory structure in other repos.
Remove email formatting script and template.
2019-04-01 10:18:14 -07:00
Tristan Labelle 3527762fd0
Allow optimizations to eliminate phis on undef resources before considering them errors
Some large shaders exhibit a behavior where phi nodes are created for resources, in which one of the possible incoming values is undef. This gets cleaned up later such that there are no undef resources left. However the fail-undef-resources pass has already failed compilation by that point. The fix is to change that pass to invalidate-undef-resources and replace the undefs with a special invalid value, such that we can produce an error later if still necessary, when optimization passes have been run such that temporary undef resources have been eliminated.
2019-03-18 14:27:31 -07:00
Tristan Labelle 9559442f3f Renamed from "poison" to "invalidate" 2019-03-18 12:41:07 -07:00
Helena Kotas 9d367d8649
[Pkges] Add extension point to status email (#2033) 2019-03-15 11:41:17 -07:00
Helena Kotas 139b292fa0
[Pkges] Remove unnecessary directory (#2025) 2019-03-12 16:59:39 -07:00
Tristan Labelle 430102b952
Isolate test file dependencies for dxilcontainer, linker and cmd tests. (#2014)
Those tests reach into HLSL, CodeGenHLSL, Samples and even quick-test directories to find the files they need. With this change, I move or copy files around to make sure that these test files are attributable to their consumer. I copied rather than moved files only in the case where a test in code explicitly reached into quick-test or Samples, because that essentially means that the file serves two different tests since they are also run as batch.
2019-03-12 13:40:33 -07:00
Tristan Labelle 7c1f9f01e9 The fix. 2019-03-06 15:49:34 -08:00
Helena Kotas d713201162
Update drop path variable and formatting (#2007) 2019-03-06 13:36:58 -08:00
Helena Kotas 5c2ce68a06
[PkgEs] Email formatting script (#2001) 2019-03-05 16:03:31 -08:00
Tex Riddell 7f7a2f1cd1
Merge pull request #1969 from Microsoft/19h1-rel
Merge 19h1-rel to master
2019-02-25 19:46:55 -08:00
Justin Holewinski bc72038998 Add support for WaveMatch and WaveMultiPrefix<Op> (#1867)
These new DXIL instructions are added to SM 6.5. The valid operations
for <Op> are:

    - BitAnd
    - BitOr
    - BitXor
    - CountBits
    - Product
    - Sum

In HLSL, these are exposed as:

    uint4 WaveMatch(<type> val)
    <type> WaveMultiPrefixBitAnd(<type> val, uint4 mask)
    <type> WaveMultiPrefixBitOr(<type> val, uint4 mask)
    <type> WaveMultiPrefixBitXor(<type> val, uint4 mask)
    uint WaveMultiPrefixCountBits(bool val, uint4 mask)
    <type> WaveMultiPrefixProduct(<type> val, uint4 mask)
    <type> WaveMultiPrefixSum(<type> val, uint4 mask)

In DXIL, these are exposed as:

    [BitAnd,BitOr,BitXor,Product,Sum]
    %dx.types.fouri32 @dx.op.waveMatch.T(i32 %opc, T %val)
    T @dx.op.waveMultiPrefixOp.T(i32 %opc, T %val, i32 %mask_x,
                                 i32 %mask_y, i32 %mask_y, i32 %mask_z,
                                 i8 %operation, i8 %signed)

    [CountBits]
    i32 @dx.op.waveMultiPrefixBitCount(i32 %opc, i1 %val, i32 %mask_x,
                                       i32 %mask_y, i32 %mask_y,
                                       i32 %mask_z)

Scalarization of vector types occur as per the existing wave intrinsics.
For WaveMatch, the match is performed on each scalar and the results
are combined with bitwise AND. For WaveMultiPrefix, the operation is
performed on each scalar and combined into an aggregate.
2019-02-25 14:42:43 -08:00