2242 Commits

Author SHA1 Message Date
Greg Fischer
7141f89a89
Merge pull request #2806 from ZhiqianXia/bestFunctionMatching
#extension GL_ARB_gpu_shader5 support the implicit conversion ,
2021-11-15 13:28:53 -07:00
Greg Fischer
7d27f667a3
Merge pull request #2818 from mhillenbrand/promoteConstantUnion_signed_char
TIntermediate::promoteConstantUnion(): fix conversion to int8
2021-11-15 10:52:12 -07:00
Greg Fischer
f669f13998
Merge pull request #2819 from greg-lunarg/i2812
Fix struct type sharing
2021-11-12 19:16:35 -07:00
Greg Fischer
3074ec94bf
Merge pull request #2814 from mhillenbrand/isinf_isnan2
Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding (updated)
2021-11-12 17:38:11 -07:00
Greg Fischer
10be28ac9b Fix struct type sharing
Fixes #2812
2021-11-12 16:57:11 -07:00
Marius Hillenbrand
f1fa8afa25 TIntermediate::promoteConstantUnion(): fix conversion to int8
The signedness of type char is implementation-defined in C++. The
conversion to (signed) int8 currently uses a cast to char, which is
undefined for negative values when the type char is implemented as
unsigned. Thus, fix to cast to "signed char", which has the intended
semantic on all implementations.

Fixes #2807
2021-11-12 10:35:31 +01:00
Greg Fischer
1f8c8b88c7 Revert port of GL_EXT_shader_realtime_clock to GL_EXT_spirv_intrinsics
Could not be found by glslang library interface. Blocking SDK build.
2021-11-11 23:39:47 -07:00
Marius Hillenbrand
0eda343970 Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding (updated)
There were two implementations of isInf() and isNan(), in Constant.cpp
and in intermOut.cpp. The former only works on little-endian systems,
the latter is a wrapper for library functions and works regardless of
endianness. Move the second version into Common.h and adopt it in both
places. Thereby avoid the duplication and fix for big-endian systems.

A previous commit with the same intent and purpose had missed a required
header for builds on Windows.

On s390x, this fixes the test case
Glsl/CompileToAstTest.FromFile/constFold_frag.

Fixes #2802
2021-11-11 16:49:40 +01:00
Greg Fischer
600c5037ba
Merge pull request #2810 from greg-lunarg/push1
Generate error for binding on push_constant
2021-11-11 08:18:59 -07:00
Greg Fischer
002b3f55c7 Generate error for binding on push_constant 2021-11-10 15:15:43 -07:00
Greg Fischer
22a5e36446
Revert "Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding" 2021-11-10 14:13:37 -07:00
ZhiqianXia
50a6a51625 Support the #extension GL_ARB_fragment_coord_conventions.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-10 10:41:40 +08:00
ZhiqianXia
77b0d72c68 #extension GL_ARB_gpu_shader5 support the implicit conversion ,
So the best function matching algorithm should be actived.


Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-10 09:44:16 +08:00
Greg Fischer
bb5b357550
Merge pull request #2781 from kevin-mccullough/FixLinkTimeValidationForGl_PerVertex
Fix incorrect link time validation for unused gl_PerVertex members
2021-11-09 13:44:32 -07:00
Greg Fischer
627f409aec
Merge pull request #2801 from haasn/thread_safety
Thread safety fixes
2021-11-09 11:43:38 -07:00
Marius Hillenbrand
d1ee644e1d Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding
There were two implementations of isInf() and isNan(), in Constant.cpp
and in intermOut.cpp. The former only works on little-endian systems,
the latter is a wrapper for library functions and works regardless of
endianness. Move the second version into Common.h and adopt it in both
places. Thereby avoid the duplication and fix for big-endian systems.

On s390x, this fixes the test case
Glsl/CompileToAstTest.FromFile/constFold_frag.

Fixes #2802
2021-11-09 16:58:21 +01:00
Greg Fischer
8f56d73800
Merge pull request #2799 from cyanreg/master
Add support for targeting Vulkan 1.2 in the C API
2021-11-08 18:47:27 -07:00
Kevin McCullough
13fd2d6470 Fix incorrect link time validation for unused gl_PerVertex members 2021-11-08 15:23:02 -08:00
Niklas Haas
4302d51868 Don't release global mutex before initialize/finalize is done
Otherwise this can race with other threads for access to the fields it's
supposed to be initializing/finalizing.

For example, imagine another thread is calling ShInitialize() while the
first thread is calling ShFinalize() - the finalize function would
destroy the state at the same time as the initialize function is trying
to initialize it.

Holding on to the global lock for the entire function prevents all of
these failure modes.
2021-11-08 15:00:28 +01:00
Niklas Haas
3971424207 Initialize global mutex in a thread-safe manner
Currently, ShInitialize() and friends call glslang::InitGlobalLock()
which *overwrites* the global mutex. As such, even though it ostensibly
takes a mutex, this function is actually completely thread-unsafe.

Fix it by using pthread_once to ensure the mutex is only initialized
once, and then never again.
2021-11-08 14:47:32 +01:00
Lynne
5ec47530b7 Add support for targeting Vulkan 1.2 in the C API 2021-11-08 10:48:38 +01:00
ZhiqianXia
46d3a30bd9 Support the #extension GL_ARB_draw_instanced.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-08 13:48:03 +08:00
ZhiqianXia
e76116982a Add the GL_EXT_shader_integer_mix Preamble for glsl.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-02 14:39:28 +08:00
Greg Fischer
77d680e1c3
Merge pull request #2712 from ZhiqianXia/switch_error
glslang should report a error for Feature: last case/default label not followed by statements'.
2021-11-01 10:19:09 -06:00
ZhiqianXia
1de2d1745b To be compatible with Feature: 'last case/default label not followed by statements'.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-10-28 09:23:19 +08:00
Greg Fischer
432a43cccb Remove support for double trig, pow, exp and log
These are not supported in core GLSL or under any extension

Fixes 2793
2021-10-27 11:59:26 -06:00
Jeremy Hayes
c9cc4845b9 Return new allocator for copied containers
Fix #2760.

Implement the optional function select_on_container_copy_contruction to
return a default-contructed allocator for containers that are
copy-constructed. This gives copy-constructed containers a pool
allocator for the current thead.

There may be a similar problem with the copy contructor which takes
allocators of type "Other" but, in practice, there is only one place
where this is being used and the allocators are always the same. (i.e.
executing from the same thread)
2021-10-25 10:59:27 -06:00
Greg Fischer
3afa350331
Merge pull request #2780 from kevin-mccullough/FixCrossStageCheck
Fix cross-stage check to allow subsequent stage to use previous stage's binding
2021-10-22 14:44:10 -06:00
Greg Fischer
38fd9221db
Merge pull request #2777 from amdrexu/bugfix
Make modifications of GL_EXT_spirv_intrinsics
2021-10-21 12:59:22 -06:00
Greg Fischer
9290474dcf
Merge pull request #2787 from greg-lunarg/i2779
Allow 8/16-bit integer as array index
2021-10-20 18:26:59 -06:00
Greg Fischer
8020da3f18
Merge pull request #2788 from alelenv/iomapper_sr_fix
Skip auto decorating shader record buffer blocks with 'set' and 'binding'.
2021-10-20 16:28:11 -06:00
Greg Fischer
82b2668d58 Allow 8/16-bit integer as array index
Also enable 8/16 bit int capability in SPIR-V in such cases.

Also enable 64 bit capabilities when used in operations.

Fixes #2779
2021-10-20 15:15:30 -06:00
Greg Fischer
6639be7c2d Accept gl_ViewportMask in version 430 and later
Was previously accepted only in 450 or later.

Fixes #2785
2021-10-20 13:51:23 -06:00
alelenv
c571cd8f89 Skip auto decorating shader record buffer blocks with 'set' and
'binding'.
2021-10-19 20:59:35 -07:00
amhagan
035a3bbc4a GL_EXT_spirv_intrinsics - Port extensions
Add mechanism to use GL_EXT_spirv_intrinsics headers in glslang.
Ported GL_EXT_shader_realtime_clock as an example.
2021-10-15 14:13:08 -04:00
Rex Xu
07aec25f82 Make modifications of GL_EXT_spirv_intrinsics
1. spirv_execution_mode_id and spirv_decorate_id could support
   specialization constants. The original implementation always
   assume only normal frontend constants are valid. It is not true.

2. spirv_type donesn't support type_specifier as an option of
   spirv_type_parameter. At present, only constant_expression is the
   valid option.
2021-10-15 20:22:36 +08:00
Kevin McCullough
d3567231eb Fix cross-stage check to allow subsequent stage to use previous stage's binding 2021-10-13 14:57:06 -07:00
Greg Fischer
b9ba4c5743
Merge pull request #2770 from ncesario-lunarg/ncesario-cmake-endif
cmake: Remove "conditions" from endif
2021-10-07 12:33:37 -06:00
Nathaniel Cesario
c8ef4f8a9f cmake: Remove "conditions" from endif
See https://cmake.org/cmake/help/latest/command/endif.html and
https://cmake.org/cmake/help/latest/command/if.html.

If the else/endif condition does not match the if condition verbatim,
an error is produced on some versions of cmake. This change removes
these "legacy conditions."
2021-09-30 11:00:09 -06:00
Malcolm Bechard
7b57c6e32a rename member variable for clarity
it's a little strange how the resolver takes an arbitrary intermediate
in it's constructor. Really this should be an 'options' object that
holds the various resolve/remapping options which are read from this
intermediate.
At least for now rename it so it's more clear it's used differently from
other intermediates that are accessed in the resolver (such as the per
stage ones).
2021-09-29 15:31:28 -04:00
Greg Fischer
994987bc90 Fix variable scoping of do-while
Fixes #2744
2021-09-24 10:48:52 -06:00
Malcolm Bechard
3f04389a18
Auto push constant blocks (#2764)
* add ability to upgrade uniform block to push constants assuming it fits within the size limit imposed by the caller
* allow selecting the packing for the auto push constants
* check the size using the potential layout packing of the push constants
2021-09-22 11:41:10 -06:00
Greg Fischer
c2604615f4
Merge pull request #2685 from kevin-mccullough/FixIsIoResizeArrayTesselationStageHandling
Fix isIoResizeArray() tessellation stage handling
2021-09-21 16:29:30 -06:00
Greg Fischer
8b87b84001 Fix SPIR-V for SampleBias
Fixes #2757
2021-09-17 17:22:39 -06:00
Greg Fischer
0f886fe7d3
Merge pull request #2759 from mbechard/vkRelaxed-RetargetID
GL_EXT_vulkan_glsl_relaxed - retarget gl_VertexID to gl_VertexIndex
2021-09-17 13:58:48 -06:00
Malcolm Bechard
05794b46a7 GL_EXT_vulkan_glsl_relaxed - retarget gl_VertexID to gl_VertexIndex
instead of allowing for multiple declarations of the variable in the
resulting SPIR-V, instead use a retargeted mechanism to cause references
to gl_VertexID and gl_InstanceID to use the gl_VertexIndex and
gl_InstanceIndex symbol.
2021-09-16 17:40:49 -04:00
Malcolm Bechard
d3bff63cae avoid growing the global uniform block with duplicates
When using GL_EXT_vulkan_glsl_relaxed, check to see if a
uniform already exists in the block uniform block, and if so,
ensure they are the same type. Otherwise, avoid growing the block
with a duplicate.
2021-09-15 23:39:02 -04:00
Greg Fischer
80dcc36907
Merge pull request #2745 from jeremy-lunarg/hayes-fix-warnings
Fix GCC warnings
2021-09-15 11:09:14 -06:00
Greg Fischer
14943d4e7d
Merge pull request #2752 from InsertAReallyCreativeNameHere/master
Change MINGW_HAS_SECURE_API checks.
2021-09-15 10:57:44 -06:00
Greg Fischer
62ed14518f Run update_precision() on array and matrix constructors. 2021-09-14 12:17:58 -06:00