mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-30 14:40:34 +00:00
0842dbb39a
This PR adds a CreateParseContext() fn analogous to CreateBuiltInParseables(), to create a language specific built in parser. (This code was present before but not encapsualted in a fn). This can now be used to create a source language specific parser for builtins. Along with this, the code creating HLSL intrinsic prototypes can now produce them in HLSL syntax, rather than GLSL syntax. This relaxes certain prior restrictions at the parser level. Lower layers (e.g, SPIR-V) may still have such restrictions, such as around Nx1 matrices: this code does not impact that. This PR also fleshes out matrix types for bools and ints, both of which were partially in place before. This was easier than maintaining the restrictions in the HLSL prototype generator to avoid creating protoypes with those types. Many tests change because the result type from intrinsics moves from "global" to "temp". Several new tests are added for the new types.
32 lines
594 B
GLSL
32 lines
594 B
GLSL
|
|
void TestMatNx1()
|
|
{
|
|
float1x1 f1x1;
|
|
float2x1 f2x1;
|
|
float3x1 f3x1;
|
|
float4x1 f4x1;
|
|
|
|
float1x2 f1x2;
|
|
float1x3 f1x3;
|
|
float1x4 f1x4;
|
|
|
|
float1x1 r00 = transpose(f1x1);
|
|
float1x2 r01 = transpose(f2x1);
|
|
float1x3 r02 = transpose(f3x1);
|
|
float1x4 r03 = transpose(f4x1);
|
|
|
|
float1x1 r10 = transpose(f1x1);
|
|
float2x1 r11 = transpose(f1x2);
|
|
float3x1 r12 = transpose(f1x3);
|
|
float4x1 r13 = transpose(f1x4);
|
|
}
|
|
|
|
struct PS_OUTPUT { float4 color : SV_Target0; };
|
|
|
|
PS_OUTPUT main()
|
|
{
|
|
PS_OUTPUT ps_output;
|
|
ps_output.color = 1.0;
|
|
return ps_output;
|
|
};
|