Commit Graph

2073 Commits

Author SHA1 Message Date
Lei Zhang
ddda9cb8ee Remove empty cpp files
This solves ranlib warnings on MacOS.
2017-05-19 17:29:16 -04:00
John Kessenich
ab0847ef01 Merge pull request #896 from KhronosGroup/spv-location
SPV: Give error on not assigning locations to I/O when generating SPIR-V.
2017-05-18 21:12:04 -06:00
John Kessenich
ff164d87f1 Merge pull request #897 from LoopDawg/remap-specconstop-fix.2
Remapper: handle embedded opcode in OpSpecConstantOp
2017-05-18 18:19:12 -06:00
LoopDawg
65c2eed65d Remapper: handle embedded opcode in OpSpecConstantOp
OpSpecConstantOp contains an embedded opcode which is given as a literal
argument to the OpSpecConstantOp.  The subsequent arguments are as the
embedded op would expect, which may be a mixture of IDs and literals.  This
adds support for that to the remapper binary parser.  Upon seeing such an
embedded op, the parser flips over to parsing the argument list as
appropriate for that opcode.

Fixes #882.
2017-05-18 16:13:04 -06:00
John Kessenich
71facdf435 SPV: Give error on not assigning locations to I/O.
Also, provides an option to auto-assign locations.
Existing tests use this option, to avoid the error message,
however, it is not fully implemented yet.
2017-05-18 15:07:05 -06:00
John Kessenich
24e895b4a3 Merge pull request #860 from steve-lunarg/sb-counter-args.2
HLSL: add ability to pass struct buffers with counters to fns
2017-05-17 10:55:22 -06:00
John Kessenich
09a29d9b1a Merge pull request #893 from KhronosGroup/member-call
HLSL: Implement member functions calling member functions.

Fixes #883.
2017-05-17 09:25:57 -06:00
steve-lunarg
2bb1f39fa7 WIP: HLSL: add ability to pass struct buffers with counters to fns
This modifies function parameter passing to pass the counter
buffer associated with a struct buffer to a function as a
hidden parameter.  Similarly function declarations will have
hidden parameters added to accept the associated counter buffers.

There is a limitation: if a SB type may or may not have an associated
counter, passing it as a function parameter will assume that it does, and
the counter will appear in the linkage whether or not there is a counter
method used on the object.
2017-05-17 09:18:53 -06:00
John Kessenich
0a2a0cd3a4 HLSL: Implement member functions calling member functions. 2017-05-17 02:20:34 -06:00
John Kessenich
b29cc30cdb Merge pull request #852 from steve-lunarg/declared-builtin
track declared builtin type
2017-05-16 10:38:32 -06:00
steve-lunarg
a4bfed129f WIP: track declared builtin type [proposal]
Marking as WIP since it might deserve discussion or at least explicit consideration.

During type sanitization, the TQualifier's TBuiltInVariable type is lost.  However,
sometimes it's needed downstream.  There were already two methods in use to track
it through to places it was needed: one in the TParameter, and one in a map in the
HlslParseContext used for structured buffers.

The latter was going to be insufficient when SB types with counters are passed to
user functions, and it's proving awkward to track the data to where it's needed.
This PR holds a proposal: track the original declared builtin type in the TType,
so it's trivially available where needed.

This lets the other two mechanisms be removed (and they are in this PR).  There's a
side benefit of not losing certain types of information before the reflection interface.

This PR is only that proposal, so it changes no test results.  If it's acceptable,
I'll use it for the last piece of SB counter functionality.
2017-05-15 15:44:00 -06:00
John Kessenich
1a010b8368 Merge pull request #890 from LoopDawg/mip-operator
HLSL: add .mips[][] operator for texture types
2017-05-15 09:39:15 -06:00
LoopDawg
726bf96a72 HLSL: add .mips[][] operator for texture types
This implements mytex.mips[mip][coord] for texture types.  There is
some error testing, but not comprehensive.  The constructs can be
nested, e.g in this case the inner .mips is parsed before the completion
of the outer [][] operator.

   tx.mips[tx.mips[a][b].x][c]
2017-05-15 09:13:58 -06:00
John Kessenich
c70bbc831c Merge pull request #889 from antiagainst/travis-android
Check Android build on Travis CI
2017-05-13 16:03:12 -06:00
Lei Zhang
b21213e893 Check Android build on Travis CI.
Also stop requiring sudo privilege so that we can use containers
for testing.
2017-05-13 17:48:19 -04:00
John Kessenich
ef7efb21ca Merge pull request #888 from LoopDawg/geometry-stage-mix
HLSL: allow GS-specific methods in non-GS stages
2017-05-13 12:54:08 -06:00
LoopDawg
c6510a33ff HLSL: allow GS-specific methods in other stages
Using GS methods such as Append() in non-GS stages should be ignored, but was
creating errors due to the lack of a stream output symbol for the non-GS stage.
2017-05-13 09:20:11 -06:00
John Kessenich
c49b4efa91 HLSL: Fix #884: Use promoted children, not pre-promoted, in completing binary nodes. 2017-05-12 15:25:41 -06:00
John Kessenich
c48c8e76e1 Merge pull request #886 from antiagainst/unordered-set
Use unordered_set in ReadableOrderTraverser.
2017-05-12 14:53:06 -06:00
Lei Zhang
2840f63fbc Use unordered_set in ReadableOrderTraverser.
Previously we are using unordered_map to map to bool, which can
be simplified with unordered_set.
2017-05-11 20:48:34 -04:00
John Kessenich
d9b08d5c3d Merge pull request #880 from aras-p/master
Fix for lumped/unity/batch builds
2017-05-10 11:11:44 -06:00
John Kessenich
02c4728a83 Merge pull request #874 from xlpiao/DescriptorSet-and-Binding
HLSL: Manually configure descriptor set and binding number for resources
2017-05-10 11:10:53 -06:00
Aras Pranckevicius
23d3c712bc [lumped builds] Add include guards (#pragma once) to header files that did not have any.
The codebase seems to use both “#pragma once“ approach, and “#ifndef / #define” approach,
so I picked pragma once as that one is less typing & less brittle.

When glslang is built with some other build system and lumped/unity builds are used,
without the include guards some headers would get included multiple times, leading to duplicate
declaration errors.
2017-05-10 16:58:38 +03:00
Aras Pranckevicius
8e204b2d67 [lumped builds] Only define _CRT_SECURE_NO_WARNINGS if it’s not defined yet.
When glslang is built with some other build system and lumped/unity builds are used,
without the checks this would get “macro is being redefined” warnings/errors.
2017-05-10 16:52:50 +03:00
Hyangran Park
36dc82908f HLSL: Manually configure descriptor set and binding number for resources 2017-05-10 16:50:18 +09:00
John Kessenich
12d693682f Build fix: Make string assignment simpler to avoid some compiler issues.
Included changing related parameters to const.
Should fix complaints with previous commit. See issue #879.
2017-05-09 23:30:56 -06:00
John Kessenich
1ee1c8e1ed Build: Fix portability in previous commit. 2017-05-08 00:47:48 -06:00
John Kessenich
c10191d132 SPV: Support texelFetch() on a textureBuffer (no sampler).
Fixes Vulkan Khronos-internal issue 770.
2017-05-08 00:12:28 -06:00
John Kessenich
a5c5fb6118 SPV: Emit extension for using StorageClassStorageBuffer. 2017-05-05 05:09:58 -06:00
John Kessenich
43c72b0e01 Merge pull request #878 from steve-lunarg/unroll-hint
HLSL: implement [unroll] and [loop] attributes
2017-05-04 23:06:02 +03:00
steve-lunarg
f1709e7146 HLSL: implement [unroll] and [loop] attributes
This adds infrastructure suitable for any front end to create SPIR-V loop
control flags.  The only current front end doing so is HLSL.

[unroll] turns into spv::LoopControlUnrollMask
[loop] turns into spv::LoopControlDontUnrollMask
no specification means spv::LoopControlMaskNone
2017-05-03 13:44:40 -06:00
John Kessenich
de1cc06c1d Merge pull request #877 from steve-lunarg/warn-fix1
Fix iomapper build warnings
2017-05-03 08:40:15 +03:00
steve-lunarg
0c20067c3a Fix iomapper build warnings 2017-05-02 18:59:55 -06:00
John Kessenich
7aaf419137 Merge pull request #873 from steve-lunarg/gathercmp
HLSL: Implement missing GatherCmp method
2017-05-02 22:38:14 +03:00
steve-lunarg
6817f81e02 HLSL: Implement missing GatherCmp 2017-05-01 21:59:34 -06:00
John Kessenich
22be5788ea Merge pull request #870 from SoapGentoo/cmake-fixes
Modernise CMake #2
2017-04-30 14:02:23 -06:00
David Seifert
22afc38b55 Modernise CMake #2
This reverts commit cfc69d95af.
* Change CMAKE_INSTALL_PREFIX default on Windows in order
  to prevent permission denied errors when trying to install
  to "Program Files".
2017-04-29 11:23:15 +02:00
John Kessenich
eb9a532b2a Merge pull request #869 from KhronosGroup/revert-828-fixes
Revert "Modernise CMake"
2017-04-28 22:13:35 -06:00
John Kessenich
cfc69d95af Revert "Modernise CMake" 2017-04-28 22:04:24 -06:00
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