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

104 Коммитов

Автор SHA1 Сообщение Дата
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
Greg Roth 5481aca58f [linux-port] Remove unused from HLSL code (#1315)
Removes unused variables and functions from code between HLSL
change comments in LLVM code or else in HLSL or SPIRV original
source files along with any code correspondingly rendered unused
or originally in service of these ultimately unused elements.
Each of these produces a warning in clang, gcc, or both.
Fixes around 458 clang warnings and 461 gcc warnings.
2018-06-17 08:03:25 -04:00
Tex Riddell 9a2a731b7b Fix regressions with entry props/sigs and UseMinPrecision flag
- Make sure entry/signature data is available once SetShaderModel() is
  called for shader targets (not for library).
- Add bUseMinPrecision flag to SetShaderModel() since the global switch
  is needed at that point.
- Remove SetUseMinPrecision() since it should be set in SetShaderModel()
  and should not be changed.
- Modify DxilModule loading to initialize UseMinPrecision flag correctly
  for entry signatures, and fix signature copy constructor.
- Remove DxilModule level entry property duplicates, use the
  DxilFunctionProps instead, except where useful (GS stream mask),
  and make sure these are always available/in-sync.
- Fix various code accessing properties that don't match target
- Fix various ordering issues causing bugs in properties
- Don't duplicate functions to strip them of parameters when they have
  already been stripped (linker hits this).
2018-06-12 15:29:39 -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
Tex Riddell a7807585ea Merge branch 'rtmaster' into dxil-update 2018-06-08 15:52:04 -07:00
Greg Roth 6121df782a [linux-port] Correct problematic initializations (#1321)
Regardless of the order of variables placed in a constructor
member initializer list, the variables are initialized in the
order they are listed in the class or struct. This can cause
issues where the assignment of one variable depends on the other.
For this reason, a warning is produced if the member variables
are listed in a different order. This change moves the member
initializer lists into the order they were being initialized.
Fixes 23 clang and 24 gcc warnings.

Initialization of members of a larger aggregate type may benefit
from braces to clarify which variables are expected to go where.
At the same time, scalars should not be so segregated. This places
or removes such braces wherever appropriate.
Fixes 144 clang warnings
2018-06-08 07:19:20 +08:00
Xiang_Li (XBox) 2adce9a983 Merged PR 80: Merge EntrySignature and FunctionProps together.
Merge EntrySignature and FunctionProps together.
2018-06-07 02:04:03 +00:00
Tex Riddell a078a0ab44 Merged PR 85: Don't validate external user defined functions as if they are Dxil Ops
Don't validate external user defined functions as if they are Dxil Ops
2018-06-07 00:16:46 +00:00
Greg Roth d975f150b7 [linux-port] Correct conditional groupings (#1326)
Clang and gcc complain when AND and OR logical operations are both
used in a single conditional because of the possibility of mistakes
when depending solely on operator precedence. In fact, this change
fixes a few clear errors mostly in asserts that would never fire.
Fixes 13 clang and 22 gcc warnings.

Additionally, when two if statements are followed by an else, there
may be some ambiguity in terms of which if the else applies to. It
is the closest one, the second in the case of two, but it is another
area of potential mistakes. Adding braces around the code intended
as the block of the first if conditional clarifies this.
fixed 8 clang and 8 gcc warnings.

Clang complains sometimes when assignments take place in a
conditional without additional parenthesis around it. It can
indicate when what was meant to be an equal comparison is replaced
with an assignment.
fixes 2 clang warnings.
2018-06-02 04:19:14 -04:00
Greg Roth c8184d216c [linux-port] Dummy access to unused variables (#1325)
Simply including a variable as the entirity of an expression is
insufficient to silence warnings for gcc and clang. The variable
is not reported as unused, which is the intent, but the expression
result is reported in a warning as unused. By casting that
expression as (void), both warnings are silenced.
Fixes 110 clang and 40 gcc warnings.
2018-06-01 19:44:16 -04:00
Xiang_Li (XBox) f968cbf19e Merged PR 81: Remove dynamic_cast.
Remove dynamic_cast.
2018-06-01 19:44:57 +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
Xiang_Li (XBox) 630879e980 Merged PR 77: Enable validation for lib.
Enable validation for lib.
TODO: add more lib validation rules.
2018-05-31 02:15:13 +00: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
Ehsan e6d169dcf1
[linux-port] Avoid using enum class as set key. (#178) (#1288)
Using an enum class as the key of an unordered_set is supported starting
C++14.

The two possible solutions are: a) provide a hash function b) cast to
unsigned. Given the usage here, it latter is a simpler fix.
2018-05-16 13:04:16 -04:00
Greg Roth d9738f8889 [linux-port] Fix template ambiguities (#1277)
Templated iterators often have a dependent scope, which annoys
some compilers because they can't tell if the typename evaluates
to a type or a variable name. This adds typename keywords to
remove the ambiguity in removeResources.

Additionally, the std toupper function can't be found for the sake
of the templated call to std::transform in ValidateSignature
function. By adding :: to clarify it, the template can be evaluated.
2018-05-12 07:52:00 -04: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
Lei Zhang c82edd6c5f
Change SAL __override to C++11 override (#1212) 2018-04-26 15:18:56 -04:00
Young Kim 20067a37fe Merged PR 35: Merge user/kiyoung/function-feature-flag to user/texr/rt-merge-rebase
- Refactoring ShaderFlag out of DxilModule
- Have Shader Flag per function on RDAT blob
2018-03-08 01:59:39 +00: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 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
Xiang Li dd5a8cd377 Remove nonUniform metadata after generate createHandle. 2018-02-08 11:00:33 -08:00
Xiang Li c6915bcccd Support nonUniform. 2018-02-07 14:02:43 -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 519938f12e Lower HLCreateHandle into CreateHandleFromResourceStructForLib. 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
Young Kim a43147de94
Add validation for Quad operations against non pixel shaders (#986) 2018-01-16 10:33:47 -08:00
Young Kim 1d48a06455
Add validation to check unknown function attributes (#963) 2018-01-04 17:01:10 -08:00
Xiang Li b816c124f1
Support resource select for lib profile. (#940) 2017-12-20 10:47:29 -08:00
Xiang Li 4f7016af53
Support isfrontface as uint. (#919) 2017-12-13 20:41:51 -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
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
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
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
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
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
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
Xiang Li 3f866d5e70 Use lazy load for linking. (#527) 2017-08-07 12:14:24 -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 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
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