1627 Commits

Author SHA1 Message Date
Daniel Koch
db32b243ff Add support for GLSL_EXT_ray_tracing
and SPV_KHR_ray_tracing
2020-03-17 20:42:47 -04:00
Jeff Bolz
40007b862d Forbid memoryBarrierAtomicCounter for Vulkan compiles 2020-03-16 23:53:04 -05:00
Malcolm Bechard
4b2483ee88
Fix #2005. Allow multiple compilation units to declare identical push_constant blocks (#2123)
* Fixes #2005

Allow multiple units in a stage to have push_constants as long
as the blocks match.
Requires #2006 to be fixed to be functional.

* tweaks to #2005 fix after some testing

* add unit tests for push constants across multiple compilation units

For #2005

* update reference output for tests that fail validation

* fix uninitialized result.validationResult
2020-03-16 08:51:15 -06:00
Jeff Bolz
ad3f10bbd0 EXT_debug_printf - make escape sequences better match C/C++ 2020-03-10 10:23:07 -05:00
John Kessenich
dbb56a1d48
Merge pull request #2105 from jeffbolznv/nonunif
Allow nonuniformEXT() on sampler types
2020-03-10 03:50:27 -06:00
Jeff Bolz
13444545a9 disable escape sequences for #line and #error 2020-03-09 21:09:18 -05:00
Jeff Bolz
b57af2f5ad Decorate accesschain operand for nonuniform UBO loads
This is conservative and still also decorates the loaded value.
2020-03-09 14:09:41 -05:00
Jeff Bolz
39ffdaf2ab Allow nonuniformEXT() on sampler types.
Also add missing NonUniformEXT decoration on OpImageTexelPointer.
2020-03-09 10:48:12 -05:00
Jeff Bolz
04d73731de GL_EXT_debug_printf implementation 2020-03-05 13:41:34 -06:00
John Kessenich
bbbd9a2a1f Fix #1843: Handle built-in function output parameters to a swizzled arg
In GLSL/HLSL/AST,  v.zyx is an l-value, but not in SPIR-V, which cannot represent it.
So, a temporary is used instead.
2020-03-03 07:21:37 -07:00
Rex Xu
fb18b6df28 Fix an issue of SPV generation for imageAtomicStore.
For GLSL function imageAtomicStore, it will be translated to
OpImageTexelPointer + OpAtomicStore. The result type of
OpImageTexelPointer must be the same as the sampled type of OpTypeImage.
On translation, the result type is mistakenly fetched from operand list
operands[2] while operands[2] corresponds to sampleNum whose type is
always uint. This leads to an error if the image type is iimageXXX that is
int image.
2020-02-22 22:04:31 +08:00
John Kessenich
c12493ff69
Merge pull request #2086 from samuelig/SPV_AMD_shader_image_load_store_lod
SPV_AMD_shader_image_load_store_lod is now validated by spirv-tools
2020-02-19 23:25:39 -07:00
Samuel Iglesias Gonsálvez
a515fff401 SPV_AMD_shader_image_load_store_lod is now validated by spirv-tools 2020-02-20 06:57:49 +01:00
John Kessenich
abfc4c2ceb Fix part of #2070: Correctly handle promotion for <unary-op>(int).
This still only handles a scalar correctly, and some
vector cases need additional fixes.
2020-02-18 06:53:39 -07:00
John Kessenich
2d70e98dea
Merge pull request #2028 from ShchchowAMD/constant_expressions_array_mod
GLSL: Support constant folding for mod
2020-02-06 02:56:37 -07:00
Rex Xu
b4bab3ce01 Fix a parser error of GL_KHR_memory_scope_semantics
When 2DMS or 2DMSArray is used, IMAGE_PARAMS will take an additional
paramter to represent sample number. The semantics check should get the
correct semantics values, taking this case into account.
2020-02-06 16:51:10 +08:00
John Kessenich
b0ada80356 HLSL: Fix #1974: ignore input primitives on non-entry-point functions. 2020-01-17 00:14:51 -07:00
John Kessenich
273d3a5093 SPV/Vulkan: Add support for Vulkan 1.2, which defaults to SPIR-V 1.5. 2020-01-15 00:10:41 -07:00
John Kessenich
5181367062
Merge pull request #1998 from ShchchowAMD/ARB_gpu_shader_fp64
Add support for ARB_gpu_shader_fp64
2020-01-08 06:18:44 -07:00
John Kessenich
6f98892dd1 Fix #1829: Add "--" command-line options for macro def/undef.
This allows OpModuleProcessed logging to be consistent with everything taking
"--" options.
2020-01-08 01:28:45 -07:00
John Kessenich
1d258ac346
Merge pull request #2032 from ShchchowAMD/atomic-uint-binding
Modify max binding checks for atomic_uint
2020-01-06 23:49:23 -07:00
Chow
ac6b7cf581 Add builtin constants
Add builtin constants:

gl_MaxFragmentUniformVectors and gl_MaxVertexUniformVectors.
They should both be available since version 410 for core.
2020-01-06 15:53:20 +08:00
Chow
a3c7a25e10 Add support for ARB_gpu_shader_fp64
GLSL Version : >= 150

Purpose:
Allow users to use features by enabling this extension, even in low versions.

Extension Name:
ARB_gpu_shader_fp64

Builtin-variables:
Nah

Builtin-functions:
functions overloaded for this extension, please check registry in reference.

Keywords:
Double

Features:
add support for type "double"

Reference:
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gpu_shader_fp64.txt

Add support for implicit conversion

1. Remove builtin double vertex (this is introduced by vertex_attrib_64bit
2. Add extension check and implicit conversion as double has been introduced
3. Add test results.
2020-01-06 11:08:20 +08:00
John Kessenich
930403e5b3
Merge branch 'master' into ARB_uniform_buffer_object 2019-12-29 21:32:41 -07:00
John Kessenich
18fb7f24b8
Merge pull request #1996 from ShchchowAMD/ARB_texture_multisample
Add support for ARB_texture_multisample
2019-12-29 20:19:39 -07:00
John Kessenich
c674299ddb
Merge pull request #2036 from ShchchowAMD/fix_atomic_uint_offset_check
atomic counter offset should align to 4 (compute shader)
2019-12-29 19:49:16 -07:00
John Kessenich
01aee059f5
Merge pull request #1995 from ShchchowAMD/ARB_sample_shading_support
Add support for ARB_sample_shading
2019-12-29 19:35:18 -07:00
John Kessenich
5de15a256e HLSL: Fix #2037: Integer dot used incorrect input for adds. 2019-12-26 10:56:54 -07:00
Chow
5db058c020 atomic counter offset should align to 4
atomic counter offset should align to 4
Ref:
glspec46.core - 6.8 BufferObjectState
offset restriction multiple of 4
2019-12-25 17:27:45 +08:00
Chow
891ec09c62 Modify atomic_uint binding check
Modify atomic_uint binding check.

Currently, when not declared with offset, default atomic_unint won't check whether its binding is valid or not more than its limit value.
2019-12-25 17:08:48 +08:00
Chow
97c4c0936f Add support for ARB_uniform_buffer_object
GLSL Version : >= 120

Purpose:
Allow users to use features by enabling this extension, even in low versions.

Extension Name:
ARB_uniform_buffer_object

Builtin-variables:
Uniform

Builtin-functions:
Nah

Keywords:
Nah

Features:
uniform block

Reference:
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_uniform_buffer_object.txt
2019-12-23 16:30:12 +08:00
Chow
a8f9886cc6 Add support for ARB_texture_multisample
GLSL Version : >= 140

Purpose:
Allow users to use features by enabling this extension, even in low versions.

Extension Name:
ARB_texture_multisample

Builtin-variables:
Nah

Builtin-functions:
Nah

Keywords:
      sampler2DMS, isampler2DMS, usampler2DMS,
      sampler2DMSArray, isampler2DMSArray, usampler2DMSArray

Reference:
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_multisample.txt
2019-12-23 15:37:04 +08:00
Chow
78b1180466 Add support for ARB_sample_shading
Version : >= 130

Extension Name: ARB_sample_shading

Builtin-variables:
"gl_SampleID"
"gl_SamplePosition"
"gl_SampleMask"
"gl_NumSamples"

Reference:
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_sample_shading.txt
2019-12-23 14:34:38 +08:00
Chow
44e842cd9c Add constant expression with mod
Purpose:
glsl spec allows to define array with the length of the result of  constant expression, the arithmetic operation of "mod(float (7.1), float (4.0))" should be generate the array length at the shader compile time,

but glslang didn't support mod operation for the constant expression in previous implementation;

An example is as following:

###########
#version 460
flat out highp int vtx_out_out0;
void main (void)
{
     float array[int(mod(float (7.1), float (4.0)))];
     vtx_out_out0 =  array.length();
}
###########
2019-12-23 11:29:52 +08:00
Ian Romanick
fbcdcac254 INTEL_shader_integer_functions2: Add compiler front-end support
The changes to glslang/glslang/MachineIndependent/ParseHelper.cpp exist
purely to prevent even more instances of "warning: enumeration value
‘EOp...’ not handled in switch"

v2: Remove 8-bit types.  Overzealous copy-and-paste led to adding
support for a bunch of types that the extension doesn't actually enable.

v3: Update expected test results file.  Just changing an expected
results file to make a test pass seems sketchy to me, but I'm not sure
what else to do.

v4: Add missing entry for EOpAbsDifference in
TOutputTraverser::visitBinary.  Noticed by JohnK.
2019-12-03 11:06:34 -08:00
John Kessenich
38b4db48f9 Fix #1983: __ is okay starting with ES 300, rather than 310. 2019-11-23 01:29:02 -07:00
John Kessenich
86258aab80
Merge pull request #1972 from andflo-Arm/master
Fix construction issue for 8 and 16 bit types.
2019-11-22 21:38:36 -07:00
John Kessenich
3c0d2e5b67 HLSL: Fix #1976: Don't let ENABLE_HLSL change struct/class layout. 2019-11-15 05:01:27 -07:00
Andreas Flöjt
cb563e68d2 Add a test for 8- and 16-bit construction. 2019-11-14 14:41:52 +01:00
John Kessenich
e7cb9cb9c4 HLSL: Fix #1960: fmod() was not converting int args to float. 2019-11-12 05:32:51 -07:00
John Kessenich
18d6b6b63e Tests: Add more test results for the previous generator version bump. 2019-11-03 00:22:47 -06:00
John Kessenich
31c3370d83 Bump up the generator version, which is exposed in SPV test results. 2019-11-02 21:26:40 -06:00
David Neto
8c3d5b4b6c SPIR-V: Aggressively prune unreachable merge, continue target
More aggressively prune unreachable code as follows.
When no control flow edges reach a merge block or continue target:
- delete their contents so that:
  - a merge block becomes OpLabel, then OpUnreachable
  - a continue target becomes OpLabel, then an OpBranch back to the
    loop header
- any basic block which is dominated by such a merge block or continue
  target is removed as well.
- decorations targeting the removed instructions are removed.

Enables the SPIR-V builder post-processing step the GLSLANG_WEB case.
2019-10-29 15:33:54 -04:00
John Kessenich
f8d1d7442b Web: Reclaim more space and make all work w/wo GLSLANG_WEB. 2019-10-23 03:15:55 -06:00
John Kessenich
e5eee8fb03 Web: Add basic atomics for SSBOs. 2019-10-23 00:25:39 -06:00
John Kessenich
3dd1ce5b54 Web: Add SSBOs and a few other missing compute features. 2019-10-23 00:25:39 -06:00
John Kessenich
51ed01c877 Web: Add compute stage. 2019-10-23 00:25:39 -06:00
John Kessenich
61c22e255d Web: Add separate texture/sampler, exclude *CubeArray*.
Looks like will add about 1K compressed size to executable footprint.
2019-10-23 00:25:38 -06:00
Jeff Bolz
016ddee83a Only apply volatile semantics to atomics when using Vulkan Memory Model 2019-10-17 11:22:57 -05:00
Dan Sinclair
3290d38011 Use commandline options instead of ENV variables 2019-10-16 13:08:48 -04:00