- Aug 31, 2017
-
-
LoopDawg authored
Changes: (1) Allow clip/cull builtins as both input and output in the same shader stage. Previously, not enough data was tracked to handle this. (2) Handle the extra array dimension in GS inputs. The synthesized external variable can now be created with the extra array dimension if needed, and the form conversion code is able to handle it as well. For example, both of these GS inputs would result in the same synthesized external type: triangle in float4 clip[3] : SV_ClipDistance triangle in float2 clip[3][2] : SV_ClipDistance In the second case, the inner array dimension packs with the 2-vector of floats into an array[4], which there is an array[3] of due to the triangle geometry.
-
- Aug 28, 2017
-
-
John Kessenich authored
HLSL: (minor) fix type on clip/cull index result
-
LoopDawg authored
While adding geometry stage support for clip/cull, it transpired that the existing clip/cull support was not setting the type of the result of indexing into the clup/cull variable. That's a defect independent of the geometry support, so to simplify the geometry PR, this is addressed separately. It doesn't appear to change the generated SPIR-V, but that's probably down to something else tolerating a bad input.
-
- Aug 26, 2017
-
-
John Kessenich authored
Fix #1019.
-
John Kessenich authored
Fix #1020. Fix #1021. Fix #1022.
-
- Aug 25, 2017
-
-
John Kessenich authored
SPV: 1st pass implementation of SPV_EXT_shader_viewport_index_layer.
-
John Kessenich authored
SPV reflection: Add OpModuleProcessed for compile options.
-
John Kessenich authored
-
John Kessenich authored
-
- Aug 24, 2017
-
-
John Kessenich authored
HLSL: handle clip and cull distance input builtin type conversion
-
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.
-
John Kessenich authored
Implement extension GL_AMD_shader_image_load_store_lod
-
- Aug 23, 2017
-
-
John Kessenich authored
SPV: Implement extension SPV_EXT_shader_stencil_export
-
Rex Xu authored
-
Rex Xu authored
-
John Kessenich authored
-
- Aug 19, 2017
-
-
John Kessenich authored
-
John Kessenich authored
HLSL: add methods to handle user structures in texture template type.
-
John Kessenich authored
-
- Aug 18, 2017
-
-
John Kessenich authored
-
- Aug 15, 2017
-
-
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.
-
- Aug 11, 2017
-
-
John Kessenich authored
-
John Kessenich authored
This prevents potentional sharing from inadvertently affecting other arrays.
-
- Aug 10, 2017
-
-
John Kessenich authored
-
- Aug 09, 2017
-
-
John Kessenich authored
This will help in expanding flattening and reducing splitting.
-
John Kessenich authored
-
- Aug 08, 2017
-
-
John Kessenich authored
-
- Aug 07, 2017
-
-
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.
-
- Aug 05, 2017
-
-
John Kessenich authored
HLSL: fix qualifier propagation from user struct types to block defin…
-
- Aug 04, 2017
-
-
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
-
- Aug 02, 2017
-
-
John Kessenich authored
-