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

778 Коммитов

Автор SHA1 Сообщение Дата
Lei Zhang 04a5269451
[spirv] Support function foward declaration (#847) 2017-11-24 15:52:47 -05:00
Xiang Li fa0674829b
Fix crash in code gen caused by cast atomic dst address. (#843) 2017-11-24 00:55:00 -08: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
Ehsan 8d072dc9ad
[spirv] Fix potential Release build issues (#845) 2017-11-23 16:54:52 -05:00
Ehsan 31855e75a8
[spirv] Convert floats of different bit widths (#844)
Also support 'literal float' to 'float' conversion.
2017-11-23 16:54:37 -05:00
Lei Zhang 1d671e843e
[spirv] Support static member with inline initializer (#842) 2017-11-22 19:52:49 -05:00
Ehsan 998bab9dea
[spirv] Translate intrinsic msad4 function. (#808) 2017-11-22 18:36:59 -05:00
Lei Zhang 9745b0d55c
[spirv] Add support for SV_Barycentrics (#837)
The translation is done using  SPIR-V Extension
SPV_AMD_shader_explicit_vertex_parameter.
2017-11-22 18:16:48 -05:00
Lei Zhang d1f1665865
[spirv] Add support for SV_ViewID (#836)
Also error out on seeing unknown patch constant function parameter.
2017-11-22 18:16:15 -05:00
Lei Zhang ae9635c56c
[spirv] Use .getAs<>() instead of cast<>() for RecordType (#841)
cast<RecordType>(T.getTypePtr()) cannot handle cases in which
T is typedef of some struct type.
2017-11-22 17:57:05 -05:00
Ehsan 84abf7d86c
Constant evaluation for HLSLVectorElementExpr (#840) 2017-11-22 17:52:53 -05:00
Lei Zhang ac8618ab07
[spirv] Update SPIRV-Tools and mark resource write legalization (#839) 2017-11-22 13:59:27 -05:00
Lei Zhang 8d052c88f4
[spirv] Add support for semantics on structs (#831)
All fields will inherit the semantic attached to the struct, with
index increasing sequentially.
2017-11-21 10:26:17 -05:00
Xiang Li f9434c0c3f
Add textbox for entry, target, option. (#830)
* Add textbox for entry, target, option.

* Merge new ui with HlslFileVariables.
2017-11-20 21:50:52 -08:00
Young Kim 77594e8624
Change rangeID parameter for CreateHandle to const (#833) 2017-11-20 20:04:54 -08: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
Ehsan 3809395c08
[spirv] Support CXXDefaultArgExpr translation. (#825) 2017-11-20 08:46:07 -05:00
Ehsan 06aadc4789
[spirv] CheckAccessFullyMapped unsupported error (#824) 2017-11-20 08:45:43 -05:00
Xiang Li e9f0425202
Use neg+imax for iabs. (#828) 2017-11-18 00:18:31 -08:00
Lei Zhang 4ed18e7be3
[spirv] Write values of resource types as a whole (#826)
Right now we just do a load and then a store over of whole struct,
completely ignoring the storage class (and thus layout). This is
surely invalid SPIR-V, but we need this right now to enable some
workloads. Hopefully SPIRV-Tools will be able to remove these
loads/stores.

Updating associated counters for certain types is a TODO.
2017-11-17 17:50:00 -05:00
Lei Zhang cc61d9d294
[spirv] Allow samplers and textures in initializer list (#815)
They are treated as primitive types and handled as a whole.
2017-11-17 14:53:52 -05: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
Lei Zhang 0d150879fa
[spirv] Use SpirvEvalInfo to convey lvalue/rvalue (#822)
Previously we reply on Expr::isGLValue() to check whether an
expression is lvalue. That requires lots of ad-hoc fixes in
the CodeGen for missing/wrong lvalue/rvalue.

Now we use SpirvEvalInfo to calculate the lvalueness together
with the <result-id>. It is much cleaner.

Fixes https://github.com/Microsoft/DirectXShaderCompiler/issues/819
2017-11-17 11:31:52 -05:00
Lei Zhang aa7c2bc402
[spirv] Fix missing return value cases (#809)
If there are no return value specified in the source code for a
certain control flow path, just return the null value.

Previously always use OpReturn to terminate basic blocks without
explict return statement from the source code, which may cause
illegal SPIR-V generated.
2017-11-17 09:31:23 -05:00
Lei Zhang 406fe38220
Add validation checks for HS/GS attributes after parsing (#768)
This commit add checking for three HS/GS rules:

* HS entry point should have the patchconstantfunc attribute
* GS entry point should have the maxvertexcount attribute
* GS stream-output objects should be inout parameters
2017-11-16 18:44:27 -05:00
Ehsan 9772bf6c5a
[spirv] Fix location mismatches between HS and DS (#821)
Uses location assignments in alphabetical order for HS outputs and DS
inputs. This will make the interface matching for these two stages
robust.
2017-11-16 18:20:24 -05:00
Tex Riddell 8cf7292bee
Fix IsTypeNumeric hang with incomplete array (#760)
* Fix IsTypeNumeric hang with incomplete array
* Fix IsTypeNumeric for empty nested struct.
2017-11-16 11:40:51 -08: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
Lei Zhang 6e874ab3fe
[spirv] Turn SpirvEvalInfo into a class (#820)
Cleaned up methods on SpirvEvalInfo. Also added a new field or
lvalue/rvalue, which will be used later.
2017-11-16 14:25:00 -05:00
Lei Zhang 4a4d1134ef
[spirv] Emit unsupported error for some intrinsics (#797)
* abort
* GetRenderTargetSampleCount
* GetRenderTargetSamplePosition
* GatherCmpGreen
* GatherCmpBlue
* GatherCmpAlpha
* GetSamplePosition
* CalculateLevelOfDetailUnclamped
2017-11-16 14:23:03 -05:00
Lei Zhang ddf64b3258
[spirv] Emit warnings for the same binding number (#816)
This is to enable certain workflows that reflection is used to
change the binding numbers after codegen.
2017-11-16 12:13:41 -05:00
Ehsan 511ef092a9
[spirv] Handle inout structs. Fixed issue #806. (#810) 2017-11-16 11:25:00 -05:00
Lei Zhang dc0babf2ff
[spirv] Validate vk::push_constant usage (#807)
Attaching vk::push_constant and vk::binding to the same global
variable is disallowed.
2017-11-16 08:57:23 -05: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
Lei Zhang 21f16a1eaf
[spirv] Emit note for the intial use location of bindings (#811)
This makes it easier for the devs to see with which a binding
numbers is conflicting.
2017-11-15 18:36:04 -05:00
Young Kim 5016218962
Fix dxc help message (#813) 2017-11-15 14:08:54 -08:00
Lei Zhang 83e23e6954
[spirv] Add support for SV_Coverage (#800)
Also emit an error for SV_InnerCoverage.
2017-11-15 12:02:27 -05:00
Ehsan 576a805117
[spirv] Translate intrinsic dst function. (#801) 2017-11-15 10:14:24 -05:00
Lei Zhang 6788ebea4a
[spirv] Add support for [[vk::push_constant]] (#791)
[[vk::push_constant]] can be attached to a global variable of
struct type to put that variable in the PushConstant storage
class.

PushConstant should be of OpTypeStruct type with std430 layout.
2017-11-15 08:14:22 -05: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
Ehsan b32bc384a3
[spirv] Translate intrinsic D3DCOLORtoUBYTE4. (#799) 2017-11-14 11:09:51 -05:00
Lei Zhang 0d462693b5
[spirv] Add support for SV_ViewportIndex (#796) 2017-11-14 10:56:53 -05: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
Lei Zhang e9a2c759b5
[spirv] Support SV_RenderTargetArrayIndex and SV_StencilRef (#789) 2017-11-13 14:44:04 -05:00
Ehsan 4d97841e33
[spirv] Translate *MemoryBarrier* intrinsics. (#790)
* Translation of GroupMemoryBarrier(WithGroupSync)
* Translation of DeviceMemoryBarrier(WithGroupSync)
* Translation of AllMemoryBarrier(WithGroupSync)
2017-11-13 14:08:13 -05:00
Lei Zhang df7fcb5469
[spirv] Emit warnings for cbuffer/tbuffer member initializers (#794)
Also modified the testing infrastructure to support checking
warning messages.
2017-11-13 12:51:58 -05:00
Lei Zhang e40535653f
[spirv] Emit Invocations execution mode in GS (#793)
OpExecutionMode Invocations n should be emitted for [instance(n)]
on GS. n defaults to 1.
2017-11-13 10:43:31 -05:00