Commit Graph

2000 Commits

Author SHA1 Message Date
John Kessenich
97366a0df0 HLSL: Fix #770: implicitly convert bool operands to numeric operators. 2017-04-12 22:38:24 -06:00
John Kessenich
a4c64c988c HLSL: Fix #834: Report #version is an illegal command. 2017-04-12 17:24:34 -06:00
John Kessenich
a0c578a6df HLSL: Fix #758: Support character literals (except for numeric escape sequences). 2017-04-12 16:58:30 -06:00
John Kessenich
2051815bcc HLSL: Fix #803: Add shape conversions to the constant-initializer path. 2017-04-12 14:56:52 -06:00
John Kessenich
a8b217fd8b Merge pull request #833 from KhronosGroup/hlsl-inf-syntax
HLSL: Fix #672: Support 1.#INF and -1.#INF syntax.
2017-04-12 14:20:31 -06:00
John Kessenich
776c515ea5 HLSL: Support 1.#INF and -1.#INF syntax. 2017-04-12 13:40:53 -06:00
John Kessenich
b5e739c20e HLSL: Fix boolean conversion bug and add more tests for ?:.
Null-conversion needs the right sized vectors to kick out with matching types.
2017-04-11 20:21:45 -06:00
John Kessenich
636b62db8b HLSL: Support vector 'cond ? :' -> EOpMix -> OpSelect. 2017-04-11 19:45:00 -06:00
John Kessenich
34718204e1 HLSL: Non-functional: add vector ? : tests. 2017-04-11 17:31:28 -06:00
John Kessenich
13075c612c HLSL: Fix #832: don't require terminating semicolon for cbuffer/tbuffer. 2017-04-11 09:51:32 -06:00
John Kessenich
e9f18fd92c Merge pull request #831 from steve-lunarg/isfinite
HLSL: fix return type for isfinite
2017-04-10 11:59:52 -06:00
steve-lunarg
9e5a19fd3a HLSL: fix return type for isfinite
The prior decomposition of isfinite was not setting the return type on the
sequence node.  (Sequence was used because there's an internal temporary
to avoid the complex rvalue problem).
2017-04-10 08:27:34 -06:00
John Kessenich
ae79697db1 Merge pull request #827 from amdrexu/feature4
Implement the extension SPV_KHR_16bit_storage
2017-04-08 10:03:45 -06:00
John Kessenich
a09eefd8aa Non-functional: Fix typos in comments. 2017-04-07 15:40:30 -06:00
John Kessenich
6fa17641b5 HLSL: Emit the OpSource HLSL instruction for HLSL, using new headers. 2017-04-07 15:40:01 -06:00
John Kessenich
7962bda334 Merge pull request #825 from steve-lunarg/index-cast
HLSL: cast bracket dereference index to int type if not.
2017-04-07 10:16:54 -06:00
Rex Xu
f89ad98013 Implement the extension SPV_KHR_16bit_storage 2017-04-07 23:22:33 +08:00
steve-lunarg
2efd6c6d0c HLSL: cast bracket dereference index to int type if not.
HLSL can index arrays using operator[] with non-integer types, and
inserts a conversion to a uint if needed.
2017-04-06 20:27:10 -06:00
John Kessenich
38a425355b SPV: Move to latest public headers. 2017-04-06 17:21:58 -06:00
John Kessenich
07b30c4255 Merge pull request #823 from steve-lunarg/tess-coord-size
HLSL: allow non-vec3 tessellation coordinate declarations
2017-04-05 18:11:31 -06:00
John Kessenich
4f1403ed1b SPV: Fix #807: use --hlsl-offsets to allow hlsl-style offsets in a buffer.
Corresponds to the EShMsgHlslOffsets flag in messages.
Works for both GLSL and HLSL.
2017-04-05 17:38:20 -06:00
steve-lunarg
ccb076ac9b HLSL: allow non-vec3 tessellation coordinate declarations
HLSL requires vec2 tessellation coordinate declarations in some cases
(e.g, isoline topology), where SPIR-V requires the TessCoord qualified
builtin to be a vec3 in all cases.  This alters the IO form of the
variable to be a vec3, which will be copied to the shader's declared
type if needed.  This is not a validation; the shader type must be correct.
2017-04-05 11:03:02 -06:00
John Kessenich
6f1e595dbc Merge branch 'jantlo-cpp11-feat' 2017-04-04 15:37:45 -06:00
John Kessenich
d92b567935 Merge branch 'cpp11-feat' of https://github.com/jantlo/glslang into jantlo-cpp11-feat 2017-04-04 15:37:18 -06:00
Juan Lopez
a558b26537 This refactor the StandAlone and WorkList files in order to use more
C++11 features remove the dependencies from OS specific code. Changes:

- Making WorkList class to have its own mutex instead of the OS specific
global one. The new mutex is the one from std library. The OS specific
code is also removed.

- Using the C++11 std library to handle threads in StandAlone
application
and enabling concurrent processing on non-windows platforms.

- converting the global variable Worklist into local variable workList.
2017-04-04 22:29:59 +02:00
John Kessenich
97cb85c7d6 PP: Fix #783: Catch end-of-argument expansion in token pasting. 2017-04-04 12:28:20 -06:00
John Kessenich
82460b5e21 HLSL: Fix #805: Support cast of scalars to structures.
Somewhat complex due to recognizing a general scalar, but not
replicating it for each member to avoid side effects.
2017-04-04 11:49:33 -06:00
John Kessenich
5ce1e4aff8 Merge pull request #817 from steve-lunarg/isfinite
HLSL: Decompose OpIsFinite to avoid capability restrictions
2017-04-03 22:32:35 -06:00
John Kessenich
c633f644da HLSL: Non-functional: rationalize making constructors.
Improves foundation for adding scalar casts.

Makes handle/make names more sane, better commented, uses more
precise subclass typing, and removes mutual recursion between
converting initializer lists and making constructors.
2017-04-03 22:17:57 -06:00
John Kessenich
8df9a48698 Merge pull request #812 from steve-lunarg/PatchIO
HLSL: Support InputPatch variables in patch constant functions
2017-04-03 22:02:30 -06:00
steve-lunarg
13975525d7 Decompose OpIsFinite to avoid capability restrictions
OpIsFinite is not available everywhere: decompose isfinite
to !isinf && !isnan.
2017-04-03 20:05:21 -06:00
steve-lunarg
067eb9b48a WIP: HLSL: Support InputPatch variables in patch constant functions
Previously, patch constant functions only accepted OutputPatch.  This
adds InputPatch support, via a pseudo-builtin variable type, so that
the patch can be tracked clear through from the qualifier.
2017-04-03 19:39:44 -06:00
John Kessenich
b68b9a8b23 Merge pull request #808 from steve-lunarg/gs-ep-wrap-fix
HLSL: fix GS to work with EP wrapping
2017-04-03 16:58:14 -06:00
steve-lunarg
08e0c086c8 HLSL: fix GS implementation for EP wrapping
The prior implementation of GS did not work with the new EP wrapping architecture.
This fixes it: the Append() method now looks up the actual output rather
than the internal sanitized temporary type, and writes to that.
2017-04-03 14:50:39 -06:00
John Kessenich
2184c2f21a Fix #287: pin down the io-array size before checking for out of range index. 2017-04-03 14:29:20 -06:00
John Kessenich
6f03bfc733 Merge pull request #815 from steve-lunarg/tess-ds-pcf-order
HLSL: handle PCF input to DS in arbitrary argument position
2017-04-03 13:20:08 -06:00
steve-lunarg
f38cca3ccf HLSL: handle PCF input to DS in arbitrary argument position
In the hull shader, the PCF output does not participate in an argument list,
so has no defined ordering.  It is always put at the end of the linkage.  That
means the DS input reading PCF data must be be at the end of the DS linkage
as well, no matter where it may appear in the argument list.  This change
makes sure that happens.

The detection is by looking for arguments that contain tessellation factor
builtins, even as a struct member.  The whole struct is taken as the PCF output
if any members are so qualified.
2017-04-03 10:14:50 -06:00
John Kessenich
fa84001ad7 Merge pull request #814 from steve-lunarg/contains
Refactor TType::contains* methods (nonfunctional)
2017-04-03 10:07:47 -06:00
steve-lunarg
27309f6848 Refactor TType::contains* methods (nonfunctional)
There were many (~8) different places in TType which all knew how to traverse
the struct/type hierarchy.  There's a need to add another, but I didn't
want to duplicate the traversal code again.  This is a small refactoring
which passes a predicate to a single traverse-and-test method.  That also
shortens all the containsSomething() methods from 9 lines of body to 1.

There are no test differences: it's nonfunctional.
2017-04-02 17:38:18 -06:00
John Kessenich
c7fd73b784 Merge pull request #811 from steve-lunarg/combine-test
HLSL: set combined flag false for Buffer<>
2017-04-01 11:07:31 -06:00
steve-lunarg
bf1537f4b4 WIP: HLSL: force uncombined flag off for Buffer<> 2017-03-31 17:40:09 -06:00
John Kessenich
f36542f46d Revert "Merge pull request #779 from steve-lunarg/buffer-unsampled-fix"
This reverts commit 1dd65ca398, reversing
changes made to 4960baaf66.
2017-03-31 14:39:30 -06:00
John Kessenich
84a30c8bae Merge pull request #774 from steve-lunarg/tess-ctrlpt-pcf
HLSL: support per control point patch const fn invocation
2017-03-31 13:37:52 -06:00
John Kessenich
e70fcf2de1 Merge pull request #810 from steve-lunarg/clip-crash-fix
HLSL: Fix #804: crash on empty sequence node passed to intrinsic expansions
2017-03-31 13:34:55 -06:00
steve-lunarg
db2e3b4169 HLSL: fix crash on empty sequence node passed to intrinsic expansions 2017-03-31 12:47:34 -06:00
steve-lunarg
e741249b72 HLSL: pass tessellation execution modes through to SPIR-V
The SPIR-V generator had assumed tessellation modes such as
primitive type and vertex order would only appear in tess eval
(domain) shaders.  SPIR-V allows either, and HLSL allows and
possibly requires them to be in the hull shader.

This change:

1. Passes them through for either tessellation stage, and,

2. Does not set up defaults in the domain stage for HLSl compilation,
to avoid conflicting definitions.
2017-03-31 11:47:18 -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