Commit Graph

2034 Commits

Author SHA1 Message Date
John Kessenich
a01600b8aa Merge pull request #828 from SoapGentoo/fixes
Modernise CMake
2017-04-28 21:50:19 -06:00
David Seifert
8f824265ea Make test suite optional by using CTest 2017-04-28 22:46:52 +02:00
David Seifert
5a5699bdbd Modernise CMake
* Use `GNUInstallDirs` in order to respect GNU conventions.
  This is especially important for multi-arch/multi-lib setups.
* Specify position independent mode building properly, without
  using the historic hack of adding `-fPIC` as a definition.
  This makes the build system more portable.
* Only detect C++ (and not C) to slightly speed up configuring.
* Specify C++11 mode using modern CMake idioms.
* Fix some whitespace issues.
2017-04-28 22:46:52 +02:00
John Kessenich
acce8dce1b Merge pull request #868 from TiemoJung/two_pass_io_remap
Notification phase for io remapper
2017-04-28 09:15:51 -06:00
John Kessenich
bbae7de0d6 Merge pull request #867 from steve-lunarg/emptyinit
HLSL: Allow empty struct initializers
2017-04-28 09:09:51 -06:00
t.jung
f1bfeec73d Notification phase for io remapper
Adds a notification phase to the io remapper.
The idea behind this is to give the user a
chance to group uniforms and/or in/out variables
for a better pipeline layout sharing for vulkan.

Change-Id: I7492421085a4156ed3534f01d906ab390d73a623
2017-04-28 15:54:57 +02:00
steve-lunarg
c0043cda82 HLSL: Allow empty struct initializers
Review request: does this harm GLSL in any way?
2017-04-27 18:22:52 -06:00
John Kessenich
7cca140956 HLSL: Turn on hlsl-offsets by default for HLSL-source shaders. 2017-04-27 15:18:46 -06:00
John Kessenich
dd5dee0b1d Merge pull request #859 from steve-lunarg/sampleposition
HLSL: add standard sample position return form of GetSamplePosition m…
2017-04-27 01:36:52 -06:00
steve-lunarg
d4d0b29752 HLSL: add standard sample position return form of GetSamplePosition method
Multisample textures support a GetSamplePosition() method intended to query
positions given a sample index.  This cannot be truly implemented in SPIR-V,
but #753 requested returning standard positions for the 1..16 cases, which
this PR adds.  Anything besides that returns (0,0).  If the standard positions
are not used, this will be wrong.

This should be revisited when there is a real query available.
2017-04-26 08:31:56 -06:00
John Kessenich
88aabcca27 Merge pull request #855 from steve-lunarg/constantbuffer
HLSL: Add ConstantBuffer<T> syntax
2017-04-25 16:05:03 -06:00
steve-lunarg
a766b838f5 HLSL: Add ConstantBuffer<T> syntax
Note: multi-dimension arrays of ConstantBuffer objects will go through uniform flattening.
2017-04-25 09:30:28 -06:00
John Kessenich
a1cdd13b1c Merge pull request #851 from dgkoch/dgkoch_build_fixes3
Fix Android build errors
2017-04-22 09:54:34 -06:00
Daniel Koch
15bb43703c Fix Android build errors
glslang/MachineIndependent/iomapper.cpp:207:9: error: field 'resolver' will be initialized after field 'stage' [-Werror,-Wreorder]
      : resolver(r)
        ^
glslang/MachineIndependent/iomapper.cpp:263:9: error: field 'resolver' will be initialized after field 'stage' [-Werror,-Wreorder]
      : resolver(r)
        ^
hlsl/hlslParseHelper.cpp:70:5: error: field 'gsStreamOutput' will be initialized after field 'inputPatch' [-Werror,-Wreorder]
    gsStreamOutput(nullptr),
    ^
2017-04-21 16:16:43 -04:00
John Kessenich
8a5718a9e5 Merge pull request #849 from steve-lunarg/samplercmp-errmsg
HLSL: add error for expected comparison sampler in SampleCmp* ops
2017-04-21 11:27:24 -06:00
steve-lunarg
3cbc32f472 HLSL: add error for expected comparison sampler in SampleCmp* ops
This adds an error message if a non-comparison sampler is used with
comparison sampling methods.  There's no functional change for correct shaders.
2017-04-21 09:54:53 -06:00
John Kessenich
32a385e9d7 HLSL: Fix #846: support mixed ternary types.
Vector conditions properly convert the true/false expression types to same
width vector as the condition.

Scalar conditions make the true/false expressions convert to each other.
2017-04-20 21:32:16 -06:00
John Kessenich
0603a383c1 Merge pull request #847 from steve-lunarg/sb-param-fix
HLSL: fix for byte address buffers in fn parmeters
2017-04-20 20:36:06 -06:00
John Kessenich
1c04f1e51a Merge pull request #842 from steve-lunarg/sb-cast
HLSL: cast non-int types to uint on Load/Store indexes
2017-04-20 20:35:09 -06:00
John Kessenich
1487db54e1 Merge pull request #840 from steve-lunarg/iomap-hlsl
HLSL: hlsl register class iomapping
2017-04-20 20:34:12 -06:00
steve-lunarg
e404e088b1 HLSL: fix for byte address buffers in fn parmeters
Byte address buffers were failing to detect that they were byte address
buffers when used as fn parameters.

Note: this detection is a little awkward, and could be simplified if
it was easy to obtain the declared builtin type for an object.
2017-04-20 16:37:14 -06:00
steve-lunarg
7b1dcd6693 HLSL: add readonly qualifier to tbuffer, so they end up as SRV 2017-04-20 13:23:01 -06:00
steve-lunarg
be28355019 WIP: HLSL: hlsl register class iomapping
Adds --hlsl-iomap option to perform IO mapping in HLSL register space.

--shift-cbuffer-binding is now a synonym for --shift-ubo-binding.

The idea way to do this seems to be passing in a dedicated IO resolver, but
that would require more intrusive restructuring, so maybe best for its
own PR.

The TDefaultHlslIoResolver class and the former TDefaultIoResolver class
share quite a bit of mechanism in a common base class.

TODO: tbuffers are landing in the wrong register class, which needs some
investigation.  They're either wrong upstream, or the detection in the
resolver is wrong.
2017-04-20 12:41:39 -06:00
John Kessenich
ba5cc2fafa GLSL: Fix #822: Improve information given for syntax errors.
Also, fixed one test file that didn't have its syntax error as the last line.
2017-04-20 12:21:53 -06:00
John Kessenich
0c6f9360f5 HLSL: Fix #96: Support do-while loop substatements with no curly braces. 2017-04-20 11:08:24 -06:00
steve-lunarg
f8203a0acd HLSL: cast non-int types to uint on Load/Store indexes
Some texture and SB operations can take non-integer indexes, which should be
cast to integers before use if they are not already.  This adds makeIntegerIndex()
for the purpose.  Int types are left alone.

(This was done before for operator[], but needs to apply to some other things
too, hence its extraction into common function now)
2017-04-20 09:00:56 -06:00
John Kessenich
670271890d SPV: Support test #pragma for generating the StorageBuffer storage class.
Longer term, this storage class should be generated based on the mode
of compilation.
2017-04-19 18:34:49 -06:00
John Kessenich
a8d3db6b32 Merge pull request #835 from steve-lunarg/sb-counters
HLSL: structuredbuffer counter functionality
2017-04-19 17:42:22 -06:00
John Kessenich
d5d9ffbdfd HLSL: vector shape conversions for all ops: Fix #839. Fix #653. Fix #631. 2017-04-18 21:07:05 -06:00
John Kessenich
2aa12b1c05 HLSL: Address #839: avoid crash by distinguishing between bad argument and no argument. 2017-04-18 14:47:33 -06:00
steve-lunarg
350b94856a WIP: HLSL: add refection queries for structuredbuffer counter blocks
This adds TProgram::getUniformBlockCounterIndex(int index), which returns the
index the block of the counter buffer associated with the block of the passed in
index, if any, or -1 if none.
2017-04-18 12:58:15 -06:00
steve-lunarg
12bc9aa9ce WIP: HLSL: add Append/ConsumeBuffer support 2017-04-13 19:09:05 -06:00
steve-lunarg
8e26feb8f2 WIP: HLSL: structuredbuffer counter functionality
This is WIP, heavy on the IP part.  There's not yet enough to use in real workloads.

Currently present:

* Creation of separate counter buffers for structured buffer types needing them.
* IncrementCounter / DecrementCounter methods
* Postprocess to remove unused counter buffers from linkage
* Associated counter buffers are given @count suffix (invalid as a user identifier)

Not yet present:

* reflection queries to obtain bindings for counter buffers
* Append/Consume buffers
* Ability to use SB references passed as fn parameters
2017-04-13 18:43:26 -06:00
John Kessenich
d1141843c0 SPV Non-functional: fix ordering causing problems with another branch. 2017-04-13 17:08:11 -06:00
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