2971 Commits

Author SHA1 Message Date
Alejandro Piñeiro
adba7dfc68 ParseHelper: assign global XfbBuffer to a block missing it
If a block has assigned a XfbOffset it is assumed that it would
inherit the current global XfbBuffer. This commit fixes two use cases:

1) Getting the members of a Block with a XfbOffset to be assigned an
   offset, as explained on GLSL 4.60 spec, section "4.4.2 Output
   Layout Qualifiers", subsection "Transform Feedback Layout
   Qualifiers".

2) Compute properly an error on overlapping ranges if a block is
   assigned a XfbOffset and one of it members is assigned a explicit
   one. This gets working because when the members of a block get
   assigned a Offset/Buffer at fixBlockXfbOffsets, then the block is
   deassigned the Offsets, so ranges are computed only with the block
   members.

BTW, this is already done when redeclaring block builtins.

Fixes #1535
2018-11-10 11:35:50 +01:00
John Kessenich
918caa7ee4
Merge pull request #1547 from Igalia/apinheiro/xfb-struct-assignment
Apinheiro/xfb struct assignment
2018-11-09 12:27:39 -07:00
John Kessenich
685fccd97a
Merge pull request #1565 from greg-lunarg/kg25
Add DeadBranchElim before MergeReturn in legalization.
2018-11-08 21:08:54 -07:00
GregF
68fbda9862 Add DeadBranchElim before MergeReturn in legalization.
MergeReturn now requires this or could throw an error.
2018-11-08 10:35:45 -07:00
John Kessenich
4207c97b93 Fix #1563: Corrupt token when an object macro miscalls a function macro 2018-11-07 18:25:56 -07:00
John Kessenich
4ee2f75294 PP: More clearly distinguish funtion-like and object-like macros 2018-11-07 17:22:17 -07:00
John Kessenich
0a339ec20c
Merge pull request #1564 from jeffbolznv/spirv-pch
Rename PCH macro to glslang_pch (to avoid name collision) and update to latest spirv-tools
2018-11-07 10:01:25 -07:00
Jeff Bolz
02ed310ac3 Rename PCH macro to glslang_pch (to avoid name collision) and update to latest spirv-tools 2018-11-07 09:35:31 -06:00
John Kessenich
8b782e77df Tests: Add test for ways of calling no-argument macro with (). 2018-11-06 14:51:27 -07:00
John Kessenich
1c1c2d643a
Merge pull request #1559 from jeffbolznv/glslang_pch
Use precompiled headers for some glslang projects (MSVC-only)
2018-11-02 10:24:48 -06:00
John Kessenich
cdf7a85b14
Merge pull request #1557 from nicebyte/spec-const-decorations
Add names for composite spec constants in SPIR-V
2018-11-02 10:23:22 -06:00
Grigory Dzhavadyan
4c9876b34c Add names for composite constants in SPIR-V
Consider the following code:

    layout(constant_id=0) const int Y = 1;
    layout(constant_id=1) const int Z = 2;
    layout(constant_id=3) const int X = Y + Z;

Previously, it would produce SPIR-V decorations like this:

    Decorate 21(Y) SpecId 1
    Decorate 22 SpecId 3
    Decorate 33(Z) SpecId 0

This seems inaccurate, since the spec constant `X` that is dependent on
the two others did not get a name in the SPIR-V decorations. This behavior
may potentially negatively affect shader introspection capabilities.

This change alters the behavior to always add a name, which results in the code
above producing the following decorations:

    Decorate 21(Y) SpecId 1
    Decorate 22(X) SpecId 3
    Decorate 33(Z) SpecId 0
2018-11-02 00:45:12 -07:00
Jeff Bolz
22d0b7cbad Use precompiled headers for some glslang projects 2018-10-31 15:38:08 -05:00
John Kessenich
a440fbb04f
Merge pull request #1543 from alelenv/nv-raytracing-final
Add support for nv_ray_tracing final
2018-10-31 12:00:36 -06:00
Ashwin Lele
ff1783db87 Multiple features and misc fixes for final raytracing non experimental version. 2018-10-31 07:55:24 -07:00
Alejandro Piñeiro
af8c1bdb16 ParseHelper: assign xfb_offset for struct members too
If the out variable is a struct type, with a xfb_offset explicitly
assigned, the members need to get their xfb_offset assigned. This is
specially relevant, as we cannot use layout qualifiers on struct
members.
2018-10-31 10:34:44 +01:00
John Kessenich
0ac199df32
Merge pull request #1558 from Kangz/fix_build_gn
BUILD.gn: remove reference to non-existent header
2018-10-30 17:17:11 -06:00
Corentin Wallez
ab5382cf79 BUILD.gn: remove reference to non-existent header 2018-10-30 16:11:46 +01:00
John Kessenich
b2b3d81e9b
Merge pull request #1556 from Kangz/msvc
Fix MSVC warning C4065: 'default' but no 'case' labels
2018-10-29 16:16:46 -06:00
Corentin Wallez
04a2fe93d0 Fix MSVC warning C4065: 'default' but no 'case' labels
This would happen in SpvPostProcess when we don't enable AMD extensions.
2018-10-29 16:24:00 +01:00
John Kessenich
f0928b3f56 Build: Pin googletest to a version that works with visual studio 2013. 2018-10-26 11:28:37 -06:00
John Kessenich
25ed3fce0c
Merge pull request #1542 from sheredom/fix_8bit_storagebuffer
Fix 8-bit storage nearly always using the UniformAndStorageBuffer8BitAccess capability.
2018-10-26 10:27:46 -06:00
John Kessenich
8717a5d39a SPV/Standalone: Support specifying arbitrary versions of SPIR-V. 2018-10-26 10:16:47 -06:00
John Kessenich
ae63a8dfce
Merge pull request #1549 from sparmarNV/fix-SPV_NV_mesh_shader
Allow GL_NV_mesh_shader in fragment shaders for perprimitiveNV
2018-10-26 09:25:38 -06:00
Neil Henning
b6b01f067b Fix 8-bit storage nearly always using the
UniformAndStorageBuffer8BitAccess capability.

When using the 8-bit storage extension it basically always used the
`UniformAndStorageBuffer8BitAccess` capability, even in cases where it
wasn't required. For instance if we are targeting Vulkan 1.1 (SPIR-V 1.3
or higher), and we are only using 8-bit types in an SSBO, we only need
the `StorageBuffer8BitAccess` capability.

I fixed this by enabling storage buffer use in Vulkan 1.1 / SPIR-V 1.3
or higher, and then changing the logic to match.

I also added some tests that will output different capabilities when run
on Vulkan 1.0 and 1.1, thus they are added twice to the test list (one
for each version).

Fixes #1539
2018-10-26 14:23:41 +01:00
Sahil Parmar
38772c0434 Allow GL_NV_mesh_shader in fragment shaders for perprimitiveNV
- Emit relevant capability/extension for use of perprimitiveNV in fragment shader
- Remove redundant checks for mesh shader qualifiers in glslang.y
- Add profile version check for use of extension GL_NV_mesh_shader
- Add a new gtest for use of perprimitiveNV in fragment shader
2018-10-25 23:50:59 -07:00
John Kessenich
816bc4447c
Merge pull request #1545 from dj2/warnings
Fixup unused parameter warnings
2018-10-25 13:44:40 -06:00
John Kessenich
086febc448 PP: Fix #155: Don't give error on HLSL PP-only parsing. 2018-10-25 12:43:02 -06:00
Dan Sinclair
70f13b2ed5 Fixup unused parameter warnings
This CL removes the current parameters which are unused in order to
fixup the issued clang warnings.
2018-10-24 09:54:48 -04:00
John Kessenich
a08f465d53
Merge pull request #1534 from Kangz/no_static_lib
BUILD.gn: remove the static_library target.
2018-10-22 08:33:55 -06:00
John Kessenich
9323fd4d58 Build: Fix #1490, unused variables. 2018-10-20 18:30:57 -06:00
John Kessenich
43bb5bd188 Fix #1536: use string instead of TString for uniform-location override. 2018-10-20 17:37:19 -06:00
Corentin Wallez
5403f380a4 BUILD.gn: remove the static_library target.
This had no sources and depended on a source_set which is an invalid use
of GN because the source_set gets propagated to dependents of the
static_library instead.
2018-10-17 12:22:28 +02:00
John Kessenich
fa61e4c061
Merge pull request #1533 from amdrexu/bugfix
Fix a parse issue of imageAtomicCompSwap()
2018-10-17 01:01:00 -06:00
Rex Xu
d698ebf5f8 Fix a parse issue of imageAtomicCompSwap()
The max count of arguments is 5 when image2DMS/image2DMSArray is
specified.
2018-10-17 13:55:11 +08:00
John Kessenich
e9405d0b44
Merge pull request #1531 from jeffbolznv/workgroup_nonprivate
Fix flags.nonprivate to be true for workgroup memory, which is implicitly workgroupcoherent/nonprivate
2018-10-16 12:37:01 -06:00
Jeff Bolz
ab3c965a46 Fix flags.nonprivate to be true for workgroup memory, which is implicitly workgroupcoherent/nonprivate 2018-10-15 22:46:48 -05:00
Khronos Group Webmaster
4685f3246e
Create CODE_OF_CONDUCT.md 2018-10-10 15:48:43 -04:00
John Kessenich
c374030e80
Merge pull request #1523 from sparmarNV/fix-SPV_NV_mesh_shader
Allow redeclaration of builtin interface blocks in mesh shader
2018-10-04 23:46:21 -06:00
John Kessenich
732623e14a
Merge pull request #1524 from chaoc/master
Fix inferred output primitive for GL_NV_geometry_shader_passthrough
2018-10-04 23:41:24 -06:00
Chao Chen
07ef0e4c84 For GL_NV_geometry_shader_passthrough extension, the Inferred output primitive for ElgTriangles should be ElgTriangleStrip.
Also removed unnecessary relax for GL_NV_geometry_shader_passthrough in link validate
2018-10-04 18:39:27 -07:00
John Kessenich
2f78b9c742
Merge pull request #1515 from Igalia/more-location-command-line-options
Enhancement: add extra command line options that modifies aml
2018-10-04 18:56:39 -06:00
Sahil Parmar
035cbbe3d0 Allow redeclaration of builtin interface blocks in mesh shader
Apart from allowing redeclaration of gl_MeshPerVertexNV and gl_MeshPerPrimitiveNV blocks, this change also -
- Resize clip/cull perview distances based on static index use
- Error out use of both single-view and per-view builtins
- Add new gtests with redeclared blocks and edit existing test output
- Fix couple of typos
2018-10-04 16:39:18 -07:00
John Kessenich
ca042a0ffb
Merge pull request #1518 from Kangz/fix_dawn
BUILD.gn: glslang_sources need the public config too
2018-10-03 12:25:12 -06:00
Corentin Wallez
6857c23825 BUILD.gn: glslang_sources need the public config too 2018-10-03 13:15:23 -04:00
John Kessenich
2e0806c7be
Merge pull request #1517 from Kangz/mac_complete_lib
BUILD.gn: only use complete_static_lib on mac
2018-10-02 08:47:33 -06:00
Corentin Wallez
a26827adc2 BUILD.gn: only use complete_static_lib on mac 2018-10-02 09:28:15 -04:00
Neil Roberts
b0f3d794c8 Add an option to set the base uniform location
This will be used to generate uniform locations with --aml
2018-10-02 12:15:22 +02:00
Neil Roberts
16f53474c8 Add a command-line option to override uniform locations 2018-10-02 12:15:22 +02:00
John Kessenich
4508a8170a
Merge pull request #1507 from sparmarNV/fix-SPV_NV_mesh_shader
Add ES 320 support and additional error checks for SPV_NV_mesh_shader
2018-09-28 06:24:02 -06:00