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

267 Коммитов

Автор SHA1 Сообщение Дата
Xiang Li 7f9ee1a8f6 Add test for minprec on intrinsic. 2017-10-11 23:41:27 -07:00
Xiang Li 8cdd242739 Use M instead of m_pHLModule which is already Released when SetPauseResumePasses. (#696) 2017-10-11 17:19:22 -07:00
Marcelo Lopez Ruiz 64f3b34995 Adds support for pipeline restart (#683)
* Adds support for pause/resume in pipeline.
* Adds 0.0 as the validator version to indicate no validation should occur.
* Moves module parsing from dxcompiler down to HLSL library.
* Adds support for optimizer to process a DXIL part.
* Adds a form with designer support for the interactive optimizer.
2017-10-11 14:04:24 -07:00
Xiang Li e26728ba5f Use float for tex coord instead of float_like. (#688)
* Use float for tex coord instead of float_like.

* Support min prec for GetDim.
2017-10-10 18:53:50 -07:00
Xiang Li ce4aad0418 Use function annotation of patch constant function in GenerateDxilPatchConstantLdSt for hs. 2017-10-10 10:51:37 -07:00
Jeff Noyle b06a8153ff Shader debug instrumentation (#680)
See the comment in DxilDebugInstrumentation.cpp for a summary of how this-all works. Basically: instrument all instructions to output "trace" info to a UAV so that a debugger can reconstruct the execution of the shader and offer a debugger-like experience.
2017-10-09 15:30:29 -07:00
Xiang Li 36b2a12695 Fix row index for array of matrix input/output. (#660)
* Fix row index for array of matrix input/output.
Also remove sret when flatten functions.
2017-09-28 17:23:57 -07:00
Xiang Li 58b7f88864 Use correct channel for gather with offset. (#648) 2017-09-25 17:43:24 -07:00
Jeff Noyle f169e6f238 PIX pixel-hit instrumentation: Re-emit type system, fix several issues with the UAV (#635)
* Add SV_Position index parameter, various minor tweaks to UAV setup

* Convert to raw buffer

* fix up unit tests, add a few names to variables

* CR feedback: check for pre-existing type; typo
2017-09-25 15:22:05 -07:00
Xiang Li 6b3fefb5e4 Support matrix for frexp. (#624) 2017-09-19 08:56:25 -07:00
Young Kim fb33d62978 Restrict no min precision option to shader model 6.2 (#615) 2017-09-12 16:05:08 -07:00
Young Kim 223a885613 Group Signature Elements by Element Width (#610)
This change is to enforce the new constraint on signature packing: pack signature elements by data width. Before we introduce fp16 type, every element was assumed to reserve 32 bits. Since we are introducing a new 16 bit data type, we need a new way to enforce signature rules.

After discussions we decided that it would be nice to pack elements based on data width. However, we are still enforcing the rule that each row contains up to 4 elements, regardless of the size. This way, depending on the hardware support drivers can optimize packing signatures, while on DXIL level we maintain the assumption that there are 4 elements per row. We are also still constraining on the total number of rows to be 32 for now. This can be changed in the future if people find this limit to be an issue.
2017-09-06 11:04:33 -07:00
Xiang Li 20268a4725 Code cleanup. 2017-09-01 10:47:29 -07:00
Xiang Li ddc78174f4 Split big alloca first. 2017-09-01 10:47:29 -07:00
Xiang Li ceb0c7aee7 Allocate correct size for idxList in TranslateStructBufMatSubscript. 2017-08-30 12:00:28 -07:00
Tex Riddell e1fd230b92 Fix out of bounds memory write in GetResourceBindingDescByName (#555)
If reflection version is not D3D12, ZeroMemoryToOut will overwrite
memory outside of the user's pDesc struct, leading to stack or
heap corruption.  I removed ZeroMemoryToOut, since the right amount
of data should be written in each case.
2017-08-28 13:49:31 -07:00
Young Kim b89c21d25b Fp16 constant buffer and shader flag (#575)
This change is to support fp16 on constant buffer.
We are still keeping a row pitch of 4 dwords. So we can fit up to 8 halfs in one row.
Dword data types will be aligned to dword address space for efficiency. We are also introducing new flags "use native low precision" if we have low precision type present and /no-min-precision option is enabled.
2017-08-21 15:06:45 -07:00
Lei Zhang 0e0e014232 [spirv] Add CL option for stage I/O location assignment order (#578)
A new CL option -fvk-stage-io-order={alpha|decl} is added to
control the order for assigning stage I/O location numbers.
The default is also changed to declaration order (decl) instead
of alphabetical order (alpha).

Also extended testing fixtures to support additional CL options.
2017-08-17 20:59:45 -07:00
Tex Riddell bbe8831fe1 fix dot-cfg so it doesn't act like dot-cfg-only (#556) 2017-08-15 12:13:24 -07:00
Xiang Li 8c4f2db67e Add -NoLineDirectives to ignore #line. (#550) 2017-08-11 14:55:45 -07:00
Young Kim eacdff2a5c Support FP16 (#471)
This change is the initial step for supporting fp16.

Support half type with /no-min-precision option. This switch can be moved to other master switch in the future as we refine our spec for half support. 
min16float will be treated as half with warnings.
Fix compiler test to take additional arguments, and fix regression tests.
TODO: we need to make decisions on what triggers low precision instead of min precision. Also need to change signature packing and constant buffers for half.
2017-08-10 10:19:43 -07:00
Xiang Li e5c0e5ffaa Merge DivergenceAnalysis from llvm3.8. (#528) 2017-08-07 12:14:46 -07:00
Xiang Li 3f866d5e70 Use lazy load for linking. (#527) 2017-08-07 12:14:24 -07:00
Xiang Li eb0894c913 Support static const field with initializer (#520)
* Support static const field of struct.
* Revert "Revert "Add nodup attribute for barrier.""

This reverts commit e435f63b02.
2017-08-04 13:40:31 -07:00
Xiang Li b1479680bb Disable LoopUnswitchPass. 2017-08-03 23:14:22 -07:00
Xiang Li e435f63b02 Revert "Add nodup attribute for barrier."
This reverts commit 30b7f5cd4d.
2017-08-03 23:14:22 -07:00
Xiang Li 00351f3f94 Add nodup attribute for barrier. 2017-08-03 23:14:22 -07:00
Xiang Li 27c4d72141 Fix build error. 2017-08-03 14:24:14 -07:00
Xiang Li aa5a84fba5 Fix bug error caused by DXASSERT. 2017-08-03 14:24:14 -07:00
Xiang Li 5d23e2c3d3 Allow select resource for library profile. 2017-08-03 14:24:14 -07:00
Xiang Li 459b5998a4 Support same resource declared in different lib.
1. Add debug code in CompileFromBlob to help debug in release build.
2. Add dxl to help debug linker.
3. Check type match for resource when link.
2017-08-03 14:24:14 -07:00
Xiang Li 13665a2673 Bug fixes. (#511)
1. Support empty struct as call arg.
2. Define _ATL_DECLSPEC_ALLOCATOR for older atlbase.h
3. Fix typo in SROA_Parameter_HLSL::preprocessArgUsedInCall for use AllocaBuilder when need RetBuilder.
2017-08-02 17:11:44 -07:00
Xiang Li 6e4e66e845 Make sure handle store not unpack. 2017-07-31 22:36:13 -07:00
Xiang Li 027dbbdedd Fix build error in release build. 2017-07-31 22:36:13 -07:00
Xiang Li f47fc4d40b Support nested struct type when preprocessArgUsedInCall. 2017-07-31 22:36:13 -07:00
Xiang Li 36ba7ac534 Add HLDeadFunctionEliminationPass. 2017-07-29 10:27:18 -07:00
Xiang Li 46e47f01e5 Refactoring DxilEmitMetadata pass. 2017-07-29 10:27:18 -07:00
Xiang Li 7878c0168e Skip validation patch and collect shader flags for lib. 2017-07-29 10:27:18 -07:00
Xiang Li a318eb6106 Support return of resource for library.
1. Don't check hasMulticomponentUAVLoads for lib.
2. Skip mem2reg for unpromotable handle alloca for lib.
3. Support find resource attribute from function call.
4. Avoid unpack for dxil types.
5. Add resource attribute for fieldAnnotation.
2017-07-29 10:27:18 -07:00
Tex Riddell c9beb84c51 Fix ViewID state for flow control and consistent ViewID detection (#484)
* Fix ViewID state for flow control and consistent ViewID detection

1. Different ways of determining ViewID usage led to assert or crash.
Use DxilModule flag to guarantee consistency.  But this required
splitting DxilEmitMetadata pass into two passes, one that finalizes
the module and computes flags run before ComputeViewIdState, and one
that simply writes the metadata.

2. storeOutput in flow control with values not dependent on that flow,
such as literals, would not pick up control flow dependence.
Fix by picking up control flow dependence on storeOutput instructions,
not just the value being written.

* Fix control depenence computation

There was a bug in the implementation of the control dependence algorithm.
We were incorrectly iterating over all descendents in the postdom tree where
the algorithm should only iterate over immediate children.
2017-07-28 11:51:15 -07:00
Marcelo Lopez Ruiz 60a67e6563 Fix unused var warning in release, better logging for command line tests. (#479) 2017-07-27 14:22:16 -07:00
Jeff Noyle d3f53b7f3e "Dr PIX": Force early Z (#467)
PIX has the ability to turn on early z and show you the performance difference with and without.
This pass implements the DXIL side of it.
2017-07-27 13:34:54 -07:00
Jeff Noyle d77cde2f60 Remove checks for "discard", since early-z actually works with discard! (Or rather, is well-defined with discard.) (#480) 2017-07-27 13:10:44 -07:00
Young Kim 55667043c3 Support denorm option (#446)
This change is to support preserve denorm operations. We do this by creating dxc options and propagate them all the way to dxil metadata so that drivers can see how it should handle floats.
Currently we support three modes: any(default), preserve, and ftz

Denorm option will be of per function flag. We store this information at function annotation metadata. This means that for DXIL 1.2 we have a new structure for function annotation. The change in structure is documented on DXIL.rst
2017-07-27 10:08:14 -07:00
Xiang Li c1973d761c Code Cleanup. (#475)
Add default for switch to avoid warnings.
2017-07-26 21:35:02 -07:00
Xiang Li 516a70ad4c Allow nested struct in UAV. (#472) 2017-07-26 17:17:36 -07:00
Xiang Li 96c9c0597c Code cleanup. (#469)
1. Move DxilEmitMetadata out of DxilGenerationPass.cpp
2. Move helper function out of HLModule.
2017-07-26 11:02:20 -07:00
Xiang Li 4723496f3e Not replace struct parameter to function call arg. (#466) 2017-07-25 20:42:55 -07:00
Xiang Li 87ded7ab24 Run mem2reg when linking. (#465) 2017-07-25 19:47:26 -07:00
Xiang Li 71774913f6 Minor bug fixes. (#463)
1. Support in out as inout.
2. Support function call on extern functions which don't need to flatten.
2017-07-25 17:47:04 -07:00