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

417 Коммитов

Автор SHA1 Сообщение Дата
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
Tex Riddell 5cdb20b28e Clean up addrspacecast from final shader code
- add addrspace stress test and addrspace inst test
- add ll test for cleanup pass targeting paths that may be difficult to
  hit from HLSL
- fix handling of base-class bitcast cast for structured buffer
- handle addrspacecast in SimplifyBitCast during CodeGen
2019-02-24 02:36:22 -08:00
Helena Kotas 7e5c75a40e
Adjust the expected precision for Sin/Cos/Tan tests for 16-bit types. (#1921)
The old test values and precision was the same as the 32-bit variants of the tests. This does not work for 16-bit floating point numbers and especially for trigonometric operations.
2019-02-12 17:16:12 -08:00
Xiang Li 27a7bf4b0b
Add a simple GVNHoist to reduce dxil code size. (#1897)
* Add a simple GVNHoist to reduce dxil code size.

* Add res_may_alias option.
2019-01-31 14:21:54 -08:00
Xiang Li c2e744dcf4
Enable sroa for hlsl to remove static indexing array. (#1893) 2019-01-28 16:26:22 -08:00
Tristan Labelle 0e7cd88756
Support directory paths with hcttest file-check. (#1838)
The ShaderCompatSuite and Unroll tests randomly supported being used to batch run file-check on directories. This change rather updates hcttest file-check to support directories as well as individual files.
2019-01-14 07:51:47 -08:00
Helena Kotas 40b8a85594
Add Package ES build config files and scripts (#1834) 2019-01-11 11:01:59 -08:00
John Porto 0b192a0aa0
Adds a PIX pass for assigning register IDs to dxil values. (#1827)
* Adds a PIX pass for assigning register IDs to dxil values.
2019-01-10 08:09:43 -08:00
Tristan Labelle 20c61bc577
Fixed sign and abs intrinsics on unsigned operands. (#1825)
Makes abs(uint) a no-op and sign(uint) equivalent to uint != 0, matching the correct FXC behavior.
2019-01-08 08:05:03 -08:00
Xiang Li 2a8865470f
Add pass for dxil-loop-unroll in hctdb. (#1815) 2018-12-30 19:00:43 -08:00
Helena Kotas 12efa402cf
Update hctstart.cmd to be able to find CMake from VS Professional and Enterprise (#1699) 2018-11-14 19:57:01 -08:00
Tristan Labelle 1a527de97c
Added support for custom include paths when compiling with /P (#1666)
The include paths were not piped as preprocessor command args. Includes a test.

Fixes #1636
2018-11-05 13:20:26 -08:00
Helena Kotas b7d1c195c5
Add root signature flags (#1663)
* Add root signature flags

- Add LOCAL_ROOT_SIGNATURE flag in RootFlags
- Add DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS flag in DescriptorTable
- New DxilRootSignatureCompilationFlags argument on Compile/ParseRootSignature
  to specify whether the root signature is local or global.

* Fix root signature flag issues, add cmd test for root sig from define
2018-11-02 23:52:32 -07:00
Helena Kotas b77a577f5b
Subobject tests (#1657)
Add error on empty root signature value or subobject to export association.
2018-11-02 13:52:57 -07:00
Tex Riddell ecb4e3b4bb Add SV_ShadingRate plus optional feature flag
- Move/fix flag collection based on signature properties to be computed
  per entry function (including for libraries)
2018-10-22 20:25:12 -07:00
Tex Riddell 79bc013b4d Add dot2add and dot4add_*8packed intrinsics 2018-10-22 20:21:55 -07:00
Xiang Li 016e70532e
Move pix pass into DxilPIXPasses. (#1605)
* Move pix pass into DxilPIXPasses.
2018-10-16 21:38:33 -07:00
Tex Riddell 645ea84fcc Fix implicit casts for dimension and various other related things.
- Fix improper bool early promotion to int in CheckBinOpForHLSL
- Modify VerifierTest.cpp to re-enable parsing by VerifierHelper.py
- Update/fix VerifierHelper.py
- Update/fix various tests, including adding expected fxc comments
- Fix source locations for ValidateCast uses
- ValidateCast will use expression location if no loc provided
- TODO: Fix error on explicit truncation cast that should be ok, as long
  as it's not an l-value "cannot truncate lvalue vector/matrix"
  See binop-dims.hlsl
- TODO: Fix L-Value casts in the future
2018-09-26 19:58:34 -07:00
Tex Riddell 89697bbad5 Merge branch 'master' into dxr-master
# Conflicts:
#	include/dxc/HLSL/DxilUtil.h
#	lib/DxcSupport/HLSLOptions.cpp
#	lib/HLSL/DxilUtil.cpp
#	tools/clang/lib/CodeGen/CGHLSLMS.cpp
#	tools/clang/unittests/HLSL/DxilContainerTest.cpp
2018-09-12 22:28:35 -07:00
Lei Zhang cde19502c5 Include one single copy of Git commit information 2018-08-27 15:11:25 -04:00
Helena Kotas 3ad6bc6b78
Update hctlabverify.com to include ARM64 build (#1502) 2018-08-23 10:28:30 -07:00
Tex Riddell b7850a24df Fail lib_6_1/2 without -Vd 2018-08-15 23:33:31 -07:00
Tex Riddell 96635e6720 Merged PR 115: Remove bad optimization for reusing loads in LegalizeResourceUse
Remove bad optimization for reusing loads in LegalizeResourceUse

- also update non-uniform detection to catch when the handle is marked,
  not just the load.
2018-08-09 18:52:00 +00:00
Tex Riddell 2330c74b1a Merge remote-tracking branch 'ms/master' into user/texr/integrate-master
# Conflicts:
#	tools/clang/tools/dxcompiler/dxcompilerobj.cpp
#	tools/clang/unittests/HLSL/ValidationTest.cpp
#	tools/clang/unittests/HLSL/VerifierTest.cpp
2018-07-26 17:17:36 -07:00
Tex Riddell ec4219002e Merge branch 'rtmaster' into user/texr/integrate-master 2018-07-26 16:07:02 -07:00
Tex Riddell fec1adb90e Merged PR 110: Validate raytracing shader properties and RDAT blob part
Validate raytracing shader properties and RDAT blob part

- no signatures for ray tracing shader functions
- payload/params/attribute sizes are >= argument type allocation sizes
- RDAT is bit-identical to RDAT generated
- Minor fix for CS: should not have input signature elements either.
- update val version comment
- Prevent strange behavior with library target and entry point not empty.
- remove DXASSERT in LoadDxilMetadata (validation should catch this case)
2018-07-26 22:44:51 +00:00
Tex Riddell 7fe628800d Merged PR 108: Validate function params for libraries.
Validate function params for libraries.
2018-07-25 19:02:59 +00:00
Tex Riddell 0f166b8c24 Merged PR 109: Enable Dxil Op validation for library functions.
Enable Dxil Op validation for library functions.
2018-07-25 18:23:10 +00:00
Tex Riddell 78be5b20ac Merged PR 104: Disallow ignore/accept hit intrinsics in lib export functions
Disallow ignore/accept hit intrinsics in lib export functions

- still need to add general validator part to restrict intrinsics for
  library functions and shaders.
2018-07-24 19:23:36 +00:00
Vishal Sharma b0ae200e7f
Update VerifierTest.py to support py v3 (#1443)
* Update VerifierTest.py to support py v3
2018-07-23 19:09:38 -07:00
Xiang_Li (XBox) 94157e54ab Merged PR 105: update handle validation.
update handle validation.
2018-07-21 01:54:30 +00:00
Tex Riddell ca77440693 Merge branch 'rtmaster' into user/texr/integrate-master 2018-07-17 21:23:48 -07:00
Tex Riddell f805234c9b Add ObjectToWorld/WorldToObject 3x4 and 4x3 intrinsics
- left original ObjectToWorld/WorldToObject for prototype compat.
2018-07-17 14:03:50 -07:00
Tex Riddell 95c382de3f Merge branch 'master' into user/texr/integrate-master
# Conflicts:
#	lib/HLSL/DxilContainerReflection.cpp
#	tools/clang/tools/CMakeLists.txt
#	tools/clang/unittests/CMakeLists.txt
2018-07-13 15:01:10 -07:00
Tex Riddell 734accbce5 Merged PR 100: Eliminate phi on resources/handles for library
Eliminate phi on resources/handles for library

- ensure all handles use only one global resource
- replace resource path with indices into global resource
- replace resource alloca with index allocas
- AddCreateHandleForPhiNodeAndSelect now unnecessary, deleted
- error on resources in library function params or return
- mark entry clones as internal linkage since they could contain params
  that are not allowed for libraries.
- fix MarkUavUpdateCounter - handle nested GEP
- disallow static resource use from exported library functions
- add/update tests
- detect undef resource paths that would otherwise be lost (FailUndefResource)
- set internal linkage for HL intrinsic function bodies so they aren't processed with user functions
- Rename legalize [static] resource use passes to DxilPromote(Local|Static)Resources
- Remove various dead code paths for resources, such as:
  GenerateParamDxilResourceHandles, RemoveLocalDxilResourceAllocas,
  lower handle cast, non-promotable error (may translate to index allocas)
- force resource GVs to external constant with no initializer
2018-07-13 02:04:31 +00:00
Ehsan 01e5e240fa
[linux-port] Final update to cmake files for cross-platform compilation. (#1376)
This change disables the build targets that are not supported on Unix
platforms when compiling on those platforms.

We were also ignoring DXCompiler.cpp when compilation in the past. We
can now bring it back.

We have also added cmake-predefined-config-params which contains all the
cmake configurations needed to build on Unix platforms. It will make it
easy for developers to build.
2018-06-26 14:32:55 -04:00
Tex Riddell 6663dac50f Merge branch 'master' into user/texr/integrate-master
# Conflicts:
#	lib/HLSL/DxilContainerAssembler.cpp
#	lib/HLSL/DxilGenerationPass.cpp
#	lib/HLSL/DxilLinker.cpp
#	lib/HLSL/DxilModule.cpp
#	lib/HLSL/DxilOperations.cpp
#	lib/HLSL/DxilTypeSystem.cpp
#	lib/HLSL/DxilValidation.cpp
#	lib/HLSL/HLMatrixLowerPass.cpp
#	lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp
2018-06-22 12:05:49 -07:00
Tex Riddell e9d8bd9831 Merged PR 96: Add shader mask and min SM to RDAT
Add shader mask and min SM to RDAT
- add OP::GetMinShaderModelAndMask to compute mask and min SM
- account for ops that can be translated during linking
- update PS ops that could be allowed in library functions
- update min SM with newer optional feature flags

Fix AV in TranslateHLSubscript for typed buffer with struct element
2018-06-22 00:31:08 +00:00
Tex Riddell ee550a4b53 Add shader mask and min SM to RDAT
- add OP::GetMinShaderModelAndMask to compute mask and min SM
- account for ops that can be translated during linking
- update PS ops that could be allowed in library functions
- update min SM with newer optional feature flags
2018-06-20 21:40:28 -07:00
Xiang_Li (XBox) 4ade2fccc0 Merged PR 92: Enable ValidateResourceDxilOp for lib profile.
Enable ValidateResourceDxilOp for lib profile.
2018-06-20 18:53:19 +00:00
Lei Zhang 94ec193042
Add IDxcVersionInfo2 for querying Git commit info (#1304)
This will give users a way to know the commit from which a DXC
library/binary was built from, so that they can compare different
libraries/binaries and report bugs easily.

dxc.exe now also prints the commit info using this new interface
method. It uses the following format:

  (dev;<commit-count>-<commit-hash>)
2018-06-20 11:35:48 -04:00
Ehsan 180ea63ba0
[linux-port] Introduce Windows "adapter" headers (#1314)
In this CL, we have introduced the "WinAdapter.h" header file.

This file includes declarations and definitions that will enable compilation of the code base on non-Windows platforms. These include:

* Disabling SAL annotations for non-Windows platforms.
* Defining some Windows-specifc macros that are not defined on other platforms.
* Defining Windows-specific types that are used throughout the codebase for non-Windows platforms.

This file is currently not complete. As we go forward, we will add more classes/structs/type definitions to this file for specific purposes. The contents of this file is completely disabled (#ifdef'd away) for Windows, and do not affect Windows compilation in any way.  For the most part, this is our way of enabling compilation of the codebase on non-Windows platforms without making invasive changes to the existing cpp files, and without hindering any future development. Moreover, I have added the #include of this file for all the locations that will need it for successful Linux compilation.
2018-06-17 11:31:21 -04:00
Helena Kotas c3587a82fb
Update to VS 2017 and CMake 3.11.2 (#1347)
* Change build to prefer VS 2017

* Update supported cmake version

* Remove -vs2017 from appveyor.yml
2018-06-08 17:36:55 -07:00
Tex Riddell d37f956c70 Merged PR 86: Finalize OpCode changes for Dxil 1.3 / SM 6.3
Finalize OpCode changes for Dxil 1.3 / SM 6.3

- Rename CreateHandleFromResourceStructForLib to CreateHandleForLib
- Add PrimitiveIndex
- Add final NumOp[Codes|Classes]_Dxil_1_3 values
- Fix legal shader stage set for PrimitiveID
2018-06-09 00:22:19 +00:00
Xiang_Li (XBox) d09e2746aa Merged PR 90: Enable 64bit rawBufferLoad/Store.
Enable 64bit rawBufferLoad/Store.
Also fix 16bit offset for buffer matrix load/store.
And flat copy on matrix array with different major.
2018-06-08 23:42:16 +00:00
Helena Kotas 7fd91d777f
Modify build script and environment to support ARM64 build (#1308)
hctstart.cmd and hctbuild.cmd now support ARM64 builds.

Note that building ARM64 build on x86/x64 machine needs a location
of x86/x64 version of TableGen tools (clang-tblgen and llvm-tblgen).
Before starting ARM64 build set the BUILD_TBLGEN_PATH to point to
the TableGen binaries or use the -tblgen option on hctbuild.cmd.

Also had to rearrange control flow around the cmake --build call
in hctbuild.cmd due to a flaky batch behavior around brackets.
2018-06-08 13:06:48 -07:00
Greg Roth b9f2c78314 [linux-port] Evade unused in LLVM code (#1327)
Primarily if not exclusively due to the massive carveouts of the
original LLVM source base as part of the HLSL adaptation, many
variables and functions are left unused. In keeping with the
practice of commenting or ifdef-ing out unused portions of this
code and marking every such exclusion as an HLSL change, this adds
few comments and moves a lot of preprocessor conditionals around to
encompass the portions left unused as a consequence of the earlier
exclusions.
Fixes 450 clang and 442 gcc warnings.
2018-06-05 14:07:51 -04:00
Xiang_Li (XBox) 4491b6230b Merged PR 82: Fix matrix array as parameter for external function.
Fix matrix array as parameter for external function.
2018-06-02 02:45:59 +00:00
Xiang Li c7e6398634 Change DispatchRays dimension to 3d. 2018-05-31 13:35:34 -07:00
Xiang Li c410b52fad Add shader stage limitation for Raytracing intrinsic. 2018-05-31 11:20:49 -07:00
Young Kim 655bc9692f
use prettyxml to generate ShaderOpArithTable.xml (#1192) 2018-05-30 14:31:37 -07:00
Tex Riddell a26681c807 Merge branch 'master' into rtmaster
# Conflicts:
#	lib/HLSL/DxilGenerationPass.cpp
#	lib/HLSL/DxilValidation.cpp
#	tools/clang/tools/dxcompiler/dxclinker.cpp
2018-05-22 20:52:03 -07:00
Greg Roth d27307905c Make correct/consistent include capitalization (#1269)
Several #included files were capitalized incorrectly in the case of
files pertaining to the project, or inconsistently in the case of
Windows headers which are typically only relevant where capitalization
doesn't matter. In spite of that, consistent capitalization can be
useful for cross platform stubbing purposes.

This corrects capitalization of a few Dxil* headers and forces
capitalization of Windows-specific headers to be consistent with
the overwhelming majority of other cases.

No functional change, just cross-platform facilitation
2018-05-10 10:47:52 -07:00
Tex Riddell 8bdf2fef5f Merged PR 69: Add -auto-binding-space option enabling auto-binding for lib targets
Add -auto-binding-space option enabling auto-binding for lib targets

- Added DxilAllocateResourcesForLib pass to allow auto-binding any unbound
resources in a DxcOptimizer pass.
2018-05-02 17:50:41 +00:00
Tex Riddell 283b71ca16 Change PerThreadFileSystem solution to still require explicit Setup
- Added AutoCleanupPerThreadFileSystem for calling cleanup on scope exit,
  useful for command line users.
- Use global singleton and ensure cleanup on exit if not called
- Put setup/cleanup in VerifierTest.cpp where the TestModule[Setup|Cleanup]
  methods live.
- Remove GlobalPerThreadSys from FileCheckForTest, since this has to happen
  at the module level instead.
- Added Setup/Cleanup to all the appropriate places
2018-04-19 18:42:52 -07:00
Tex Riddell 5ab102a352 Merge branch 'master' into rtmaster 2018-04-16 15:25:53 -07:00
Lei Zhang 35d0aeae20
Change Appveyor to do Release build (#1200)
Also changed to use the build project from antiagainst's account.
2018-04-13 15:29:57 -04:00
Young Kim 0777a7a020 Merge branch 'master' into rtmaster 2018-04-10 16:47:47 -07:00
Helena Kotas e4c5158b98 Fix compile shaders with relative path and include files
Fixes #991
2018-04-06 15:34:41 -07:00
Xiang Li 357803d342
Don't sink sample coordinate into control flow. (#1188) 2018-03-29 16:33:59 -07:00
Shawn Farkas 368aead044
Add an isAlwaysUniform property to instructions (#1168)
Add an isAlwaysUniform property to instructions
2018-03-21 18:51:00 -07:00
Tex Riddell e237f8a57e Merged PR 50: Fix attributes for ray intrinsics that can change during traversal
Fix attributes for ray intrinsics that can change during traversal
2018-03-13 03:13:03 +00:00
Tex Riddell cb5f27c080 Merge branch 'master' into user/texr/rt-merge-rebase 2018-03-12 13:11:12 -07:00
Tex Riddell d2f227b210
hctstart.cmd - flexible SDK detection using min version (#1121)
- match method and reg keys used by cmake script
2018-03-12 12:56:17 -07:00
Tex Riddell f8e1af0417 Merge branch 'master' into user/texr/rt-merge-rebase 2018-03-09 00:55:21 -08:00
Young Kim fc2cbbd4ce
revert cosh test tolerance value for float32 (#1119) 2018-03-07 17:49:51 -08:00
Young Kim a71140cdaa
Relax hcos tolerance range (#1114) 2018-03-06 17:33:32 -08:00
Young Kim 7895e40376
Fix div denorm ftz (#1113) 2018-03-06 17:33:24 -08:00
Adam Yang c252cc430c Modified hctgettaef.py to use tls1.2 when requesting files files github. 2018-03-05 14:08:35 -08:00
Young Kim 81ecfef34b
Fix denorm preserve division with high value of denominator (#1093) 2018-03-01 07:41:10 -08:00
Tex Riddell 914c040b14 Merged PR 26: Fix intrinsic names to match spec.
Fix intrinsic names to match spec.

- PrimitiveIndex still maps to low level dx.op.primitiveID
2018-02-21 21:51:20 +00:00
Tex Riddell 634fd7556b Merge branch 'rtmaster' into user/texr/rt-merge-rebase 2018-02-20 19:12:09 -08:00
Young Kim b287dd7d71
More overload for TextureGather and TextureGatherCmp (#1069) 2018-02-20 12:35:19 -08:00
Young Kim 3a77648684
Fix argument passing for tertiary denorm mode (#1078) 2018-02-20 12:33:49 -08:00
Tex Riddell 520f06d442 change *_USER_DEFINE_TYPE to *_USER_DEFINED_TYPE 2018-02-13 15:46:32 -08:00
Tex Riddell 7d145d64d5 Merge branch 'master' into user/texr/rt-merge-rebase 2018-02-12 17:51:50 -08:00
Young Kim 69e2583196 Adding RayFlags and HitKind built in constants 2018-02-13 00:24:18 +00:00
Young Kim e9f17e3c87
Fix denorm tests and sm support (#1059)
- Fixing device support for > SM 6.0
- updating dxexp
- Also fixing the following tests:
ExecutionTest::DenormBinaryFloatOpTest#FDivDenormFTZ
ExecutionTest::DenormBinaryFloatOpTest#FAddDenormAny
ExecutionTest::DenormBinaryFloatOpTest#FMulDenormAny
ExecutionTest::DenormBinaryFloatOpTest#FDivDenormAny
ExecutionTest::DenormBinaryFloatOpTest#FMulDenormFTZ
ExecutionTest::DenormBinaryFloatOpTest#FAddDenormFTZ
ExecutionTest::DenormBinaryFloatOpTest#FSubDenormFTZ
ExecutionTest::DenormBinaryFloatOpTest#FSubDenormAny
ExecutionTest::DenormTertiaryFloatOpTest#FMadDenormAny
ExecutionTest::DenormTertiaryFloatOpTest#FMadDenormFTZ
2018-02-07 13:51:16 -08:00
Xiang Li fdb8161ccb 1. Not replace local/static resource to handle for lib.
2. Not SROA on resource.
3. avoid unpack for resource.
4. Use value type for createHandleForLib.
5. Move all scalar global resource load to the beginning of function.
   This will stop other pass do optimizations on the loads of scalar global resource.
6. Not remove local resource for lib.
2018-02-06 19:30:24 -08:00
Young Kim e5bb22baf7
Fix sqrt,rsqrt and ulp test for half (#1054) 2018-02-06 14:57:58 -08:00
Xiang Li fdf2c31ca6 1. Fix IgnoreHit and AcceptHitAndEndSearch.
2. Support init list for RayDesc.
3. Remove range_id for lib.
4. Update some test.
2018-02-05 18:51:47 -08:00
Xiang Li dc3ad5efe5 Lower createHandelForLib.
TODO: fix nonUniform, resource array fails and remove LinkInfo.
2018-02-05 17:54:08 -08:00
Xiang Li 519938f12e Lower HLCreateHandle into CreateHandleFromResourceStructForLib. 2018-02-05 17:54:07 -08:00
Xiang Li 69bc49ffe4 Support System Value retrieval functions. 2018-02-05 17:54:07 -08:00
Xiang Li c45aa784ac Add AcceptHitAndEndSearch, CallShader, CommitHitAndStopRay and change ReportIntersection into ReportHit.
Also change RayTracingAccelerationStructure into RaytracingAccelerationStructure.
2018-02-05 17:54:06 -08:00
Xiang Li eb4b0ae768 Support user define type for dxil operation.
Add RayTracingAccelerationStructure to dxil resource.
Lower ReportIntersection and TraceRay.
2018-02-05 17:54:05 -08:00
Xiang Li bc2e19b771 Support TraceRay and ReportIntersection which has user-define param at front-end. 2018-02-05 17:54:04 -08:00
Young Kim 6f2aaa6ab3
Preserve denorms for frc on half inputs, and fix sqrt(-denorm) for float (#1042) 2018-01-30 16:52:58 -08:00
Young Kim 1e97116e9f
Fix countbits, reversebits, firstbitlow intrinsics for int16 types (#1037)
Fix countbits, reversebits, firstbitlow intrinsics for int16 types
2018-01-30 14:29:10 -08:00
Young Kim d5d3d8d49a
Fix Shader Model 6.2 tests (#1036)
Fixing a bunch of SM 6.2 Tests
- BinaryHalfOp tests reading input2 instead of input1
- Fixed converting signed zero from float to float16
- Fixed compiler options for float16 min,max test
- Fixed expected results for following float16 operations
- cos(0), sin(314), sin(-314)
- frc(-7.39)
- rsqrt(65504)
- int16 subtraction
- int16 unsigned multiplication
- sqrt, rsqrt, round_pi, round_ni, fmad treat denorm as it is
2018-01-30 14:28:49 -08:00
Lei Zhang fa1e7cddd0
[spirv] Add SubpassInput(MS) and vk::input_attachment_index (#1000)
Two new Vulkan specific intrinsic resource types, SubpassInput and
SubpassInputMS, are introduced to provide a way to use subpass inputs
in Vulkan. Their signatures:

template<typename T>
class SubpassInput {
  T SubpassLoad();
};

template<typename T>
class SubpassInputMS {
  T SubpassLoad(int sample);
};

T can be a scalar or vector type.

If compiled without ENABLE_SPIRV_CODEGEN, the compiler will report
unknown type name for SubpassInput(MS). If compiled with SPIR-V
CodeGen and trying to use SubpassInput(MS) in DXIL CodeGen, the
compiler will report an error saying the type is Vulkan-specific.

A new Vulkan-specific attribute, vk::input_attachment_index is
introduced to provide a way to set the input attachment index for
SubpassInput(MS) objects.
2018-01-20 17:16:39 -05:00
Jeff Noyle ad3e51b1dd
New pass for PIX "shader access tracking" (#998)
* py changes

* checkpoint

* wrong overloads for a couple ops

* Correct out-of-range checking

* test

* RTV

* Add shader access tracking and reportage of dynamically indexed registers

* Uniquify and encode proper register index!

* remove unncessary noise

* rename a var
2018-01-19 14:47:06 -08:00
Young Kim a43147de94
Add validation for Quad operations against non pixel shaders (#986) 2018-01-16 10:33:47 -08:00
Xiang Li b816c124f1
Support resource select for lib profile. (#940) 2017-12-20 10:47:29 -08:00
Young Kim 6c998fda25
- Add int16, uint16 execution tests (#920)
- Add enable-16-bit-types argument to half test shaders
2017-12-14 11:33:59 -08:00
Young Kim bf911b1d22
Add 16bit integers to Any IntrinsicCompTypes and for existing UInt3264 comp types. (#913) 2017-12-13 13:44:10 -08:00
Xiang Li 0790e03364
Remove stacksave and stackstore. (#914) 2017-12-12 18:50:01 -08:00
Young Kim ecf0307963
Half tests (#911)
- Adding half tests for unary,binary,tertiary math operations
- Add 'exec-future' option for hcttest
2017-12-12 15:12:19 -08:00
Young Kim fdadc6d718
Denorm float tests (#899)
-Execution tests for Shader Model 6.2 denorm mode
-'FAdd', 'FSub', 'FMul', 'FDiv', 'FMad' instructions are used for testings
-Code cleanup
2017-12-08 18:18:32 -08:00
Young Kim 09c7c17dac
Fix exec tests (#888)
- TAEF is unable to recognize negative values in hex representation in x64 released build. So use decimal values instead
- Add 'Shl', 'LShr', 'And', 'Or', 'Xor' execution tests
- Update Warp Version for test cases known to fail
2017-12-06 19:04:01 -08:00
Young Kim 4904266822
Code Cleanup for Execution Tests (#879)
- Cleaning up execution test
- Generating xml test file from the script and hctdb
- Fixing hctdb categories for unsigned int
- Adding more execution tests (Fadd, FSub, FMul, FDiv, Add, Sub, SDiv)
2017-12-05 15:17:50 -08:00