Commit Graph

957 Commits

Author SHA1 Message Date
steve-lunarg
db2e3b4169 HLSL: fix crash on empty sequence node passed to intrinsic expansions 2017-03-31 12:47:34 -06:00
John Kessenich
9ce76553b8 Merge pull request #797 from steve-lunarg/scalar-length
HLSL: allow length() on scalars
2017-03-31 09:26:47 -06:00
John Kessenich
18958f6cd2 HLSL: Fix #802: Preserve promoted child under ! operator. 2017-03-30 23:32:21 -06:00
John Kessenich
7e997e2612 HLSL: Implicit bool conversions for conditional expressions and related.
Covers if(cond), while(cond), do-while(cond), for(;cond;), and (cond ? :).
Fixes #778.
2017-03-30 22:52:33 -06:00
John Kessenich
8f9fdc986a HLSL: Add namespace grammar and some basic semantics.
Unknown how extensive the semantics need to be yet. Need real
feedback from workloads. This is just done as part of unifying it
with the class/struct namespaces and grammar productions.
2017-03-30 16:30:17 -06:00
John Kessenich
e434ad923e Fix #809: smear scalar condition in OpSelect for selecting vector operands. 2017-03-30 10:16:22 -06:00
Rex Xu
470026f9d7 HLSL: Fix an issue of frexp().
The "exp" parameter is floating-point type in HLSL intrinsic while it is
integer type in GLSL built-in function.
2017-03-29 17:12:40 +08:00
Rex Xu
86e49d1773 HLSL: Move frexp() to a separate test file. 2017-03-29 17:04:58 +08:00
John Kessenich
9fb31ce8ec Tests: strengthen the value of test for NV members. 2017-03-24 18:58:48 -06:00
John Kessenich
0e7378446b Fix #790: Don't emit NV-specific interface members unless enabled by extension. 2017-03-24 18:40:40 -06:00
steve-lunarg
1ca04c2bbd HLSL: allow length() on scalars 2017-03-24 10:12:53 -06:00
steve-lunarg
d8e34c5119 HLSL: fix crash on empty struct return from entry point 2017-03-24 08:56:37 -06:00
John Kessenich
19ea56899c Tests: Update test results. 2017-03-23 14:52:38 -06:00
John Kessenich
000c818efb HLSL: Allow use of $Global members in between function calls.
This allows global initializers to use $Global members.
2017-03-22 23:21:34 -06:00
John Kessenich
7a41f96d10 HLSL: Implement 'this' keyword. 2017-03-22 11:38:22 -06:00
John Kessenich
3778979cd4 HLSL: non-static member functions: track and find active anonymous 'this' scopes and members.
Thanks to @steve-lunarg for his input and discussions on handling member functions.
2017-03-21 23:56:40 -06:00
John Kessenich
1dd65ca398 Merge pull request #779 from steve-lunarg/buffer-unsampled-fix
HLSL: Buffer types should be unsampled.
2017-03-19 23:46:03 -06:00
John Kessenich
4960baaf66 HLSL: Basic turn on of non-static member functions.
Still need: pass by reference in SPIR-V and symbol-table level
for accessing 'this' members from member functions.
2017-03-19 18:09:59 -06:00
steve-lunarg
d3947d232a WIP: HLSL: propagate readonly qualifier for buffer types 2017-03-19 12:40:12 -06:00
steve-lunarg
cf2e7275e8 WIP: HLSL: Buffer types should be unsampled.
RWBuffer objects were generating (properly) unsampled resoures, while
Buffer objects were not.  This fixes that.
2017-03-17 13:19:42 -06:00
John Kessenich
e751bca75c Fix #777: don't parse .suffix if <stage> is provided.
Adding a test for this also uncovered an extraneous \r in the runtests script,
fixed now.
2017-03-16 11:30:20 -06:00
Rex Xu
5e317ffe40 SPV: Fix unexpected declarations of capability and extension 2017-03-16 23:02:39 +08:00
John Kessenich
36b218de91 HLSL: Fix #771: add inline keyword. 2017-03-15 09:05:14 -06:00
John Kessenich
71c100d7c0 GLSL output: Removed fixed-size buffer; fixes #769.
Makes some white-space differences in most output, plus a few cases
where more could have been put out but was cut short by the previous
fix-sized buffer.
2017-03-14 19:51:29 -06:00
John Kessenich
c08fb8ab9c Full stack: properly implement GL_EXT_device_group and GL_EXT_multiview. 2017-03-14 16:45:30 -06:00
John Kessenich
601b7fa4b9 Revert previous check-in, until knowing what the spec. is and whether the test failure is related. 2017-03-13 22:49:36 -06:00
John Kessenich
7a44a31dee SPV: Address #759: make ViewIndex and DeviceIndex by 'in', not 'uniform'. 2017-03-13 15:43:26 -06:00
Rex Xu
d41a696c30 HLSL: Additional channel value for textureGatherXXX().
When mapping HLSL gather intrinsics to GLSL textureGatherXXX() built-in
function, the channel selection value is only valid for non-shadow samplers.
2017-03-13 17:07:18 +08:00
John Kessenich
c04c6a4067 Merge pull request #762 from LukasBanana/master
Added 'GL_core_profile' and 'GL_compatibility_profile' to macro expansion
2017-03-11 14:16:58 -07:00
John Kessenich
54ee28f4d0 HLSL: Add scoping operator, accept static member functions, and support calling them. 2017-03-11 14:13:00 -07:00
Lukas Hermanns
1fbc6e6ca1 Added 'GL_core_profile' and 'GL_compatibility_profile' macro definition to preamble.
Added version check (version >= 150) for GL_(core/compatibility)_profile macros.

Added GL_core_profile standard macro check to "150.vert" test file.

Fixed version check for GL_core_profile macros, and removed bad token character from 150.vert test.

Updated 150.vert.out test base-result with google-test suite.
2017-03-11 12:34:46 +01:00
John Kessenich
523e20dc02 PP: Recognize the '::' token, and translate appropriately to GLSL/HLSL token. 2017-03-10 18:03:43 -07:00
steve-lunarg
0b5c2ae70e Preserve signedness in SPV image query ops
The AST->SPIRV translation of image queries was dropping signedness,
causing some validation troubles.
2017-03-10 12:51:59 -07:00
steve-lunarg
4198b8bfc4 WIP: HLSL: preserve empty structures after splitting 2017-03-09 19:10:57 -07:00
John Kessenich
6e1d50a7a2 HLSL: Accept SV_Cull/ClipDistanceN, by refactoring the way semantics are mapped. 2017-03-09 14:37:32 -07:00
steve-lunarg
d00b026111 Enable GatherCmpRed. Green/Blue/Alpha cannot be supported.
This implements GatherCmpRed in terms of OpImageDrefGather.

There appears to be no way to implement the Green/Blue/Apha forms: see #673.
2017-03-09 08:59:45 -07:00
steve-lunarg
3ce4536ac8 HLSL: use LOD form of ImageQuerySize when needed.
The non-LOD form of image size query is prohibited in certain cases:
see the OpImageQuerySize and OpImageQuerySizeLod sections of the SPIR-V
spec for details.  Sometimes we were generating the non-LOD form when
we should have been using the LOD form.  Sometimes the LOD form is required
even if the underlying HLSL query did not supply a MIP level itself,
in which case level 0 is now queried.
2017-03-07 19:30:25 -07:00
John Kessenich
057df2935a HLSL: Fix #754: recognize type casts in if-statements separately from declarations. 2017-03-06 18:18:37 -07:00
steve-lunarg
40efe5cee8 WIP: HLSL: Fix ordering defect if global SB decl after fn param
This change propagates the storage qualifier from the buffer object to its contained
array type so that isStructBufferType() realizes it is one.  That propagation was
happening before only for global variable declarations, so compilation defects would
result if the use of a function parameter happened before a global declaration.

This fixes that case, whether or not there ever is a global declaration, and
regardless of the relative order.

This changes the hlsl.structbuffer.fn.frag test to exercise the alternate order.

There are no differences to generated SPIR-V for the cases which successfully compiled before.
2017-03-06 12:08:41 -07:00
John Kessenich
33f85b6e59 SPV: Allow push constant buffers to not have an instance name. 2017-03-06 08:51:35 -07:00
John Kessenich
789086a820 HLSL: Test for issue #699. 2017-03-03 18:19:03 -07:00
John Kessenich
322cb1922e Merge pull request #750 from dgkoch/rename_KHX_to_EXT
Rename KHX_multiview/device_group to EXT_multiview/device to match the released specs
2017-03-03 17:23:53 -07:00
John Kessenich
27ffb29908 HLSL: Add 'class' keyword as (so far) synonym for 'struct'. 2017-03-03 17:01:01 -07:00
Daniel Koch
efc972799d Rename KHX to EXT to match the released specs
GL_KHX_multiview and GL_KHX_device_group don't exist,
they were released as GL_EXT_multiview and GL_EXT_device_group.
2017-03-03 18:40:48 -05:00
John Kessenich
854fe24786 HLSL: Fix #747: accept 'struct' in front of previously user-defined type name. 2017-03-02 14:30:59 -07:00
John Kessenich
0479437a5c SPV: Fix #739: OpSelect can only operate on scalars and vectors. 2017-03-01 13:49:11 -07:00
John Kessenich
3494d71cfa PP: Fix issue #738: don't assert on characters within a string. 2017-02-28 19:39:51 -07:00
John Kessenich
fb22b69fc6 PP: Partially address issue #738: handle premature end of argument when token pasting. 2017-02-28 18:06:39 -07:00
John Kessenich
45c1b5b980 Merge pull request #742 from steve-lunarg/f16tof32-typefix
HLSL: small fix for index type in f16tof32 opcode
2017-02-28 16:18:24 -07:00
steve-lunarg
fdbfb65ec7 HLSL: small fix for index type in f16tof32 opcode
The f16tof32 opcode was indexing a vector with a float 0, rather
than an int 0.  It may have made no functional difference due to the
identical bit pattern, but code looking at the type could be
confused.
2017-02-28 14:15:32 -07:00