Commit Graph

2087 Commits

Author SHA1 Message Date
John Kessenich
136b1e2d5d Merge pull request #856 from TiemoJung/texture_upgrade
Pure Texture to Sampled Texture Transform
2017-05-29 11:40:43 -06:00
t.jung
baf570efa5 Pure Texture to Sampled Texture Transform
Adds a transformation step to the post processing step.
Two modes are available:
1) keep
- Keeps samplers, textures and sampled textures as is
2) transform pure texture into sampled texture and remove pure samplers
- removes all pure samplers
- transforms all pure textures into its sampled counter part

Change-Id: If54972e8052961db66c23f4b7e719d363cf6edbd
2017-05-29 18:29:45 +02:00
John Kessenich
d6af18f621 Merge pull request #901 from LoopDawg/imat-construct
HLSL: Add imat, umat, and bmat constructors
2017-05-24 23:12:58 -06:00
John Kessenich
7c9129bcb7 SPV: Fix #904: Correctly check for built-in block redeclations for location check. 2017-05-24 23:10:28 -06:00
John Kessenich
84cc15f0d0 HLSL: Fix #903: Don't short-circuit && or ||. 2017-05-24 16:47:32 -06:00
John Kessenich
6e2295d340 HLSL: Fix #902: Incorrect protection against zero arguments. 2017-05-24 16:02:56 -06:00
LoopDawg
174ccb8f1d HLSL: Add imat, umat, and bmat constructors
Fixes #894
2017-05-20 21:54:16 -06:00
John Kessenich
2c6f48b1f6 Fix #373: Implicitly make gl_FragColor a location=0 output. 2017-05-20 13:23:25 -06:00
John Kessenich
1d585ac8bd SPV: Correctly enforce 'location' presence on in/out blocks.
Blocks have this on members, not the object.
2017-05-20 12:15:41 -06:00
John Kessenich
557caf2401 Merge pull request #900 from LoopDawg/tx-overloads
HLSL: allow name mangling based on texture template type
2017-05-20 11:33:54 -06:00
John Kessenich
7b8c386c5d More non-determinism fixed. 2017-05-19 23:44:51 -06:00
John Kessenich
b6cabc4f24 Fix C++ portability, non-deterministic order of argument evaluation. 2017-05-19 23:29:50 -06:00
John Kessenich
80f92a190a Fix #857: Convert uniform int to local bool for struct alias assignment.
This was done for one direction, but not both directions, so this commit
picks up the other direction.
2017-05-19 23:00:13 -06:00
John Kessenich
0d2b4713c5 HLSL: Don't do logical short-circuits when the operands are bool-vectors.
This seems a bit ill-defined, and was generating code that made OpPhi of two
operands that were Boolean vectors result in a scalar bool.
2017-05-19 20:19:00 -06:00
LoopDawg
132a28aac4 HLSL: allow name mangling based on texture template type
Name mangling did not account for the vector size in the template type of a texture.
This adds that.  The mangle is as it ever was for the vec4 case, which leaves
all GLSL behavior and most HLSL behavior uneffected.  For vec1-3 the size is added
to the mangle.

Current limitation: textures cannot presently be templatized on structured types,
so this works only for vectors of basic types.

Fixes #895.
2017-05-19 20:12:50 -06: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