Commit Graph

717 Commits

Author SHA1 Message Date
Matthew Albrecht
1199cf92f7 Fixed install for SPIRV, glslang, and hlsl when building shared libs 2018-04-26 14:07:46 -05:00
Rex Xu
7c88aff1a9 Specify SPV_AMD_gpu_shader_int16 extension string when frexp() takes 16-bit
exp operand
2018-04-14 21:40:49 +08:00
John Kessenich
b9e9e57f12
Merge pull request #1326 from mattparks/patch1
Allowed for LIB_TYPE to be set to switch between static and shared libs for glslang, SPIRV, and HLSL
2018-04-11 18:14:46 -06:00
St0fF
a1184ddd48 fix further MSVC 2012 build issues
MSVC 2012 does not allow initializer lists - replaced with corrresponding CTor calls.
2018-04-09 21:08:14 +02:00
John Kessenich
f52b63812a Fix #1331: Emit SPV_GOOGLE_hlsl_functionality1 for counters.
It was missing when there were no semantics.
2018-04-05 19:35:38 -06:00
John Kessenich
5611c6d27b GLSL/SPV: Implement SPV_EXT_descriptor_indexing and GL_EXT_nonuniform_qualifier 2018-04-05 11:25:02 -06:00
Matthew Albrecht
6c5f649ae8 Allowed for LIB_TYPE to be set to switch between static and shared libs for glslang, SPIRV, and HLSL 2018-03-30 09:32:03 -05:00
John Kessenich
10971553b8 Non-Functional: Remove unused parts of the disassembler. 2018-03-30 00:11:39 -06:00
Jeff Bolz
2abe9a4d34 Implement GL_NV_shader_subgroup_partitioned 2018-03-29 22:52:17 -05:00
GregF
fb03a55e0f Only print legalization warning if optimizer disabled 2018-03-29 13:17:54 -06:00
John Kessenich
7be36647fc
Merge pull request #1319 from KhronosGroup/array-rationalization
Array rationalization
2018-03-28 23:26:27 -06:00
John Kessenich
ead8622484 Non-functional. Rationalizations enabling future generalizations:
- Use much simpler method to update implicit array sizes.
  The previous overly complicated method was error prone.
- Rationalize all use of unsized arrays.
- Combine decorations when generating SPIR-V, to simplify
  adding extensions.
2018-03-28 18:01:20 -06:00
GregF
4bede9eb00 Disable DCE by Remapper through glslangValidator...
...now that spirv-opt is capable enough.
2018-03-27 10:15:51 -06:00
John Kessenich
643e57cddf
Merge pull request #1313 from greg-lunarg/kg15
Update SPIRV-Tools known good.
2018-03-27 00:46:18 -06:00
greg-lunarg
0b46c1edbf
Merge branch 'master' into kg15 2018-03-26 12:20:43 -06:00
GregF
eecb874c35 Update SPIRV-Tools known good.
Also update spirv-opt recipes.
2018-03-26 12:11:55 -06:00
John Kessenich
859b0342b8 Types: Fix #1290: Rationalize and correct "mixed" style array dimensioning.
There a couple functional problems, which when reduced down also led to
some good simplifications and rationalization.  So, this commit:
 - corrects "mixed" functionality: int[A] f[B] -> f[B][A]
 - correct multi-identifier decls: int[A] f[B], g[C] -> f and g are independently sized.
 - increases symmetry between different places in the code that do this
 - makes fewer ways to do the same thing; several methods are just gone now
 - makes more clear when something is copied or shared
2018-03-26 00:38:53 -06:00
John Kessenich
97e35420a6 Non-functional: always return value from makeFpConstant().
Should fix #1308.
2018-03-22 23:44:11 -06:00
John Kessenich
5d610ee1dc Implement SPV_GOOGLE_hlsl_functionality1.
Enabled via -fhlsl_functionality1
2018-03-16 20:21:44 -06:00
John Kessenich
cb32c54466
Merge pull request #1289 from Igalia/igalia/dmat-scalar-division
Use the correct type for the constant for matrix/scalar division
2018-03-15 23:49:59 -06:00
Daniel Koch
bfe0952118 Fix build several build errors
glslang/SPIRV/SpvBuilder.cpp:2533:27: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
        for (int c = 0; c < accessChain.swizzle.size(); ++c)
                        ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

glslang/hlsl/hlslParseHelper.cpp:69:5: error: field 'cullDistanceInput' will be initialized after field 'clipDistanceOutput' [-Werror,-Wreorder]
    cullDistanceInput(nullptr),
    ^
1 error generated.

glslang/glslang/MachineIndependent/attribute.cpp:85:16: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
    if (argNum >= args->getSequence().size())
        ~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
2018-03-13 17:06:51 -04:00
Neil Roberts
eddb1318ae Use the correct type for the constant for matrix/scalar division
When a matrix is divided by a scalar it tries to take the reciprocal
of the scalar to convert the operation into a multiply. However it was
always doing this by making a 32-bit constant. If the scalar is a
double then this would end up making an FDiv instruction with
different types in the operands.

This patch adds a helper method called makeFpConstant which makes a
floating-point constant of the given type. The code to take the
reciprocal now uses it to make the same type as the result.

Fixes https://github.com/KhronosGroup/glslang/issues/1278
2018-03-13 13:50:56 +01:00
John Kessenich
a51525059f
Merge pull request #1269 from bkaradzic/master
Fixed GCC+Clang errors and warnings on Linux and OSX.
2018-03-07 14:31:57 -07:00
John Kessenich
ac3707921e Revert the commits that change OpArrayLength type and bumped the version number.
Now, version 5.* is all connected to making the uint type, which doesn't quite work.
Generator versions 4 and 6 do not do this.
2018-03-07 11:48:25 -07:00
John Kessenich
66011cb2c2 SPV: Implement Vulkan 1.1 features and extensions. 2018-03-06 16:12:04 -07:00
John Kessenich
c6c80a6e48 Versioning: Address #1255: Move to semantic versioning.
Still missing is automation and final decisions on mechanisms in general.
2018-03-05 22:23:17 -07:00
Branimir Karadžić
1de8e54d66 Fixed GCC+Clang errors and warnings on Linux and OSX. 2018-03-03 13:04:12 -08:00
Rex Xu
e518772dc9 SPV: The result type of OpArrayLength should be UINT 2018-03-03 22:06:27 +08:00
John Kessenich
e58d58b782 Non-functional: Move to latest headers. 2018-03-02 12:36:02 -07:00
John Kessenich
29c49e1089
Merge pull request #1266 from amdrexu/feature
Implement the extension GL_AMD_gpu_shader_half_float_fetch
2018-03-02 11:23:15 -07:00
Rex Xu
81f4c03a76 Fix issues of SPIRV headers 2018-03-02 17:42:37 +08:00
Rex Xu
1e5d7b0b27 Implement the extension GL_AMD_gpu_shader_half_float_fetch
- Support new opaque types: f16sampler*, f16image*, f16subpassInput*.
- Add new built-in GLSL texture/image functions.
2018-03-02 16:48:03 +08:00
John Kessenich
5630d0ec79 Fix typo. 2018-03-02 01:09:28 -07:00
John Kessenich
c5215791f5 IO mapper: Fix #1261: Supply location mapper with size computer.
This factored computeTypeLocationSize() out of needing the TIntermediate contents,
and uses it to show how to know how many locations an object needs.
However, it still does not do cross stage, or mixed location/no-location
analysis.
2018-02-27 13:31:48 -07:00
John Kessenich
46413d5780 SPV: Fix #1258: cache constant structs by id, not opcode.
Constants were generally cached by type opcode, but all structures share the
same type opcode (OpTypeStruct), so they need to be cached by type id.
2018-02-26 19:35:39 -07:00
John Kessenich
57f6a016f0 SPV: Complete OpModuleProcessed implementation, enabled by have 1.2 headers. 2018-02-22 19:36:18 -07:00
John Kessenich
4bee531fc1 HLSL: Fix #1249: Always execute both sides of ternary "?:".
This is semantically required by HLSL, and frequently results in using
OpSelect instead of control flow.
2018-02-20 21:32:33 -07:00
LoopDawg
4425f245a5 HLSL: Add conversions for image ops during SPV construction
HLSL allows image and texture types to be templatized on sub-vec4 types,
or even structures.  This was mostly handled already during creation of
sampling operations.  However, for operator[] which can generate image
loads, this wasn't happening.

It also isn't very easy to do at that point in time, because operator[]
does not know where the results it produces will end up.  They may be
an lvalue or an rvalue, and there's a post-process to convert loads to
stores.  They may end up in atomic ops.

To bypass that difficulty, GlslangToSpv now looks for this case and
adds the appropriate conversion.  LIMITATION: this only works for
cases for which a simple conversion opcode suffices.  That is to say,
it will not work if the type is templatized on a struct.
2018-02-18 13:13:36 -07:00
GregF
8a4848f5b2 Add DeadInsertElim to legalization and RedundancyElim to -Os. 2018-02-07 16:04:42 -07:00
John Kessenich
71b5da60d0 SPV: Bump up generator number, because previous commit changes code gen slightly. 2018-02-06 08:06:36 -07:00
John Kessenich
5c3eed542d SPV: Create more access chains addressing a few swizzling issues.
- Fixes #1233
- Treats local bools like anything else
- more consistently deals with a dynamic component selection
2018-02-06 07:24:12 -07:00
John Kessenich
a2858d9bdd GLSL: Implement GL_EXT_control_flow_attributes.
See https://github.com/KhronosGroup/GLSL/pull/11.
2018-02-01 00:55:08 -07:00
John Kessenich
e18fd20d5c HLSL: Refactor attribute implementation.
- make it sharable with GLSL
- correct the case insensitivity
- remove the map; queries are not needed, all entries need processing
- make it easier to build bottom up (will help GLSL parsing)
- support semantic checking and reporting
- allow front-end dependent semantics and attribute name mapping
2018-02-01 00:30:34 -07:00
John Kessenich
2b5ea9f851 SPV Version: Emit the requested SPIR-V version, not the header version.
Fixes #1236.
2018-01-31 18:41:59 -07:00
John Kessenich
43f5b27321 Non-Functional: Use OpModuleProcessed from the unified header. 2018-01-31 18:06:44 -07:00
John Kessenich
6c1c2766b6 SPV: Bump SPIR-V header to the unified1 version (version 1.2). 2018-01-29 16:16:11 -07:00
Frank Henigman
541f7bbd50 Fix unused function warning.
TGlslangToSpvTraverser::getExtBuiltins is only used when AMD_EXTENSIONS
is defined, so only define it in that case to avoid an unused function
warning.
2018-01-16 00:18:26 -05:00
GregF
e0639287df HLSL Legalization: Add scalar replacement
This allow for propagation through structs with dynamically indexed
arrays. This supports recent removal of non-io struct flattening.
2017-12-21 11:30:13 -07:00
John Kessenich
3f0d4bcd6a SPV: Document history of the generator version number. 2017-12-16 23:46:37 -07:00
John Kessenich
2505057af8 SPV: Memory model: Reduce set of memory-semantic bits requested for "all". 2017-12-16 00:34:08 -07:00
John Kessenich
838d7afc61 SPV: HLSL: Move to correct HLSL barrier semantics, per Khronos recommendation. 2017-12-16 00:34:08 -07:00
John Kessenich
c72e5937dd SPV: Bump the generator number to account for barrier changes. 2017-12-16 00:34:08 -07:00
John Kessenich
8297936dd6 SPV: Change barrier emission to conform to Khronos decisions.
The memory model group agreed to these definitions for how
to map GLSL barrier, memoryBarrier, etc. With HLSL following suit.
2017-12-16 00:30:10 -07:00
John Kessenich
edaf556778 SPV: Plumb through XFB buffer and stride information.
Also, only emit this XFB information where the SPIR-V spec says
it should be emitted: essentially, on objects.

This and the previous commit together fix #1185.
2017-12-15 06:25:14 -07:00
Piers Daniell
1c5443c693 Add implementation of SPV_EXT_fragment_fully_covered
This implementation uses the GLSL extension
GL_NV_conservative_raster_underestimation to generate the new SPIR-V
FullyCoveredEXT built in.
2017-12-14 07:42:23 -07:00
John Kessenich
e9e0cb60ec Update to latest public headers. 2017-12-14 03:00:44 -07:00
John Kessenich
6a14f78061 HLSL: Fix #1163: treat buffers as references when calling functions.
This continues to prevent writing output buffers (out from a function),
but fixes the problem where the copy-in/out was not getting done.

Making everything work will require knowing both in/out-ness and bufferness,
but these are currently mutually exclusive, because both are storage
qualifiers.
2017-12-04 02:48:10 -07:00
John Kessenich
cbdf871d7f SPV: SampleMask does not depend on SampleRateShading.
Fixes #1158.
Fixes #1159.
2017-11-20 16:32:49 -07:00
John Kessenich
a372a3ed1e Versioning: Update some version strings. Still need better overall version. 2017-11-02 22:34:43 -06:00
GregF
e86b4c84d6 Remapper: Fix strip algo when strip ranges overlap 2017-11-02 14:01:57 -06:00
GregF
cc80d80d8d Update spirv-tools known-good 2017-10-23 16:48:42 -06:00
John Kessenich
7a9db71f46 SPV: Don't emit StorageImageMultisample capability for subpass images. 2017-10-20 10:56:50 -06:00
John Kessenich
fe4e572c53 GLSL->SPIR-V: Put precision decorations on imageLoad(). 2017-10-19 02:07:30 -06:00
John Kessenich
07ed11f9a0 SPV: GeneratorVersion: bump version number because of atomic decrement change. 2017-10-07 11:41:20 -06:00
John Kessenich
48d6e798bc SPV: Correct semantics of atomic-counter decrement.
The semantics differ between GLSL/HLSL and SPIR-V.
Translate between these.
2017-10-06 21:21:48 -06:00
John Kessenich
d41993d9d2 SPV: rationalize parameter handling for "original" and "writable" parameters. 2017-09-29 09:58:11 -06:00
John Kessenich
bed4e4f7e4 HLSL: Pass opaques by local copy, instead of by interface original.
Also, remove assumption that if something is opaque that it
must be in the UniformConstant storage class.

This allows function declarations to know all parameters will
be in the Function storage class.
2017-09-29 09:57:00 -06:00
GregF
cd1f169c6a Enable HLSL legalization
Also added known-good mechanism to fetch latest validated spirv-tools.
Also added -Od and -Os to disable optimizer and optimize for size.

Fetching spirv-tools is optional for both glsl and hlsl. Legalization
of hlsl is done by default if spirv-opt is present at cmake time.
Optimization for glsl is currently done through the option -Os.

Legalization testing is currently only done on four existing shaders.
A separate baseLegalResults directory holds those results. All previous
testing is done with the optimizer disabled.
2017-09-27 15:06:05 -06:00
Rex Xu
e8fe8b0de9 Implement extension GL_NV_shader_atomic_int64 2017-09-27 12:06:27 +08:00
John Kessenich
9cf5dfbdc7 Merge pull request #1063 from LoopDawg/remapper-error-cleanup
Remapper: make remapper robust against non-exiting error handlers
2017-09-23 06:32:02 -06:00
GregF
fd34f0e602 CMake changes for HLSL legalization
Cmake now looks for External/spirv-tools. If found, it links in
SPIRV-Tools-opt and SPVRemapper, and adds -DENABLE_OPT to build.
2017-09-21 17:01:47 -06:00
LoopDawg
8004d36528 Remapper: make remapper robust against non-exiting error handlers
Remapper errors are generally fatal: there has been some unexpected situation while
parsing the SPV binary, and there is no reasonable way to carry on.  The
errorHandler() function is called in this case, which by default exits, but
it is possible to submit a handler which does not.  In that case the remapper would
carry on in a bad state.

This change ensures a graceful termination of the remap() function.

While a try {} catch {} construct would be the ideal and safe way to do this,
that's off limits for certain environments, so this tries to do the same thing
with explicit code, to catch all the bailout paths.
2017-09-20 15:19:43 -06:00
John Kessenich
5f77d864f3 HLSL: Fix #1064: Don't include empty structures on OpEntryPoint 2017-09-19 11:23:58 -06:00
LoopDawg
a5d8616478 HLSL: allow mixed user & builtin members in hull shader output structure
Hull shaders have an implicitly arrayed output.  This is handled by creating an arrayed form of the
provided output type, and writing to the element of it indexed by InvocationID.

The implicit indirection into that array was causing some troubles when copying to a split
structure.  handleAssign was able to handle simple symbol lvalues, but not an lvalue composed
of an indirection into an array.
2017-09-14 16:50:37 -06:00
John Kessenich
ba6a3c290e GLSL: Make gl_Layer and gl_ViewportIndex always be outside blocks.
There was some ambiguity/contradiction in this behavior, and
Khronos decided glslang should always have these outside blocks,
rather than have stage/vendor/target variations.
2017-09-13 13:22:50 -06:00
John Kessenich
4f4683d251 Merge pull request #1050 from amdrexu/feature
Implement the extension GL_AMD_shader_fragment_mask
2017-09-12 09:09:37 -06:00
John Kessenich
ea1ea974eb Address #1052: Have language-level exits of case statements. 2017-09-11 19:25:17 -06:00
amhagan
05506bb874 Implement the extension GL_AMD_shader_fragment_mask 2017-09-09 22:05:24 +08:00
LoopDawg
76117921b9 Fix lvalue check in SPIR-V generation
There were several locations in TGlslangToSpvTraverser::handleUserFunctionCall testing for
whether a fn argument should be in the lvalue or rvalue array.  They must get the same
result for indexing sanity, but had slightly different logic.

They're now forced into the same test.
2017-09-06 15:04:52 -06:00
LoopDawg
2baa774259 Linux build warning fix
* Remove complaint about unused function parameter in resolveUniformLocation()
* Remove complaint about defined but not used variable in spvIR.h
2017-08-31 18:09:58 -06:00
John Kessenich
8268a35504 Build: Attempt better support for VS 2012.
Fix #1020. Fix #1021. Fix #1022.
2017-08-25 21:35:37 -06:00
John Kessenich
74c5f711b4 Merge pull request #1014 from KhronosGroup/SPV_EXT_shader_viewport_index_layer
SPV: 1st pass implementation of SPV_EXT_shader_viewport_index_layer.
2017-08-25 13:33:16 -06:00
John Kessenich
35343cb84d Merge pull request #1034 from KhronosGroup/module-processes
SPV reflection: Add OpModuleProcessed for compile options.
2017-08-25 13:05:54 -06:00
John Kessenich
b41bff69d2 SPV: 1st pass implementation of SPV_EXT_shader_viewport_index_layer. 2017-08-25 13:04:39 -06:00
John Kessenich
2a27116cae SPV reflection: Add OpModuleProcessed for compile options. 2017-08-25 11:48:02 -06:00
John Kessenich
fc3436941e Merge pull request #1029 from amdrexu/feature2
Implement extension GL_AMD_shader_image_load_store_lod
2017-08-23 23:13:19 -06:00
Rex Xu
129799a709 Implement extension GL_AMD_shader_image_load_store_lod 2017-08-24 06:56:39 +08:00
Rex Xu
e8fdd79f2e SPV: Implement extension SPV_EXT_shader_stencil_export 2017-08-24 06:26:15 +08:00
John Kessenich
786e8795ee Build: Fix build when NV_EXTENSIONS is not enabled. 2017-08-19 15:54:49 -06:00
John Kessenich
d6be6da031 SPV: Fix #1016: Don't allow non-GLSL-extension protected Layer and ViewportIndex members. 2017-08-17 23:49:39 -06:00
John Kessenich
260f50616a SPV: Correct selection of storage-image capabilities. Fixes #986.
Code was reflecting an old historical use of sampled as a SPIR-V
2-valued operand, instead of its current 3 values.
2017-08-14 22:10:00 -06:00
John Kessenich
0d0c6d38f0 GLSL 4.6: Implement atomic counter ops and SPV_KHR_shader_atomic_counter_ops. 2017-07-31 03:00:04 -06:00
Rex Xu
286ca432cf SPV: Memory qualifiers should decorate top-level block members 2017-07-27 14:33:16 +08:00
John Kessenich
d2d3a14237 SPV: Update to latest 1.0 headers, removing redundancies in GLSL.ext.AMD.h. 2017-07-25 21:03:29 -06:00
LoopDawg
ef94b1a5ca Fix dref explicit LOD form of sample with cube texture arrays
The dref parameter was being used as the LOD.  Now it it's properly the dref.
2017-07-24 18:45:37 -06:00
John Kessenich
961cd35b73 SPV: Fix #995: Include memory decorations on parameters. 2017-07-18 03:07:43 -06:00
John Kessenich
fad6297206 SPV: Non-functional: support lists of decorations per parameter. 2017-07-18 02:46:59 -06:00
John Kessenich
735d7e56a6 Address part A of #982: $Global will use std140 instead of HLSL offsets.
From comment about this:
Adjust alignment for HLSL rules
TODO: make this consistent in early phases of code: adjusting this late means inconsistencies with earlier code, which for reflection is an issue.
Until reflection is brought in sync with these adjustments, don't apply to $Global,
which is the most likely to rely on reflection, and least likely to rely
implicit layouts.
2017-07-13 11:39:16 -06:00
Rex Xu
57e65929e4 HLSL: Translate directive [flatten] and [branch] to SPV control mask. 2017-07-06 11:31:33 +08:00
John Kessenich
9645f78293 Merge pull request #965 from chaoc/spv-khr-post-depth-coverage
Implement SPV_KHR_post_depth_coverage
2017-07-05 14:48:19 -06:00
chaoc
c120452754 Implement SPV_KHR_post_depth_coverage
Added support for both extension GL_ARB_post_depth_coverage and GL_EXT_post_depth_coverage.
2017-07-05 12:27:15 -07:00
John Kessenich
17b5f9175d Merge pull request #969 from d3x0r/patch-1
Add option to skip installation
2017-07-04 11:00:42 -06:00
Rohith Chandran
6206091e63 Fix CMake scripts: The set_property script can be used to set only a single property, so now setting the POSITION_INDEPENDENT_CODE property correctly. 2017-07-04 10:53:45 -04:00
d3x0r
4e53d9052d Update CMakeLists.txt 2017-07-04 06:00:35 -07:00
Rex Xu
37cdceed41 Implement extension GL_ARB_shader_stencil_export 2017-06-29 17:50:46 +08:00
John Kessenich
e2ff404f6b Merge pull request #917 from KhronosGroup/remove-redundant-locations
Replace #422: Remove the redundant location setting in AST->SPIR-V.
2017-06-15 12:11:37 -06:00
Rex Xu
301a2bc8a7 SPV: Fix an typo of SPV_AMD_texture_gather_bias_lod 2017-06-14 23:09:39 +08:00
Rex Xu
cabbb788b4 Implement extension GL_AMD_gpu_shader_int16
- Add int16 types (int16_t, uint16_t, i16vec, u16vec).
- Add int16 support to GLSL operators.
- Add int16 type conversions (to int16, from int16).
- Add int16 built-in functions.
2017-06-09 17:11:23 +08:00
Rex Xu
225e0fcadd Implement the extension GL_AMD_texture_gather_bias_lod 2017-06-05 16:41:06 +08:00
John Kessenich
7cdf3fc3c6 Replace #422: Remove the redundant location setting in AST->SPIR-V.
This was redundant in two ways:
1) it replicated algorithms owned in the front end, and
2) it sometimes left location information on both a block and its members.
2017-06-04 13:22:39 -06:00
John Kessenich
e485c7af58 SPV: Debug output: Include OpLine information for execution path.
Note that declaratives are not handled, only procedurals.
2017-05-31 18:50:53 -06:00
John Kessenich
121853f4df SPV: Add OpSource shader source code and file name. 2017-05-31 17:14:15 -06: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
84cc15f0d0 HLSL: Fix #903: Don't short-circuit && or ||. 2017-05-24 16:47:32 -06:00
LoopDawg
174ccb8f1d HLSL: Add imat, umat, and bmat constructors
Fixes #894
2017-05-20 21:54:16 -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
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
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
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
John Kessenich
a5c5fb6118 SPV: Emit extension for using StorageClassStorageBuffer. 2017-05-05 05:09:58 -06: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
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
cfc69d95af Revert "Modernise CMake" 2017-04-28 22:04:24 -06: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
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
d1141843c0 SPV Non-functional: fix ordering causing problems with another branch. 2017-04-13 17:08:11 -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
Rex Xu
f89ad98013 Implement the extension SPV_KHR_16bit_storage 2017-04-07 23:22:33 +08:00
John Kessenich
38a425355b SPV: Move to latest public headers. 2017-04-06 17:21:58 -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
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
e434ad923e Fix #809: smear scalar condition in OpSelect for selecting vector operands. 2017-03-30 10:16:22 -06:00
John Kessenich
714e58b2fc Merge pull request #801 from amdrexu/bugfix
HLSL: Fix an issue of frexp().
2017-03-29 10:04:30 -06:00
Rex Xu
bcf291a7ba Don't emit NV-specific interface members if NV extensions are disabled. 2017-03-29 23:01:36 +08: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
John Kessenich
aa3c64c214 Fix #800 (mostly): set of Linux warnings. 2017-03-28 09:52:38 -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
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
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
Rex Xu
5e317ffe40 SPV: Fix unexpected declarations of capability and extension 2017-03-16 23:02:39 +08: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
John Kessenich
0479437a5c SPV: Fix #739: OpSelect can only operate on scalars and vectors. 2017-03-01 13:49:11 -07:00
John Kessenich
69a2c69649 Merge pull request #736 from steve-lunarg/structbuffer-params
HLSL: add structuredbuffer pass by reference in fn params
2017-02-28 13:10:51 -07:00
John Kessenich
42e33c9bec SPV: Update SPV header to official Rev. 10 of 1.0, and fix the consequences of doing so. 2017-02-27 01:50:28 -07:00
John Kessenich
6c8aaacd28 SPV: Implement new extensions GL_KHX_device_group and GL_KHX_multiview.
These correspond to SPV_KHR_device_group and SPV_KHR_multiview.
Also, bring tests up to date with Khronos internals, and some misc. related changes.
2017-02-27 01:20:51 -07:00
steve-lunarg
dd8287a109 WIP: HLSL: add structuredbuffer pass by reference in fn params
This PR adds the ability to pass structuredbuffer types by reference
as function parameters.

It also changes the representation of structuredbuffers from anonymous
blocks with named members, to named blocks with pseudonymous members.
That should not be an externally visible change.
2017-02-26 11:13:42 -07:00
John Kessenich
4a57dced66 SPV: Handle nested opaque types as function parameters. 2017-02-24 19:22:54 -07:00
Rex Xu
3e783f9b49 SPV: Unexpected declarations of capabilities from NV extensions. 2017-02-22 16:44:48 +08:00
steve-lunarg
5da1f038d8 HLSL: implement 4 (of 6) structuredbuffer types
This is a partial implemention of structurebuffers supporting:

* structured buffer types of:
*   StructuredBuffer
*   RWStructuredBuffer
*   ByteAddressBuffer
*   RWByteAddressBuffer

* Atomic operations on RWByteAddressBuffer

* Load/Load[234], Store/Store[234], GetDimensions methods (where allowed by type)

* globallycoherent flag

But NOT yet supporting:

* AppendStructuredBuffer / ConsumeStructuredBuffer types
* IncrementCounter/DecrementCounter methods

Please note: the stride returned by GetDimensions is as calculated by glslang for std430,
and may not match other environments in all cases.
2017-02-21 15:51:49 -07:00
John Kessenich
8f674e821e Fix issue #676: emit error message on failure to open spv file. 2017-02-18 09:45:40 -07:00
John Kessenich
0302bdf04a SPV: Fix #723: construct vectors from matrices. 2017-02-17 19:06:21 -07:00
John Kessenich
b0561d934c Merge pull request #720 from flaviobortot/master
Added --vn option to generate a C header file containing a variable a…
2017-02-17 09:34:08 -07:00
Maciej Jesionowski
5227b6decb Fix mismatched doc string for SPV_KHR_subgroup_vote
Text for opcodes OpSubgroupAllKHR and OpSubgroupAnyKHR was swapped.
2017-02-17 13:45:29 +01:00
Flavio
15017db971 Removed tabs and replaced with spaces. Changed layout for "else if" 2017-02-15 14:29:33 -08:00
chaoc
df3956c50f Implement NVX_multiview_per_view_attributes 2017-02-14 15:04:33 -08:00
John Kessenich
8e6c6cef6a SPV: Implement specialization constants for ?:. 2017-02-08 17:07:07 -07:00
John Kessenich
433e9ff896 SPV: Emit OpSelect when a selection node is simple enough.
Also, ensures it has a type, no disallowed side effects,
or performance trade offs.
2017-02-08 17:03:13 -07:00
John Kessenich
65ee230f1c HLSL: Add tests and refine what decorations are passed through per stage/in/out. 2017-02-06 23:13:16 -07:00
Flavio
aea3c890d3 Added --vn option to generate a C header file containing a variable assigned to the hex representation of the shader. This is a standard feature on Microsoft's HLSL compiler and it allows developers to include pre-compiled shaders directly into the code. This option enables "Hex output", so it is NOT required to specify -x as well. The output file name is preserved, so no ".h" extension is added. If you want the output file to have ".h" extension then you have to specify it on the output file name. The generated header file uses the "#pragma once" pragma to avoid multiple inclusions. 2017-02-06 11:46:35 -08:00
Endre Oma
ad58d45437 SPV: Emit names of specialization constants 2017-01-31 21:16:17 +01:00
Benjamin Saunders
5a074532af Install headers
This enables the vulkan loader to be built against an installed glslang.
2017-01-29 17:46:44 -08:00
John Kessenich
c0904c15c2 Merge pull request #690 from ligfx/proper_dependencies
CMake: add target_link_libraries internally
2017-01-26 15:13:27 -07:00
Vlad Ivanov
689490fd4d SpvBuilder: add const specifier to vector reference arguments 2017-01-26 20:46:42 +03:00
Rex Xu
c708f98081 Fix a CMakeLists issue 2017-01-24 14:24:21 +08:00
John Kessenich
64b010f390 Merge pull request #678 from chaoc/stereo_view_rendering
support SPV_NV_viewport_array2 and SPV_NV_stereo_view_rendering
2017-01-21 12:05:47 -07:00
Michael Maltese
6077a19ba3 CMake: add target_link_libraries internally
Makes it easier to include glslang in a larger CMake project---instead
of having to call `target_link_libraries(glslang OSDependent OGLCompiler
HLSL)`, for example, you only need to call
`target_link_libraries(glslang)` and it will pull in the helpers it
needs.

This is also better in terms of cleaning up the "public interface",
of sorts, for building glslang: end-users probably shouldn't need to
know or be explicitly dependent on internal targets.
2017-01-21 10:59:15 -08:00
chaoc
771d89fc36 support SPV_NV_viewport_array2 and SPV_NV_stereo_view_rendering 2017-01-20 16:48:26 -08:00
Mike Weiblen
4e9e400ec6 Fix for not-handled-in-switch warnings
Added default to the switch() for AMD_EXTENSIONS to avoid a spew
of warning messages.
2017-01-20 13:39:30 -07:00
John Kessenich
d3aea5edaf Merge pull request #679 from ashwinkolhe/akolhe_spv_khr_subgroup_vote
Implement SPV_KHR_subgroup_vote
2017-01-19 16:16:49 -07:00
Rex Xu
430ef40ab4 Implement new revision of extension GL_AMD_shader_ballot
- Add support for invocation functions with "InclusiveScan" and
  "ExclusiveScan" modes.
- Add support for invocation functions taking int64/uint64/doube/float16
  as inout data types.
2017-01-19 12:09:51 +08:00
Ashwin Kolhe
c720f3e639 Implement SPV_KHR_subgroup_vote
doc.cpp: Add capabilities, scope to the opcodes. Add opcode and
capability strings.
GLSL.ext.KHR.h: Add extension
string.
GlslangToSpv.cpp: Fix handling of opcodes to generate
appropriate SPIR-V.
spirv.hpp: Add capability and opcode
enums.
spv.shaderGroupVote.comp.out: Update SPIR-V output for test
shader.
2017-01-18 14:16:49 -08:00
John Kessenich
fdf6347f0a HLSL: Add EOpMatrixSwizzle, selectively decomposed to other ops, for issue #670.
Since EOpMatrixSwizzle is a new op, existing back-ends only work when the
front end first decomposes it to other operations. So far, this is only
being done for simple assignment into matrix swizzles.
2017-01-13 12:35:01 -07:00
Alex Szpakowski
844dd45db6 Add a virtual destructor to a class which has virtual methods. 2017-01-08 17:57:21 -04:00
John Kessenich
927608b393 Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
John Kessenich
ecba76fe73 Non-Functional: Whitespace, comments, replace accidentally deleted comment.
- fixed ParseHelper.cpp newlines (crlf -> lf)
- removed trailing white space in most source files
- fix some spelling issues
- extra blank lines
- tabs to spaces
- replace #include comment about no location
2017-01-06 11:24:14 -07:00
John Kessenich
807a0d9e2f Merge pull request #640 from chaoc/modify-shader-ballot
Modify shader ballot extension by adding OpSubgroupReadInvocationKHR
2016-12-21 17:40:29 -07:00
chaoc
f200da8631 Modify shader ballot extension by adding OpSubgroupReadInvocationKHR 2016-12-21 12:08:09 -08:00
chaoc
6e5acae144 Add support for SPV_NV_geometry_shader_passthrough 2016-12-20 13:28:52 -08:00
chaoc
0ad6a4e60d Add support for SPV_NV_sample_mask_override_coverage 2016-12-19 16:29:34 -08:00
John Kessenich
e6cbc5b19d Merge pull request #624 from steve-lunarg/remapper-strip-removed
WIP: Remapper: remove debug info for IDs stripped in other passes
2016-12-19 14:07:58 -07:00
John Kessenich
1e275c8486 HLSL: More robust handling of bad shader input, catching a few more things. 2016-12-14 17:02:32 -07:00
steve-lunarg
297754cfe8 Remapper: remove debug info for IDs stripped in other passes
If some DCE is performed such as removing dead functions, then even
if we are NOT stripping debug info, we still must remove the debug
opcodes that refer to the now-dead IDs.

Also, this adds a small change to perform no ID remapping if none
is requested, making spirv-remap properly be a no-op if no options
are given.
2016-12-12 09:01:11 -07:00
John Kessenich
6a60c2f9ea Linker: Walk the call graph to report an error on missing bodies. 2016-12-08 23:22:21 -07:00
John Kessenich
517fe7a6ad Non-functional: Rename some entry-point variables to entryPoint, not main. 2016-11-26 13:31:47 -07:00
John Kessenich
fca826212c Always correctly terminate main. Issue #588, PR #600. 2016-11-26 13:23:20 -07:00
chrgau01@arm.com
c3f1cdfa57 GLSL: The execution scope for barriers should be Workgroup. 2016-11-14 10:10:05 +01:00
Jamie Madill
57cb69a3f1 Fix unrefenced variable warning with AMD_EXTENSIONS disabled. 2016-11-09 13:49:24 -05:00
Johannes van Waveren
2f4c832d47 Merge remote-tracking branch 'upstream/master' 2016-10-21 17:21:46 +09:00
Johannes van Waveren
8e1e717cae fixed MSVC 2015 compile warnings 2016-10-21 17:21:12 +09:00
David Neto
bb5c02fd23 Add missing guard to code that uses AMD extensions
Otherwise compilation fails when ENABLED_AMD_EXTENSIONS is off.
2016-10-19 10:17:25 -04:00
John Kessenich
1fabc0f697 Merge pull request #548 from baldurk/vs2010-compile-fixes
VS2010 compile fixes
2016-10-15 23:09:31 -06:00
Rex Xu
17ff343bf4 SPV: Add missing extension declarations for certain AMD extensions. 2016-10-14 17:41:45 +08:00
baldurk
021dbb4cd4 Change negatable_left_shift and negatable_right_shift to inline funcs
* This avoids an internal compile error on VS2010 possibly related to
  std::enable_if use.
2016-10-13 19:39:24 +02:00
baldurk
cabba60abf Change {} constructor brackets to () 2016-10-13 19:32:37 +02:00
baldurk
7cac9e7245 Change "using x = y;" to "typedef y x;" statements 2016-10-13 19:31:15 +02:00
baldurk
a227d27227 Explicitly implement default constructors 2016-10-13 19:30:27 +02:00
baldurk
1a65fc269c Add std::isnan and std::isinf wrappers for VS2010 that doesn't have them 2016-10-13 19:28:54 +02:00
baldurk
033d3ef22c Change enum class to plain enum 2016-10-13 19:28:20 +02:00
baldurk
ff160f15ef Add #include <cstdint> for std::uint32_t usage 2016-10-13 19:24:42 +02:00
Maciej Jesionowski
7208a974aa SPV: Use SampledImage with OpImageQueryLod
Khronos SPIR-V issue #74
2016-10-12 16:16:24 +02:00
Rex Xu
f3b27471f8 SPV: Implement extension SPV_KHR_shader_draw_parameters. 2016-10-11 14:40:35 +08:00
John Kessenich
ed33e05762 HLSL: Do structure conversion for return type struct-punning on non-entry-point functions. 2016-10-06 13:06:13 -06:00
John Kessenich
074ced3e00 Merge pull request #521 from yavn/frag-shader-primitive-id-capability
SPV: PrimitiveId in frag shader will emit OpCapability
2016-10-01 11:38:18 -06:00
Rex Xu
c9e3c3c941 Parser: Implement extension GL_AMD_gpu_shader_half_float.
- Add built-in types: float16_t, f16vec, f16mat.
- Add support of half float constant: hf, HF.
- Extend built-in floating-point operators: +, -, *, /, ++, --, +=, -=,
  *=, /=, ==, !=, >=, <=, >, <.
- Add support of type conversions: float16_t -> XXX, XXX -> float16_t.
- Add new built-in functions.
2016-09-30 16:13:06 +08:00
Maciej Jesionowski
04b3e8746f SPV: PrimitiveId in frag shader will emit Geometry capability
Using PrimitiveId in a fragment shader requires declaring
an OpCapability with either Geometry or Tessellation.
2016-09-27 10:35:09 +02:00
Rex Xu
b707205b0d SPV: OpGroupBroadcast is unable to handle vector operand. 2016-09-26 15:53:40 +08:00
Rex Xu
36876e6408 SPV: Still have to specify SPIR-V extension for gl_SubGroupSizeARB and gl_SubGroupInvocationARB. 2016-09-23 22:13:43 +08:00
Rex Xu
5159664475 SPV: Implement the extension SPV_KHR_shader_ballot 2016-09-22 16:05:07 +08:00
John Kessenich
eee9d536bc Track separate entry-point names and mangled names...
... and use each in the correct way at consumption sites.
This completes issue #513.
2016-09-19 18:09:30 -06:00
John Kessenich
6fccb3cd75 Non-functional: Sweep through the stack for consistent with "main" and entry point.
Partially addresses issue #513.
2016-09-19 16:01:41 -06:00
Rex Xu
64b9743ce0 SPV: Support simultaneous l-value swizzle and dynamic component selection. 2016-09-14 14:43:55 +08:00
John Kessenich
b3e24e4359 SPV: Fix issue #506: generalize struct deep copy to include arrays. 2016-09-11 12:33:43 -06:00
Rex Xu
c9f349234f SPV: Use OpBitcast to implement 4 pack/unpack built-in functions. 2016-09-09 17:50:07 +08:00
Rex Xu
64bcfdb632 Parser: Add 64-bit type conversion for specialization constant. 2016-09-05 22:20:28 +08:00
John Kessenich
4bf7155051 SPV: Flatten structs for copy when they are GLSL type aliases.
Addresses issue #304 and issue #307 by replacing unmatched type OpStores with
per-member copies. Covers assignment statements and most argument passing, but
does not yet cover r-value-based argument passing.
2016-09-02 16:35:01 -06:00
John Kessenich
f2b7f3353b SPV: Tighten up number of struct-types declared based on decoration.
Takes some pressure off of issue #304.
Structures don't inherit locations and then explicitly decorate
members with them, so removed this reason to have another instance
of a structure type.
2016-09-01 17:05:23 -06:00
steve-lunarg
a8456415b8 WIP: SPV Remapper: add remapper test framework 2016-08-25 10:46:51 -06:00
Rex Xu
2bbbe0621d SPV: Some group invocation operations should be applied to scalars. 2016-08-23 15:41:05 +08:00
steve-lunarg
811d9f4cad WIP: SPIRV remapper: allow 64 bit literals in OperandVariableLiteralId class iteration 2016-08-17 08:33:49 -06:00
Dan Baker
55d5f2d4df HLSL: Changing SPIRV source language to unkown 2016-08-15 16:05:45 -04:00
David Neto
b86e8b629a Revert "Merge pull request #456 from steve-lunarg/remapper-literal64"
This reverts commit ad08b30f69, reversing
changes made to 28660bb580.

This backs out the pull request
https://github.com/KhronosGroup/glslang/pull/456 because it introduced
several internal errors even on code that only uses 32-bit numeric
types.
2016-08-12 16:49:58 -04:00
steve-lunarg
b249f2fc24 SPIRV: allow 64 bit literals in OperandVariableLiteralId class iteration. 2016-08-12 09:53:31 -06:00
John Kessenich
2c6038ecf1 Merge branch 'cpp-headers' 2016-08-11 10:01:13 -06:00
John Kessenich
4583b61e20 HLSL: Smear scalars to match vectors for relational operations.
Yield a vector relational compare and a vector result.
2016-08-07 19:14:22 -06:00
John Kessenich
267590d452 Whitespace: Nonfunctional: fix inconsistent white space, esp. no tabs. 2016-08-05 17:34:34 -06:00
John Kessenich
66ec80e01b Build: C++ headers: Replace PR #366 with a more directed version. 2016-08-05 14:04:23 -06:00
John Kessenich
f6640761c4 Front-end: Implement 2nd task of issue #400; precision of result and operation.
From the ES spec + Bugzilla 15931 and GL_KHR_vulkan_glsl:
- Update precision qualifiers for all built-in function prototypes.
- Implement the new algorithm used to distinguish built-in function
  operation precisions from result precisions.
Also add tracking of separate result and operation precisions, and
use that in generating SPIR-V.
(SPIR-V cares about precision of operation, while the front-end
cares about precision of result, for propagation.)
2016-08-02 21:48:02 -06:00
John Kessenich
1176530bf5 SPV: Prevent issue #415 with better semantic checking. 2016-07-31 12:39:46 -06:00
Rex Xu
ce31aea0d0 SPV: Fix an issue of ++/-- for dvec/dmat. 2016-07-29 16:13:04 +08:00
John Kessenich
8c8505c604 SPV: For AST interpolateAt* ops consuming a swizzle, invert the order.
Apply the interpolation first, then apply the swizzle to the result,
the inverse of the order requested by the AST.  This fixes issue #411.
2016-07-26 12:53:54 -06:00
Pyry Haulos
b93e3a3957 Remap Scope and MemorySemantics IDs in SPIRV remapper
Scope and MemorySemantics operands contain IDs as well and may need
remapping.
2016-07-22 09:57:28 -07:00
Rex Xu
9d93a2370d Implement 4 AMD-specific extensions.
- Support GL_AMD_shader_ballot (SPV_AMD_shader_ballot).
- Support GL_AMD_shader_trinary_minmax (SPV_AMD_shader_trinary_minmax).
- Support GL_AMD_shader_explicit_vertex_parameter
  (SPV_AMD_shader_explicit_vertex_parameter).
- Support GL_AMD_gcn_shader (SPV_AMD_gcn_shader).
2016-07-20 16:18:05 +08:00
John Kessenich
4016e38bea Build: Switch to Rev. 6 of headers, removing "BadValue" enum stuff.
Note: Technically, this is glslang's modified private copy of official headers.
Official headers will appear in other places, like
https://github.com/KhronosGroup/SPIRV-Headers.
2016-07-15 11:55:34 -06:00
John Kessenich
7f349c73db Build: Remove causes of pedantic warnings. Addresses issue #352 and PR #242. 2016-07-08 22:09:10 -06:00
John Kessenich
c45dddae5f Merge pull request #314 from mre4ce/master
Added -x option to save SPIR-V as 32-bit hexadecimal numbers to a text file.
2016-07-08 15:26:27 -06:00
John Kessenich
78a4557621 SPV: Fix issue #376; declare Geometry capability for fragment use of gl_Layer. 2016-07-08 14:05:15 -06:00
John Kessenich
91e4aa5900 SPV: Further refine OpenGL vs. Vulkan differences for SPIR-V.
Includes adding test cases to verify the differences.
2016-07-07 19:27:15 -06:00
John Kessenich
2d0cc786f3 SPV: Turn on atomic-storage functionality for SPIR-V.
This is used by OpenGL, but not Vulkan.
Includes:
 - atomicCounter, atomicIncrement, atomicCounterDecrement
 - atomic_uint layout-offset checking
 - AtomicStorage capability
2016-07-07 17:40:35 -06:00
John Kessenich
2f47bc9781 SPV: Don't decorate locations within an array, it doesn't make sense.
This fixes issue #360.
2016-06-30 22:00:09 -06:00
John Kessenich
6090df0fa3 SPV: Non-functional: break up big function into three smaller ones.
Also, improve variable names. This grew to be overly hard to understand.
2016-06-30 21:28:33 -06:00
Rex Xu
c884b4a47f SPV: Certain decorations are missing for structure-typed in/out variables. 2016-06-30 13:11:36 +08:00
LoopDawg
6e72fddaa2 Add HLSL memory barrier intrinsics, fix dst, add lit & EvaluateAttributeSnapped 2016-06-20 09:53:59 -06:00
John Kessenich
5aa59e2044 HLSL: Map parameter qualifiers from generic to function-specific and entry-point specific. 2016-06-17 15:52:46 -06:00
John Kessenich
65336488a8 SPV: projective texturing: move the project coordinate.
SPV doesn't allow gaps in the components of the texturing coordinate.
It also removes the shadow reference.
So, close up the components so all used components are together.
2016-06-16 14:06:26 -06:00
John Kessenich
76d4dfcd51 SPV non-functional: minor readability improvements for texturing. 2016-06-16 12:43:23 -06:00