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

747 Коммитов

Автор SHA1 Сообщение Дата
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
Ehsan 4bd93f66a3
[spirv] tbuffer and TextureBuffer support. (#787) 2017-11-10 17:07:43 -05:00
Lei Zhang 909351314c
[spirv] Use Workgroup storage class for groupshared variables (#788) 2017-11-10 16:49:34 -05:00
Lei Zhang a579b3eaef
[spirv] Add support for f16tof32() and f32tof16() (#786)
Fixes https://github.com/Microsoft/DirectXShaderCompiler/issues/785
2017-11-10 12:31:52 -05:00
Lei Zhang 68ef628bd9
[spirv] Complete the support for SV semantics in all stages (#775)
Covers the following SVs for all their legal SigPoints:

* SV_Position
* SV_ClipDistance
* SV_CullDistance
* SV_VertexID
* SV_InstanceID
* SV_Depth
* SV_DepthGreaterEqual
* SV_DepthLessEqual
* SV_OutputControlPointID
* SV_DomainLocation
* SV_GSInstanceID
* SV_IsFrontFace
* SV_DispatchTreadID
* SV_GroupID
* SV_GroupThreadID
* SV_GroupIndex
* SV_TessFactor
* SV_InsideTessFactor
* SV_PrimitiveID
* SV_SampleIndex
2017-11-10 11:47:50 -05:00
Ehsan 2b4c488091
[spirv] Test case for empty struct stage variables (#777) 2017-11-09 10:53:34 -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
Ehsan 56b1f9628e
[spirv] Add location to error messages and unify. (#776) 2017-11-09 08:35:43 -08:00
Lei Zhang 3caadf5001
[spirv] Update external dependencies (#779) 2017-11-09 10:26:33 -05:00
Ehsan d756ff5094
[spirv] Handle alignment & offset of empty structs (#774) 2017-11-08 11:31:22 -08:00
Lei Zhang 37eade8495
[spirv] Add support for basic geometry shader (#772)
This commit supports .Append() and .RestartStrip() method calls
on stream-output objects, which will be translated into SPIR-V
OpEmitVertex and OpEndPrimitive, respectively.

For each .Append() call, all affected stage output variables
will be flushed.
2017-11-08 11:41:43 -05:00
Lei Zhang 87d66c9d09
[spirv] Add doc and tests for snorm/unorm float type (#773) 2017-11-08 10:49:32 -05: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
John Porto 6a25d56df2
Modifies CodeGenSimpleHS 10 and 11 so that they use target hs_6_0 (#766) 2017-11-07 15:13:04 -08:00
Ehsan 7cb1c20853
[spirv] Handle TessFactor size mismatches. (#771) 2017-11-07 12:37:02 -08:00
Lei Zhang dc3d2c7921
[spirv] Require ClipDistance/CullDistance capability on use (#769)
Declaring but not using (reading/writing) ClipDistance/CullDistance
does not require the ClipDistance/CullDistance capability.
2017-11-07 15:17:13 -05:00
Lei Zhang 5759c22d82
[spirv] Add check for Patch decoration in interface tests (#770)
Also make parameter names clear that they are for patch constant
function (PCF), not generally patch constant, which also involves
some domain shader inputs.
2017-11-07 14:30:29 -05:00
Xiang Li f9c599bba6
Make Od the same group with o0/o1/o2/o3. (#767) 2017-11-07 10:34:02 -08:00
Lei Zhang 734266277b
[spirv] Change vertex processing stages to emit gl_PerVertex (#757)
As per the Vulkan spec requirement:

  Any variable decorated with Position must be declared as a
  four-component vector of 32-bit floating-point values.

But for HS/DS/GS, we actually have an extra arrayness. If we
generate a stand-alone Postion builtin variable, it will be
an array of float4, which does not comply with the spec.

Similary for the type requirements on ClipDistance and
CullDistance.

The spec could have an problem on this issue, but the GLSL way
is to emit a gl_PerVertex that contains Position, ClipDistance,
and CullDistance. That satisfies the current Vulkan spec.

This commit converts VS output, HS/DS input and output, GS
input to emit the gl_PerVertex struct. It also splits arrays
of structs into arrays of the fields for HS/DS/GS input/output.

ClipDistance/CullDistance is also supported in this commit,
which requires quite some non-trivial handling.
2017-11-07 09:56:10 -05: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
Jeff Noyle 966eb72fc4
Emit all the args (#765) 2017-11-06 16:25:36 -08:00
John Porto 502323cb73
moves the patch constant fn validation to the backend. (#754)
* moves the patch constant fn validation to the backend.

* addresses comments

* fixes broken test
2017-11-06 12:41: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
Ehsan 97aab11faf
[spirv] Translate intrinsic asdouble and asuint. (#758) 2017-11-03 05:38:08 -07:00
Ehsan 4b7fab259f
[spirv] Add support for HLSLMatrixTruncationCast (#753) 2017-11-03 05:37:46 -07:00
Tex Riddell 694296b6b0
Add target-dependent experimental function attribute (#759) 2017-11-02 19:20:57 -07:00
Lei Zhang 6f9fb6a534
[spirv] Remove duplicated HLSL type probing methods (#755) 2017-11-02 12:32:48 -04:00
Lei Zhang 2a15ef6914
[spirv] Fix effcee error message check name and file name (#756) 2017-11-02 12:30:08 -04:00
Jeff Noyle 59b317d549
Skip getelementptr instructions (#751) 2017-11-01 12:31:05 -07:00
Ehsan 529f6ee6bf
[spirv] Translate FlatConversion implicit cast. (#750) 2017-11-01 09:29:09 -07:00
Ehsan 317eba1b86
[spirv] Emit error for tex*() intrinsic functions. (#738) 2017-11-01 06:19:21 -07:00
Xiang Li adcdb2ccba
Use _wcsicmp instead of wcsicmp. (#752) 2017-10-31 18:09:39 -07:00