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

1185 Коммитов

Автор SHA1 Сообщение Дата
Young Kim f66e8083d6 Allow two SV_Barycentrics (#282)
unlike other system value semantics, pixel shader is allowed to declare at most two input attributes with SV_Barycentrics, with one declaration uses perspective interpolation type while other one uses noperspective interpolation type.
2017-05-09 18:59:30 -07:00
Lei Zhang 1e58245a73 [spirv] Add SPIRV-Headers and SPIRV-Tools as external dependencies (#280)
We need SPIRV-Headers for spirv.hpp11 and SPIRV-Tools for SPIR-V
diassembling.
2017-05-09 18:33:24 -07:00
Marcelo Lopez Ruiz ad76d814a4 Debug name part implementation (#264)
* Add documentation with source-level debugging with HLSL and DXIL.
* Fix trailing underscore in generate .rst documentation.
* Add container support for debug name part.
* Bump validator version to 1.1.
* Implement debug stripping in dxc, including /Fd dir-named behavior.
* Implement IDxcCompiler2 and CompileWithDebug.
2017-05-09 18:32:48 -07:00
Xiang Li 4bca8da154 Fix building with VS 2017 integrated cmake (#279)
1. Add  DXC_BUILD_ARCH to find TAEF.
2. Change build root to  hlsl.bin.
3. Add lauch.vs.json to debug  dxc.
2017-05-09 14:01:22 -07:00
Xiang Li 6323ba161b Generate GEP for DerivedToBase instead of bitcast. (#283)
1. Support base in FlattenedTypeIterator.
2. Generate GEP for DerivedToBase except empty struct.
2017-05-09 14:00:41 -07:00
Xiang Li 9edb1a553e Lower static global resource and local resource to handle. (#276)
1. Add ResourceToHandle pass to lower resource to handle.
2. Don't performPromotion in SROA_HLSL.
3. Add Option support for DynamicIndexingVectorToArray.
4. Fix bug in GetPassOption.
5. Replace GEP ptr, 0 with ptr in DynamicIndexingVectorToArray::ReplaceStaticIndexingOnVector.
6. Run mem2reg before DxilGenerationPass.
7.Legalize EvalOperations before change vector to array.
2017-05-05 18:31:35 -07:00
Lei Zhang 2c7a3fc39d [spirv] Add bare bone code for SPIR-V codegen (#233)
* [spirv] Add libclangSPIRV and skeleton FrontendAction for SPIR-V

* [spirv] Add -spirv into dxc for invoking EmitSPIRVAction

* [spirv] Build SPIR-V codegen conditionally

Added ENABLE_SPIRV_CODEGEN in CMake config to control the
building of SPIR-V component and wrap up SPIR-V code using it.
Also add -spirv to hctbuild to turn it on.
2017-05-05 19:39:59 -03:00
Young Kim 47d21ad6c0 Fix EvalauteAttribute Intrinsics (#275)
Currently the compiler crashes when we pass in matrix or vectors with reduced dimension from the original signature element for EvalAttribute functions. This change resolves this issue by replacing allocas before we translate these function calls from DXIR to DXIL and find LoadInputs to replace correctly.
2017-05-05 15:10:46 -07:00
Tex Riddell da5f98bb95 Updates to DxcValidator and DxcCompiler wrt. versioning/flags (#269)
Make DxcCreateInstance load validator from dxil.dll when available
Add DxcVersionInfoFlags_Internal flag to indicate internal validator
Add DxcValidatorFlags_ModuleOnly to indicate absense of full container for validation, requiring explicit use. This will not succeed when using dxil.dll validator.
Bump Validator version
Implement IDxcVersionInfo in DxcCompiler to indicate DXIL highest version supported and debug flag for compiler separately from validator
Refactor version detection code for tests, adding dxil and validator versions
Make SystemValueTest version aware
Add version check to AttributeAtVertex and SV_Barycentrics tests.
Fix line endings for HlslTestUtils.h
2017-05-04 22:18:57 -07:00
Xiang Li 4ddd43fd66 Don't require null terminator when create MemBuffer for module data. (#274) 2017-05-04 18:34:26 -07:00
Xiang Li 7179f13400 Do not create phi on non-default address space. (#273) 2017-05-04 16:25:44 -07:00
Xiang Li 67ea776da9 When EmitHLSLMatrixStore for col major, if Val is casted from col major, just use the original col major val. (#272) 2017-05-04 15:02:19 -07:00
Xiang Li 66f99308c0 Do not generate LoopID metadata if no attribute is added. (#271) 2017-05-04 13:37:46 -07:00
Xiang Li 7ab7c33f84 Make sure one instruction only pushed into deadInsts once when SimplifyBitCast. (#262) 2017-05-03 21:36:11 -07:00
Young Kim 13cf7d466c Update barycentric with new spec (#265)
1. Adding SV_Barycentric and removing barycentric intrinsics/dxilops
2. GetAttributeAtVertex only thakes no_interpolation attribute
3. SV_Barycentric can take any interpolation modifier except nointerpolation
4. SV_Barycentric can only have float3 type
2017-05-03 17:07:02 -07:00
Young Kim 77771f4e1c Update htan(Inf/-Inf) to +1/-1 (#268) 2017-05-03 10:36:04 -07:00
yurido1 7b98cc8efc Update DXIL.rst (#267)
Fixed Htan behavior for +/- INF.
2017-05-02 15:24:47 -07:00
Tex Riddell c0d3163ee3 Dxil versioned OpCode/Class counts, and other dxil versioning fixes (#263) 2017-05-02 14:42:05 -07:00
yurido1 b3925dbb34 Update DXIL.rst (#261)
Fixed input/output intrinsics table for HS and DS.
2017-05-02 14:10:18 -07:00
Tex Riddell bd6c105e9b Add ViewID slot validation for PSIn (#254) 2017-05-01 17:54:33 -07:00
Marcelo Lopez Ruiz 740bcae86f hctstart improvements - use VS2017 cmake, fix cmake version checks (#260)
Use VS2017 cmake, fix cmake version checks.
Add trailing space to labels in hctstart to work around line ending issues.
2017-05-01 12:02:34 -07:00
Xiang Li d108a552de Refactoring DynamicIndexingVectorToArray to share code with MultiDimArrayToOneDimArray. (#259) 2017-05-01 11:15:32 -07:00
Xiang Li 9f437adda5 Lower memcpy before SORA a pointer. (#253)
1. Try to propagate if the pointer is only write once by the memcpy.
2. Use correct size for memcpy created in AppendBuffer::Append.
3. Ignore unused Constant user of Matrix value.
4. Replace Constant with Inst on the Instruction version of Constant.
5. When match size of memcpy, go deeper if struct only has 1 element.
   Doing this will leave memcpy be lowered at deeper level.
6. Do not replace when SimplePtrCopy, cannot decide replace is safe or not.
2017-04-28 14:42:04 -07:00
Young Kim 543faf9a20 ExecutionTest fixes (#249)
- allow operations to flush denorms to sign-preserved zero
- Fix line ending issue for ExecutionTest
- Add else statement for WaveActiveCounBits
2017-04-27 17:27:46 -07:00
Tex Riddell a581927370 Add SV_ViewID support (#251)
- Add SV_ViewID loaded from intrinsic in Dxil,
  for input to all graphics shader stages
- hctdb: rename shader_models to shader_stages,
  add shader_model for min required shader model
- Validator: validate dxil version required for shader model
- DxilModule: Add GetDxilVersion
- Set Barycentric intrinsics to SM 6.1
- Update SystemValueTest for SM 6.1
2017-04-27 14:17:31 -07:00
Xiang Li cf4ef478fa Set type for nested InitListExpr if it match required type. (#252) 2017-04-26 17:57:42 -07:00
Young Kim 108b897f40 Barycentric init (#250)
This change is the initial step to support Barycentric coordinates for shader model 6.1 / DXIL 1.1
 - Add GetBarycentrics, GetAttributeAtVertex intrinsics and their corresponding dxil ops
 - Lowering intrinsics to dxil ops
 - Adding codegen tests for these operations
2017-04-26 12:29:48 -07:00
Xiang Li aec310b4ea Use memcpy to copy when possible in clang code gen to avoid flatten too early. (#247) 2017-04-25 13:37:06 -07:00
Xiang Li 478a433366 Disable CSE, leave it to target backend. (#246) 2017-04-24 19:19:22 -07:00
Tex Riddell 23082dbef2 Add HLSL 2017 (-HV 2017) option. (#245)
- Fix detection of invalid options in dxcompilerobj
2017-04-24 16:05:06 -07:00
Xiang Li bc4a68b6b4 Use SRet for struct return type. (#243)
1. Use SRet for struct return type.
2. Add SM6.1 and DXIL1.1.
2017-04-24 14:34:57 -07:00
Young Kim 1176d0db7a Temporalily disabling failing cases: isfinite(NaN) and atan(NaN) (#244)
This change will prevent hcttest from producing a known execution test failures for WARP.
These should be enabled once WARP is fixed in the future.
2017-04-24 14:15:38 -07:00
Xiang Li 6bc247d4af Lower parameter (#242)
* Lower vector/matrix/resource/multi-dim array parameters to  scalars/array/handle/one-dim array.

* Code cleanup.
2017-04-21 17:47:26 -07:00
Xiang Li e14dc5ed1b Update matrix code gen. (#234)
1. Keep major for matrix pointers.
2. Change matrix values to row major to match hlsl.
   Only ColMatLoad, RowMatrixToColMatrix and col matrix value parameter for entry function are col major matrix value.
   And should only used by ColMatStore and ColMatrixToRowMatrix.
2017-04-21 11:56:37 -07:00
Young Kim 7112d77737 Add WaveActiveOp execution test (#232)
This change adds execution unit tests for WaveActiveOp intrinsics.

For wave operations, there is no guarantee of how many lanes exist in a given wave. The test therefore has to manually compute the expected output by identifying different waves in shaders and group lanes by the waves they belong to. This can be done by providing different id's for each structured resource and call WaveReadLaneFirst() on each shader, and mimic what wave intrinsics to compute expected results.

Right now the test will not run on a default mode on hcttest because of known issue for WARP driver with handling flow control in compute shader. As soon as this is fixed we should enable this test by setting the priority of the test to 0.

This change also includes other fixes in ExecutionTests including 
1)Have TableParameterHandler to read data driven table parameters and 2) fixing typos
2017-04-20 22:29:42 -07:00
Young Kim 4f3355b8f1 Fix Execution Test for atan(NaN) and Fabs
1. Update expected value of atan(NaN) to NaN (#240)
2. Update spec for Fabs for denorm
2017-04-20 22:27:02 -07:00
Young Kim 9ea99dda7d fix expected value of isfinite(NaN) to 0. (#239) 2017-04-20 18:00:48 -07:00
Lei Zhang 7a23033d69 Fix hctbuild -b -ninja and explain ninja build steps in README. (#238) 2017-04-20 09:06:35 -07:00
Xiang Li 4c22ec7802 Prepare to support handle as parameter. (#231)
1. Add resource attribute to FieldAnnotation.
2. Find resource arribute from Argument in FindCreateHandleResourceBase.
3. Remove limitation handle must be instruction.
4. Add HandleToResCast to help lower resource parameter to handle parameter.
2017-04-19 11:33:33 -07:00
Chas. Boyd 5c5445d47d Update README.md 2017-04-18 15:24:26 -07:00
Xiang Li 3911371309 Fix dbg info for temp variable. (#230)
1. Remove debug info when strip function parameter from entry function.
2. Set OptLevel to 0 for -Od.
3. If optimization is disabled, always load ReturnValue.
2017-04-18 13:49:59 -07:00
Tex Riddell 4de9ff32b6 Disable tests requiring name preservation on release builds. (#229)
* Disable tests requiring name preservation on release builds.
* Fix reversal of DxcVersionInfoFlags_Debug
* Enable parallel execution for unit tests
* Add -verbose to preserve logging and remove /parallel
2017-04-18 11:11:51 -07:00
Young Kim c50dd745d2 Add partial derivative test cases for pixel shaders (#220)
This change is to add another execution test case for partial derivative operations specific to pixel shaders.
The way we did this is by passing in the texture resource to the shader and taking the partial derivatives of these texture values.
Test is assuming the arithmetic precision of 1 ulp for derivative operations.

This change also has some changes on existing execution test
 - enable passing in Texture2D resource type as a default heap
 - reading primitive topology from XML file
 - clean up data driven tests: use DirectX Math structures and removing unused structures
2017-04-18 06:45:14 -07:00
Marcelo Lopez Ruiz b3eb288629 Add opt support for naming module prints and to diff them in dndxc. (#228) 2017-04-16 22:01:30 -07:00
David Peixotto b4389808e7 Use Post instead of Put to upload tests (#226)
This change makes the test result display properly on the test tab in appveyor.
2017-04-14 19:25:06 -07:00
Tex Riddell f323755dc9 hcttest: Fix parentheses in message prematurely terminating flow control (#227)
Add an optional extended description…
2017-04-14 18:48:36 -07:00
Lei Zhang 9cab7fd909 Add doc for SPIR-V codegen (#215) 2017-04-14 18:18:21 -07:00
Tex Riddell 80cdd522a4 Improve hcttest.cmd, add hctcopy.cmd (#225)
* dxexp: print adapters when experimental fails
* ExecutionTest: Correct experimental mode message when running release
* Improve hcttest.cmd, add hctcopy.cmd
2017-04-14 17:48:29 -07:00
Marcelo Lopez Ruiz d0821cfe6c Include new AppVeyor link in README.md 2017-04-14 09:46:54 -07:00
David Peixotto 449165a52d Run constant array hoisting pass by default (#224) 2017-04-13 17:56:28 -07:00