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

448 Коммитов

Автор SHA1 Сообщение Дата
Xiang Li 66516234b1 1. Remove unused createHandleForLib functions.
2. Call DxilTranslateRawBuffer after DxilLowerCreateHandleForLib.
2018-02-05 17:54:08 -08:00
Tex Riddell 2a1a3d2b99 Fix lh matrix cast on param case for RowMatrixToColMatrix and reverse 2018-02-05 17:54:08 -08:00
Tex Riddell 28c04e456b Fix patch constant function prop setting for DxilLinker 2018-02-05 17:54:08 -08:00
Tex Riddell 93c6bb3054 Fix bad condition for skipping library functions for parameter flattenning. 2018-02-05 17:54:08 -08:00
Xiang Li dc3ad5efe5 Lower createHandelForLib.
TODO: fix nonUniform, resource array fails and remove LinkInfo.
2018-02-05 17:54:08 -08:00
Tex Riddell 23301fc727 Fix HLMatrixLower for library function UDT args 2018-02-05 17:54:08 -08:00
Tex Riddell 213322e151 Skip library function flattenning entirely.
- still needs code cleanup (code can be deleted now with new assumption)
2018-02-05 17:54:08 -08:00
Tex Riddell ef8a94b23f Don't directly lower patch constant signatures (indirect through HS)
- likely bug still where multiple HS share patch constant function
2018-02-05 17:54:08 -08:00
Tex Riddell 03179abb36 Skip HL intrinsic function defs (createhandle) in HLMatrixLowerPass 2018-02-05 17:54:08 -08:00
Tex Riddell 456a78da3a Remove transpose during library arg translation of matrix load/store
(should be present already if necesssary)
2018-02-05 17:54:07 -08:00
Xiang Li 519938f12e Lower HLCreateHandle into CreateHandleFromResourceStructForLib. 2018-02-05 17:54:07 -08:00
Tex Riddell 15cd5f16e6 Matrix lowering for functions with UDT params preserved.
- Keep track of patch constant functions for later identification
- functions that require input/output signature processing identified
  with IsEntryThatUsesSignatures
- update lib_rt.hlsl intrinsics and naming
2018-02-05 17:54:07 -08:00
Xiang Li 1c8218861a Lower ObjectToWorld and WorldToObject. 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 b9ec4014d0 Add res type map for RayTracingAccelerationStructure. 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
Tex Riddell 2ae113596a HLMatrixLower: Handle unflattened lib function matrix return val and param. 2018-02-05 17:52:21 -08:00
Tex Riddell ea73161d6f In SROAHLSL undo change to legalize input/output condition. 2018-02-05 17:52:21 -08:00
Tex Riddell 88ec4ea96b Add BitCastValueOrPtr or UserCall utility funcs for HLMatrixLowerPass. 2018-02-05 17:52:21 -08:00
Tex Riddell e286979310 Change HLMatrixLowerPass::matToVecMap key from Instruction* to Value*. 2018-02-05 17:52:21 -08:00
Tex Riddell 20bf20391a Skip flattening for library function parameters or modifying return value. 2018-02-05 17:52:21 -08:00
Tex Riddell 24624613d1 Modify linker passes for function parameter simplification after inlining. 2018-02-05 17:52:21 -08:00
Tex Riddell 9a3bbb6603 Support SV_RayPayload and SV_IntersectionAttributes 2018-02-05 17:52:21 -08:00
Tex Riddell e67ee2ae17 Treat RT entry like export - flatten params and don't clone 2018-02-05 17:52:21 -08:00
Tex Riddell e9ce3e97d1 Add RT shader types for function attribution in lib target. 2018-02-05 17:52:21 -08:00
Jeff Noyle bd399a59f4
Remove no-longer-needed stream-out and RTV tracking (#1053)
* Remove no-longer-needed stream-out and RTV tracking

* restore similar enum to match PIX to reduce confusion
2018-02-05 16:44:59 -08:00
Tex Riddell c225dead63
Merge types in linker, and recognize class.matrix.* type for library. (#1033) 2018-01-31 13:47:05 -08:00
Tex Riddell acf2bc48d9
Set !dx.valver in Linker (#1031) 2018-01-31 13:45:54 -08:00
Jeff Noyle 004c681a97
Move PIX options out of DxilGenerationPass.*, use option string properly, reduce header usage (#1022)
* Clean up option usage, includes, and move PIX passes to their own header

* move utils to header

* use radix, pass proper default
2018-01-26 15:43:44 -08:00
Marcelo Lopez Ruiz c8c6ed8128
Adds support for inf literals and for asuint in constant expressions (#1029) 2018-01-25 10:28:09 -08:00
Jeff Noyle a48775cfe3
PIX: adding GS to list of debug targets (#1010)
* Add gs prolog, tests

* update CHECK params to use pattern-matching
2018-01-22 09:14:30 -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
Lei Zhang f9d613b795
[spirv] Add support for -fvk-invert-y (#967)
This is to accommodate Vulkan's coordinate system, which is different
from DX's.
2018-01-08 11:42:47 -05:00
Young Kim 1d48a06455
Add validation to check unknown function attributes (#963) 2018-01-04 17:01:10 -08:00
Xiang Li 08fbc64c2a
Insert store for incoming value of phi after insert load for phi use. (#964) 2018-01-04 16:14:01 -08:00
Xiang Li b816c124f1
Support resource select for lib profile. (#940) 2017-12-20 10:47:29 -08:00
Xiang Li ba844c25fe
Support local resource array which don't have dynamic indexing. (#938) 2017-12-19 15:29:11 -08:00
Xiang Li db99efe397
Support resource select inside loop. (#930)
Also fix scalarizer fail when scattered element is null.
2017-12-15 11:33:03 -08:00
Xiang Li 4f7016af53
Support isfrontface as uint. (#919) 2017-12-13 20:41:51 -08:00
Xiang Li 0790e03364
Remove stacksave and stackstore. (#914) 2017-12-12 18:50:01 -08:00
Tex Riddell 055cf27ac7
Fix re-emit metadata, and skip ViewID state for libs. (#908) 2017-12-11 21:57:00 -08:00
Xiang Li 639e12c118
When MemcpySplitter::PatchMemCpyWithZeroIdxGEP, not go inside matrix. (#901) 2017-12-08 22:32:52 -08:00
Xiang Li 455885b3fc
Support matrix transpose. (#900) 2017-12-08 16:40:23 -08:00
Xiang Li 9c459fedd8
Add line number when report resource cannot map. (#892) 2017-12-06 22:57:44 -08:00
Tex Riddell f25850d524
Add [noinline] function attribute for lib target. (#893) 2017-12-06 19:41:37 -08:00
Xiang Li 8c8d8f6e5a
Fix crash for vector smoothstep. (#890) 2017-12-06 17:21:02 -08:00
Xiang Li 1c103bb062 Revert "Fix crash for vector smoothstep."
This reverts commit 3bfa9960a8.
2017-12-06 14:15:27 -08:00
Xiang Li 3bfa9960a8 Fix crash for vector smoothstep. 2017-12-06 13:09:09 -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
Lei Zhang 5de265fddb
[spirv] Add support for ignoring unused resources (#875)
Added a new command line option -fvk-ignore-unused-resources
to avoid emitting SPIR-V code for resources defined but not statically
referenced by the call tree of the entry point in question.
2017-12-05 12:21:55 -05:00
Lei Zhang 05057495e8
[spirv] Adopt new changes in SPIRV-Tools (#846)
Uses the legalization pass recipe from SPIRV-Tools.

Also change -fcgl to disable both legalization and optimization.

Validation on some tests are turned off because of new image
instruction checking in SPIRV-Tools. Enabling them is a TODO.
2017-11-23 22:30:49 -05:00
Young Kim 92c66ed574
Fix build warnings (#832)
Change DXASSERT to DXASSERT_LOCALVAR to suppress warning
2017-11-20 20:04:42 -08:00
Young Kim 8ba7f5a200
Clean up for versions (#829)
-bump up dll version for fixed version
-show dxcompiler and dxil version number for dxc help message
-emit warnings for dxcompiler validator that container will not be signed
2017-11-20 11:09:28 -08:00
Xiang Li e9f0425202
Use neg+imax for iabs. (#828) 2017-11-18 00:18:31 -08:00
Xiang Li 259d6624e6
Don't generate lshr for cb array indexing. (#812) 2017-11-17 10:54:05 -08:00
Lei Zhang 0b309e9faf
[spirv] Add CL option to disable SPIR-V legalization (#814)
/fcgl is reused in SPIR-V CodeGen for disabling SPIR-V legalization.
2017-11-17 11:44:44 -05:00
Young Kim 289d09e700
Bitcast for 16bit types (#817)
This change adds bitcast intrinsics for 16bit types (asfloat16, asint, asuint)
2017-11-16 11:38:56 -08:00
Young Kim 3cad152a90
Template argument for byteaddressbuffer load store (#804)
This change removes new Load variations (LoadHalf, LoadFloat, etc) for RWByteAddressBuffer/ByteAddressBuffer methods and add templated Load intrinsics. This templated Load only works on scalar or vector types, and its variations (Load2, Load3, Load4, etc) do not work with templates and work as it did before (only storing uints). For Store operation, you can store any scalar or vector types of up to 16 bytes, while prior to 2018 Store only supported storing uint scalar.
2017-11-15 18:47:12 -08:00
Xiang Li 6adad2b8a3
Don't emit type annotation for empty struct. (#802)
After dxil generation, there should be no empty struct used in instructions.
2017-11-14 16:35:37 -08:00
Xiang Li 0dbba98152
Remove check on empty struct when LoadDxilStructAnnotation. (#798) 2017-11-14 10:34:01 -08:00
Young Kim a48d81fcac
New scalar types (#792)
This change is to add fixed width scalar types in HLSL 2018.
These types are: int16_t, uint16_t, int32_t, uint32_t, float16_t, float32_t, and float64_t.
Prior HLSL versions do not support these fixed width types.

This change also renames /no-min-precision command line option to /enable-16bit-types. int16_t and uint16_t are only allowed with this mode.
2017-11-13 15:03:19 -08:00
Young Kim 44db464c32
Native Int16 and Uint16 types (#783)
This change is to introduce native precision types for shader model 6.2. With native half (float16) types, we will introduce native int16/uint16 types with same command line option. This means that one option will disable all min precision types. For now, int16/uint16 types will be exposed on HLSL level as int16_t and uint16_t.

This change also includes some constant buffer fixes for 16 bit types, as well as int64 types.
2017-11-09 10:03:27 -08:00
Young Kim 2c140f795c
RawBufferLoad and new methods for ByteAddressBuffer (#762)
This change is an extension of float16 support. We are adding LoadHalf, LoadFloat, and LoadDouble method to byte address buffer so that users can access data from byte address buffer by these types. Also starting shader model 6.2, we are mapping byte address buffer and structure buffer load/store operations to RawBufferLoad/Store to differentiate raw buffer load from typed buffer load. Unlike BufferLoad for typed buffers, RawBufferLoad for min precision types will not have its min precision values as its return types, but their actual scalar size in buffer (i.e rawBufferLoad.i32 for min16int and rawBufferLoad.f32 for min16float). RawBufferLoad/Store contains additional parameters, where mask was required for correct status behavior for CheckAccessFullyMapped, and alignment is for relative alignment for future potential benefit for backend.
2017-11-07 18:15:19 -08:00
Xiang Li f9c599bba6
Make Od the same group with o0/o1/o2/o3. (#767) 2017-11-07 10:34:02 -08:00
Young Kim 8c55bbbe6d
Denorm to function attribute (#764)
- Denorm mode to function attribute not function annotation
- Adding validation rule for fp32-denorm-mode



* Fix from comments
2017-11-06 18:09:14 -08:00
Xiang Li d8cefeb1ba
Make sure status only used by CheckAccessFullyMapped. (#763)
* Make sure status only used by CheckAccessFullyMapped.
2017-11-03 18:12:15 -07:00
Jeff Noyle 59b317d549
Skip getelementptr instructions (#751) 2017-11-01 12:31:05 -07:00
Jeff Noyle 0acdbd9a8c
PIX pixel-cost visualizer: Fix byte offset, simplify ReEmitDxilResources (#749)
* byte offset, not element offset => multiply by sizeof(dword)
set uav to r/w
Re-emit meta-data becomes delete then emit

* update test

* re-compute view id state
2017-10-31 13:37:07 -07:00
Xiang Li 8c790a8b0e
Do not generate phi of pointers. (#745)
* Disable optimizations which may generate phi of pointers.
2017-10-30 15:53:25 -07:00
Xiang Li cb2a7e46d8
Only set fastmath on binary math op. (#743) 2017-10-30 13:18:32 -07:00
Young Kim ce9d6267a5 DataLayout String and ConstantBuffer Offset Fix (#727)
This change is to update correct target data layout for DXIL. Now that we have a scalar type of size less than dwords, we need to correctly print string data layout to determine non-packed structure layout.

This change also fixes alignments issues with ConstantBuffer as it was having different CG path from cbuffer.
2017-10-26 14:51:50 -07:00
Xiang Li ef7a891ab2 Support case write to struct input. (#731) 2017-10-23 19:09:30 -07:00
Marcelo Lopez Ruiz b7ce331dee Fix unused var warning in Release, fix #709 misplaces parens (#728) 2017-10-21 14:43:23 -07:00
Lei Zhang 8702f97dff [spirv] Add support for four register number shifting options (#720)
Added the following four command line options to shift register
number for Vulkan:

* -fvk-b-shift
* -fvk-t-shift
* -fvk-s-shift
* -fvk-u-shift

These options are used to avoid assigning the same binding
number to more than one resources.
2017-10-20 19:37:11 -07:00
Young Kim 40369a5884 Structure alignment Change (#721)
Structure buffer alignment change for float16. Starting in shader model 6.2, the structure will match that of #pragma pack(8) alignment in C++

Removing padding for structure buffer. We will not have any padding in HLSL structure since load/store operation already handles offset as if padding exist in #pragma pack(8) mode in C++

Disable legacy alignment for non precision mode as it was only needed for min precision
2017-10-20 13:51:42 -07:00
Jeff Noyle 5b3f3d7c16 Another instance of parameters-that-should-have-been-undef (#718) 2017-10-18 09:07:52 -07:00
Jeff Noyle 9cb2d14005 Specify undefined values for unused arguments... (#716) 2017-10-17 14:41:40 -07:00
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
Jeff Noyle 47226d0422 PIX: Pixel count/cost pass (#457)
The pass implements functionality for PIX for the "pixel cost", "depth complexity" and "overdraw" visualizers. You can probably infer what the pass does from the names "overdraw" and "depth complexity": For each pixel rendered it increments a corresponding counter in a UAV of a buffer that is the same size as the render target. The "pixel cost" pass does the same thing, only the increment is a weight value calculated from the total cost of the draw call, as derived from PIX's GPU-side profiling system.
2017-07-25 16:08:31 -07:00
Xiang Li 9db715523f Fix arg flatten issue caused by load before init. (#447)
* Fix arg flatten issue caused by load before init.
* Refine ShaderCompatSuite.
* Remove HLFunctions has body early.
2017-07-24 18:31:45 -07:00
Xiang Li 57b583d1b1 Set resource ID in DxilLinkJob::AddResourceToDM. (#442) 2017-07-20 12:27:28 -07:00
Young Kim 4d325c78b4 Update shader model 6.2 (#435)
1. Update shader model 6.2
2. update DXIL version to 1.2 and its tests
3. Allow noalias and alias_scope metadata per instruction for validator 1.2
2017-07-19 22:00:31 -07:00
Xiang Li faaf47daa5 Mark noalias for out parameters. (#438) 2017-07-19 11:46:56 -07:00
Lei Zhang 4ff631148d Various small code tweaks (#398) 2017-07-16 18:28:35 -07:00
Jeff Noyle 82fcc7ca0f (PIX) Reduce msaa to single-sample (#427)
This pass will be used in PIX for "Dr. PIX experiments", wherein a workload is re-rendered with MSAA turned off in order to get an approximate understanding of the performance impact of MSAA.
2017-07-14 13:40:49 -07:00
Xiang Li 94acf99408 Support case struct parameter used as function call argument. (#429)
* Support case struct parameter used as function call argument.
Also skip input param copy.
2017-07-14 13:13:25 -07:00
Jeff Noyle add0d6ec4c (PIX passes) Take constant color from CB (#426)
* maybe?

* Add a "mode" that inserts CB references too

* Add tests

* Xiang's helper to recreate meta-data

* Create CB properly

* Use actual defined constant

* CR feedback: incorrect "one or the other" assert. Unnecessary sethandle. Not accounting for CB id > 0. Test CB id > 0.
2017-07-13 21:07:03 -07:00
Young Kim b952971989 Fix Typed UAV Load flag collection (#418) 2017-07-12 11:17:14 -07:00
Tex Riddell 11dd70c410 Add limited support for unbounded resource arrays in parameter list (#399)
- Fix IsHLSLResouceType typo
2017-07-11 13:07:07 -07:00
Xiang Li f0c3cbd454 Resolve name collison for dxil types in BitcodeReader. (#411)
Resolve name collison for dxil types in BitcodeReader.
2017-07-10 16:28:23 -07:00
Marcelo Lopez Ruiz d5bb3089cf Add support for custom allocators (#390)
Supporting a custom allocator for dxcompiler.
Adds recovery for exceptions and out-of-memory handling.
Add custom allocator support to linker.
Fix for release-only test failure.
Removes assertion about presence of command-line option registration
2017-07-06 16:45:48 -07:00
Jeff Noyle fa94808e09 Remove all discard instructions (#400)
* Add remove-discards pass

* explicit lfs

* Change pass name, remove copy-pasted member enum, reduced include set

* CR feedback: better way to delete instructions, stale comment, end iterator could go stale, CHECK-NOT is a good idea.
2017-06-30 13:57:12 -07:00
Young Kim 7f65e0f0d6 Clean up crlf and mixed line ending issues. (#391) 2017-06-29 16:26:20 -07:00
Xiang Li 1188a80e63 Remove noise intrinsic. (#392) 2017-06-28 10:35:25 -07:00
Jeff Noyle e0c24c6839 Implementation of "constant color output" pass for PIX (#371) 2017-06-27 10:11:24 -07:00
Tex Riddell 36798cf0bc Fix typo in StoreOutput outputSigId parameter (#385) 2017-06-26 16:39:19 -07:00
Young Kim 7f82a9e98c Check multi component uav on load not store operations. (#372)
Check multi component uav on load not store operations.
2017-06-22 11:54:52 -07:00