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

429 Коммитов

Автор SHA1 Сообщение Дата
Tex Riddell 6e6f8dbdf6 Merged PR 24: Require payload/attribute/param structs for ray shaders. (MD CHANGE)
Require payload/attribute/param structs for ray shaders. (MD CHANGE)
2018-02-21 21:50:39 +00:00
Tex Riddell 634fd7556b Merge branch 'rtmaster' into user/texr/rt-merge-rebase 2018-02-20 19:12:09 -08:00
Tex Riddell 62ab8fc3d2 Merged PR 25: Fix res IDs after pruning in DxilLowerCreateHandleForLib
Fix res IDs after pruning in DxilLowerCreateHandleForLib
2018-02-21 03:02:46 +00:00
Xiang Li cda6c52875
Save signature debug info to alloca. (#1087) 2018-02-20 18:44:04 -08:00
Xiang_Li (XBox) 4a0950ea79 Merged PR 27: Keep resource global in LLVMUsed and remove in RemoveResourceSymbols
- prevents GV removal while resource still points to it
2018-02-20 23:09:36 +00:00
Young Kim b287dd7d71
More overload for TextureGather and TextureGatherCmp (#1069) 2018-02-20 12:35:19 -08:00
Xiang Li aed4f7a7b0 Refine DemangleFunctionName. 2018-02-16 18:17:56 -08:00
Xiang Li 32d1bb7f78 Fix issue for use demangled name when add function. 2018-02-16 17:48:54 -08:00
Xiang Li 47958a9410 Support export when link to library. 2018-02-16 17:48:53 -08:00
Tex Riddell 824f7b0f8d TranslatePreciseAttribute for libraries. 2018-02-14 14:05:13 -08:00
Tex Riddell d8588efbb1 Remove/refactor dead code paths for flattenning library functions 2018-02-13 15:12:03 -08:00
Tex Riddell ca260c3891 Fix line endings. 2018-02-12 18:17:52 -08:00
Tex Riddell 7d145d64d5 Merge branch 'master' into user/texr/rt-merge-rebase 2018-02-12 17:51:50 -08:00
Young Kim 2af98c8a43
Bump up version number. (#1066)
bump up version to SM6.3 and DXIL1.3
2018-02-12 13:27:48 -08:00
Tex Riddell 7da55d9268 Fix SROA on UDT passed to new intrinsics. 2018-02-12 13:11:31 -08:00
Lei Zhang 7dbfa84a14
Add an option to allow pre-expand token-pasting (##) operands (#1065)
The fxc compiler evaluates both operands before performing the
token-pasting operation. But the default Clang way is to follow
C standard, which token-pastes operands as-is, without any
pre-expanding.

This commit adds support for the fxc behavior via the command
line option: -flegacy-macro-expansion.

Fixes https://github.com/Microsoft/DirectXShaderCompiler/issues/1005
2018-02-09 14:31:12 -05:00
Jeff Noyle 72a280776c
Off by one (character) (#1063) 2018-02-09 10:51:38 -08:00
Xiang Li 7f186874d2 Code cleanup. 2018-02-08 17:10:16 -08:00
Xiang_Li (XBox) fef0933a96 Merged PR 13: Support debug info for linking.
Support debug info for linking.
2018-02-08 22:46:01 +00:00
Xiang Li ce0bddfc43 Support debug info for linking. 2018-02-08 14:34:10 -08:00
Xiang_Li (XBox) 6c880a22c8 Merged PR 12: Remove nonUniform metadata after generate createHandle.
Remove nonUniform metadata after generate createHandle.
2018-02-08 19:22:29 +00:00
Xiang Li dd5a8cd377 Remove nonUniform metadata after generate createHandle. 2018-02-08 11:00:33 -08:00
Tex Riddell efa99e75ec Skip validator version check when linking to lib target. 2018-02-08 01:28:37 -08:00
Xiang Li 247f74a647 Support link to lib. 2018-02-07 19:34:26 -08:00
Xiang Li c6915bcccd Support nonUniform. 2018-02-07 14:02:43 -08:00
Tex Riddell 8beb970b51 OP::GetTypeName - use struct name for UDT and return StringRef 2018-02-07 12:28:12 -08:00
Xiang Li 84546aa8f1 Not set GlobalVariable to constant.
Update tests.
2018-02-07 11:33:39 -08:00
Tex Riddell 005c534977 Fix OP::GetTypeName = used in if instead of == causing assert. 2018-02-07 01:45:25 -08:00
Tex Riddell 0c55780ce4 Legalize IO for lib func, HLMatrixLowerPass: fix value args, other cleanup. 2018-02-07 01:02:54 -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
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 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