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.
Also make parameter names clear that they are for patch constant
function (PCF), not generally patch constant, which also involves
some domain shader inputs.
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.
* 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
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.
A new attribute [[vk::counter_binding(X)]] can be used to specify
the binding number for associated counters for RW/append/consume
structured buffers.
Also added support for .IncrementCounter() and .DecrementCounter()
for RWStructuredBuffer.
Also fixed the type error of OpAtomicI{Add|Sub}.
Added necessary functionality to handle domain shader translation.
Also added Bezier domain shader as test.
Also added Patch decoration to the hull shader patch constant outputs and
the domain shader patch constant inputs.
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.
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