- 24 Aug, 2017 1 commit
-
-
LoopDawg authored
HLSL allows a range of types for clip and cull distances. There are three dimensions, including arrayness, vectorness, and semantic ID. SPIR-V requires clip and cull distance be a single array of floats in all cases. This code provides input side conversion between the SPIR-V form and the HLSL form. (Output conversion was added in PR #947 and #997). This PR extends HlslParseContext::assignClipCullDistance to cope with the input side conversion. Not as much changed as appears: there was also a lot of renaming to reflect the fact that the code now handles either direction. Currently, non-{frag,vert} stages are not handled, and are explicitly rejected. Fixes #1026.
-
- 19 Aug, 2017 3 commits
-
-
John Kessenich authored
-
John Kessenich authored
HLSL: add methods to handle user structures in texture template type.
-
John Kessenich authored
-
- 18 Aug, 2017 1 commit
-
-
John Kessenich authored
-
- 15 Aug, 2017 4 commits
-
-
LoopDawg authored
Some languages allow a restricted set of user structure types returned from texture sampling operations. Restrictions include the total vector size of all components may not exceed 4, and the basic types of all members must be identical. This adds underpinnings for that ability. Because storing a whole TType or even a simple TTypeList in the TSampler would be expensive, the structure definition is held in a table outside the TType. The TSampler contains a small bitfield index, currently 4 bits to support up to 15 separate texture template structure types, but that can be adjusted up or down. Vector returns are handled as before. There are abstraction methods accepting and returning a TType (such as may have been parsed from a grammar). The new methods will accept a texture template type and set the sampler to the structure if possible, checking a range of error conditions such as whether the total structure vector components exceed 4, or whether their basic types differe, or whether the struct contains non-vector-or-scalar members. Another query returns the appropriate TType for the sampler. High level summary of design: In the TSampler, this holds an index into the texture structure return type table: unsigned int structReturnIndex : structReturnIndexBits; These are the methods to set or get the return type from the TSampler. They work for vector or structure returns, and potentially could be expanded to handle other things (small arrays?) if ever needed. bool setTextureReturnType(TSampler& sampler, const TType& retType, const TSourceLoc& loc); void getTextureReturnType(const TSampler& sampler, const TType& retType, const TSourceLoc& loc) const; The ``convertReturn`` lambda in ``HlslParseContext::decomposeSampleMethods`` is greatly expanded to know how to copy a vec4 sample return to whatever the structure type should be. This is a little awkward since it involves introducing a comma expression to return the proper aggregate value after a set of memberwise copies. -
John Kessenich authored
This generated code needs an optimization pass to eliminate the assignments to the opaque members.
-
John Kessenich authored
HLSL: Flatten structs for all non-arrayed I/O interfaces.
-
John Kessenich authored
Code was reflecting an old historical use of sampled as a SPIR-V 2-valued operand, instead of its current 3 values.
-
- 11 Aug, 2017 2 commits
-
-
John Kessenich authored
-
John Kessenich authored
This prevents potentional sharing from inadvertently affecting other arrays.
-
- 10 Aug, 2017 1 commit
-
-
John Kessenich authored
-
- 09 Aug, 2017 2 commits
-
-
John Kessenich authored
This will help in expanding flattening and reducing splitting.
-
John Kessenich authored
-
- 08 Aug, 2017 1 commit
-
-
John Kessenich authored
-
- 07 Aug, 2017 3 commits
-
-
John Kessenich authored
HLSL: implement #pragma pack_matrix(layout)
-
LoopDawg authored
This adds support for #pragma pack_matrix() to the HLSL front end. The pragma sets the default matrix layout for subsequent unqualified matrices in structs or buffers. Explicit qualification overrides the pragma value. Matrix layout is not permitted at the structure level in HLSL, so only leaves which are matrix types can be so qualified. Note that due to the semantic (not layout) difference in first matrix indirections between HLSL and SPIR-V, the sense of row and column major are flipped. That's independent of this PR: just a factor to note. A column_major qualifier appears as a RowMajor member decoration in SPIR-V modules, and vice versa.
-
John Kessenich authored
Includes related trackLinkage() code removal and name improvements.
-
- 05 Aug, 2017 1 commit
-
-
John Kessenich authored
HLSL: fix qualifier propagation from user struct types to block defin…
-
- 04 Aug, 2017 5 commits
-
-
LoopDawg authored
The HLSL FE tracks four versions of a declared type to avoid losing information, since it is not (at type-decl time) known how the type will be used downstream. If such a type was used in a cbuffer declaration, the cbuffer type's members should have been using the uniform form of the original user structure type, but were not. This would manifest as matrix qualifiers (and other things, such as pack offsets) on user struct members going missing in the SPIR-V module if the struct type was a member of a cbuffer, like so: struct MyBuffer { row_major float4x4 mat1; column_major float4x4 mat2; }; cbuffer Example { MyBuffer g_MyBuffer; }; Fixes: #789 -
John Kessenich authored
This allows removal of isPerVertexBuiltIn(). It also leads to removal of addInterstageIoToLinkage(), which is no longer needed. Includes related name improvements.
-
John Kessenich authored
-
John Kessenich authored
The goal is to flatten all I/O, but there are multiple categories and steps to complete, likely including a final unification of splitting and flattening.
-
John Kessenich authored
-
- 02 Aug, 2017 1 commit
-
-
John Kessenich authored
-
- 01 Aug, 2017 1 commit
-
-
John Kessenich authored
GLSL: Add GLSL 4.60 features
-
- 31 Jul, 2017 7 commits
-
-
John Kessenich authored
-
John Kessenich authored
-
John Kessenich authored
-
John Kessenich authored
-
John Kessenich authored
-
John Kessenich authored
-
John Kessenich authored
Most of this was obsoleted by entry-point wrapping. Some other is just unnecessary. Also, includes some spelling/name improvements. This is to help lay ground work for flattening user I/O.
-
- 29 Jul, 2017 2 commits
-
-
John Kessenich authored
HLSL: Non-functional: warning fix + remove unused member
-
- 28 Jul, 2017 3 commits
-
-
John Kessenich authored
-
John Kessenich authored
-
John Kessenich authored
-
- 27 Jul, 2017 2 commits
-
-
John Kessenich authored
SPV: Memory qualifiers should decorate top-level block members
-
Rex Xu authored
-