There was a race condition in this function as it used a static variable
to attempt to ensure global initialization was only done once, which was
not thread-safe. Instead, use std::call_once, which was added to C++11
for this exact case.
Fixes#342
Previously, spirv_type doesn't accept type specifier as its parameter.
With this change, we can input non-array type specifier. This is because
some SPIR-V type definition intructions often need to reference other
SPIR-V types as its source operands. We add the support to facilitate
such usage.
From the command line, the debug options "stack", with -gVS enabling all
of generateDebugInfo, emitNonSemanticShaderDebugInfo and
emitNonSemanticShaderDebugSource, however the programmatic interface
allows setting the latter options without the former. In this case, the
string corresponding to the source filename never gets emitted and some
debuginfo instructions end up with zero ID operands, resulting in
invalid SPIR-V.
Fixes#3240
The `function` parameter is only used by an assert currently, so mark
it as "maybe unused". Alternatively the parameter could be removed,
but avoid such API churn for now.
The FindPythonInterp and FindPythonLibs modules, which have
been deprecated since CMake 3.12, have been removed by policy
CMP0148. Port projects to FindPython3, FindPython2, or FindPython.
The containsPhysicalStorageBufferOrArray function now handles struct
types correctly, checking their contents recursively for buffer
reference types. As a result, OpVariables containing structs that have
members that are buffer references now have the appropriate
AliasedPointer or RestrictPointer decoration as per the spec.
Fixes#3188
The VS2015 bazel test has been stopped, so we can not remove the config
file. We have the windows-msvc-2019-release-bazel to replace it. It is
already running, and it is passing.
The `windows-msvc-2015-release-bazel` build config name is misleading.
It now runs VS2019. We should rename it. This is the first part: create
the new config files.
While trying to set a default for CMAKE_INSTALL_PREFIX sounds
appealing it has multiple issues.
It's particularly problematic for open source projects where
many users try to accomplish many different things.
It's also conflicting with the new way of installing with cmake
IE: `cmake --install build --prefix build/install`
I've already removed similar logic in various other Khronos
repositories a while ago to address similar complaints.
closes#1015
This is no longer needed with modern CMake.
I've already removed this from several Khronos repos.
See this stackoverflow for modern approaches to setting ccache via cmake:
https://stackoverflow.com/a/74120112/19739129
On QNX, pthread APIs are provided as part of libc and a separate pthread
library does not exist.
This change updates the makefile of glslang to not link with pthread on
QNX, thereby enabling glslang to be built for QNX platforms.
OpenBSD does not link shared libs against libc so it is expected
that the use of --no-undefined when linking will fail.
Also garbage collect CMAKE_VERSION check while here, as requested, since
the minimum version is already 3.14.
Vertex shaders can have pipeline inputs that are arrays, but not structure
inputs. (GLSL 4.5 section 4.3.4)
But the error message for struct inputs says "cannot be a structure or array".
This PR removes the "or array" part.
Note: The array case is handled immediately after the check for
structure type.
Co-authored-by: Arcady Goldmints-Orlov <arcady@lunarg.com>