HLSL: use HLSL parser to parse HLSL intrinsic prototypes, enable int/bool mats

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.
This commit is contained in:
steve-lunarg
2016-11-15 10:11:04 -07:00
parent fabe7d6a61
commit 0842dbb39a
43 changed files with 3729 additions and 2033 deletions

View File

@@ -8,7 +8,7 @@ gl_FragCoord origin is upper left
0:25 Sequence
0:25 move second child to first child (temp 4-component vector of float)
0:25 'txval20' (temp 4-component vector of float)
0:25 textureGatherOffset (global 4-component vector of float)
0:25 textureGatherOffset (temp 4-component vector of float)
0:25 Construct combined texture-sampler (temp sampler2DArray)
0:25 'g_tTex2df4' (uniform texture2DArray)
0:25 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -22,7 +22,7 @@ gl_FragCoord origin is upper left
0:26 Sequence
0:26 move second child to first child (temp 4-component vector of int)
0:26 'txval21' (temp 4-component vector of int)
0:26 textureGatherOffset (global 4-component vector of int)
0:26 textureGatherOffset (temp 4-component vector of int)
0:26 Construct combined texture-sampler (temp isampler2DArray)
0:26 'g_tTex2di4' (uniform itexture2DArray)
0:26 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -36,7 +36,7 @@ gl_FragCoord origin is upper left
0:27 Sequence
0:27 move second child to first child (temp 4-component vector of uint)
0:27 'txval22' (temp 4-component vector of uint)
0:27 textureGatherOffset (global 4-component vector of uint)
0:27 textureGatherOffset (temp 4-component vector of uint)
0:27 Construct combined texture-sampler (temp usampler2DArray)
0:27 'g_tTex2du4' (uniform utexture2DArray)
0:27 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -104,7 +104,7 @@ gl_FragCoord origin is upper left
0:25 Sequence
0:25 move second child to first child (temp 4-component vector of float)
0:25 'txval20' (temp 4-component vector of float)
0:25 textureGatherOffset (global 4-component vector of float)
0:25 textureGatherOffset (temp 4-component vector of float)
0:25 Construct combined texture-sampler (temp sampler2DArray)
0:25 'g_tTex2df4' (uniform texture2DArray)
0:25 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -118,7 +118,7 @@ gl_FragCoord origin is upper left
0:26 Sequence
0:26 move second child to first child (temp 4-component vector of int)
0:26 'txval21' (temp 4-component vector of int)
0:26 textureGatherOffset (global 4-component vector of int)
0:26 textureGatherOffset (temp 4-component vector of int)
0:26 Construct combined texture-sampler (temp isampler2DArray)
0:26 'g_tTex2di4' (uniform itexture2DArray)
0:26 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -132,7 +132,7 @@ gl_FragCoord origin is upper left
0:27 Sequence
0:27 move second child to first child (temp 4-component vector of uint)
0:27 'txval22' (temp 4-component vector of uint)
0:27 textureGatherOffset (global 4-component vector of uint)
0:27 textureGatherOffset (temp 4-component vector of uint)
0:27 Construct combined texture-sampler (temp usampler2DArray)
0:27 'g_tTex2du4' (uniform utexture2DArray)
0:27 'g_sSamp' (layout(binding=0 ) uniform sampler)