Commit graph

962 commits

Author SHA1 Message Date
Kai Angulo
ee04ba0786 feat: add option to map unused uniforms 2024-10-28 00:05:51 -07:00
Kai Angulo
5aa896ae05 feat: add missing c++ API functions to C API
add glslang_shader_add_source_text()
add glslang_shader_set_source_file()
add GLSLANG_SHADER_HLSL_IO_MAPPING
add GLSLANG_SHADER_HLSL_FLATTEN_UNIFORM_ARRAYS
2024-10-27 23:57:59 -07:00
Kai Angulo
8838252618 refactor: move invert Y from glslang_input_t to shader_set_options 2024-10-27 23:41:51 -07:00
Kai Angulo
da82563c92 feat: add hlsl_functionality_1 to c interface options 2024-10-25 02:18:04 -07:00
Kai Angulo
413a51ee6d build: update glslang to latest version 2024-10-23 23:26:46 -07:00
Kai Angulo
0ecaf43ec6 fix: switch bool to int in glslang C interface 2024-10-22 23:39:48 -07:00
Daniel Story
05559a2963 Implement optional link-time cross stage optimization 2024-10-08 15:02:14 -04:00
Malcolm Bechard
4a9f088915 a few more tweaks for #3681
expose TIoMapper::setAutoPushConstantBlock()
add overload for MapToSpirvToolsEnv() that takes TIntermediate instead of SpvVersion.
2024-09-25 11:17:35 -04:00
Arcady Goldmints-Orlov
ec7e23f458 Final round of symbol visibility fixes
This change adds GLSLANG_EXPORT in a couple more places, as well as
adding a new symbol visibility annotation GLSLANG_EXPORT_FOR_TESTS which
is defined the same as GLSLANG_EXPORT but documents the intention that
the symbols marked with it are only meant to be used by glslang's test
suite and do not form part of the public API and are thus not subject to
ABI stability guarantees.
2024-09-19 17:26:52 -04:00
Andrei Alexeyev
9213cbd310 Expose setResourceSetBinding() method to the C API 2024-09-17 10:56:10 -06:00
Qingyuan Zheng
a496a34b43 Sanitize debug source location tracking for implicit branch and return
This patch tries to attach debug location of a branch/return instruction to its predecessor or the closing brace. If none could be found, no debug info should be emitted.
2024-09-02 14:20:19 -04:00
Arcady Goldmints-Orlov
9e8dff7d42 Move definition of GLSLANG_EXPORT to visibility.h
The GLSLANG_EXPORT macro is already used (and defined) in two separate
places and will be used in a few more in the near future. To reduce
duplication it is now in its own header.
2024-08-22 17:43:41 -04:00
Arcady Goldmints-Orlov
5398d55e33 Remove execute permissions from source files. 2024-08-06 14:42:01 -06:00
Malcolm Bechard
8590f62c14 add optimizerAllowExpandedIDBound to SpvOptions
This option increases the max_id_bound in the optimizer to 0x3FFFFFFF, and then runs a
compact-id pass if the final result has a max_id greater than the standard limit of 0x3FFFFF.
2024-07-30 21:49:42 -04:00
Steve Urquhart
3c7b12c643 Add C interface types and functions for IO mapping 2024-07-24 18:46:04 -04:00
Steve Urquhart
10a923f740 Add C interface function to set preprocessed shader code 2024-07-24 18:46:04 -04:00
Steve Urquhart
42260d1f6d Add C interface glslang::Version counterpart and version getter function 2024-07-24 18:46:04 -04:00
Andrei Alexeyev
bedbe7481e Expose setGlobalUniform* methods to the C API 2024-07-23 18:26:25 -04:00
Antoine
dc9f6f61ad
Add column to location logs
This option can be enabled using the new --error-column option to the command line utility.
It can also be enabled programatically.
2024-07-19 18:37:58 -04:00
Antoine
7c40de7aa2 Auto-detect WASI platform 2024-06-28 11:00:54 -04:00
Kai Angulo
812c09ec9b Added dissasembler and extra options 2024-06-03 01:52:25 -07:00
Kai Angulo
f2f81cf089 Added entrypoints to c interface; exports for resource limits; minor additions to buildsystem. 2024-05-31 22:23:49 -07:00
Max Andersson
1cad045cc2 Make gl_HitT proper aliases of gl_RayTmax
Changes the gl_HitT builtins properly alias
their gl_RayTmax. Previously they ended up as
duplicate variables, rather than aliased.
2024-05-24 11:08:06 -07:00
Rex Xu
022aea431c
Fix issues of the interaction between cooperative_matrix and spirv_intrinsics
coopmat<> type definition allows type parameters. To make it accept
types defined by spirv_type directive, we add spirvType info to the type
parameters. This change is to support this case. And a test is added to
show the missing usage.
2024-03-21 11:09:00 -04:00
Wooyoung Kim
10ee92feb0
Support for SPV_QCOM_image_processing2 (#3539) 2024-03-20 18:56:00 -04:00
Sharo
d73712b8f6
Add flags for outputting absolute paths for messages (#3467)
Uses std::filesystem to create absolute paths.
Also adds "shaderFileName" to TSinkBase so it can be used during message
outputs.
2024-03-07 19:02:45 -05:00
Jeremy Hayes
e7d4ad91a9 Increase TStorageQualifier bitfield width
Fix #3538.

Visual Studio 2022 added a new warning to detect when enumerators can
not be represented within the given bit field width. This warning is
disabled by default but can be enabled using the flag /w15249. This PR
increases the width by one to accommodate the signed maximum value of
EvqLast, which is currently 32.

Perhaps a future improvement would be to use scoped enums; however,
that is more work as the typing is more strict and would require more
changes.
2024-03-07 12:27:21 -05:00
Jeff Bolz
114dae9114 Add a string 'StartsWith' helper function 2024-02-14 18:55:55 -05:00
Sven van Haastregt
9fd0fcd737 Add GL_EXT_expect_assume support
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-02-13 16:13:35 -08:00
Sven van Haastregt
b1f7affe94 Add GL_KHR_shader_subgroup_rotate support
Co-authored-by: Neil Hickey <neil.hickey@arm.com>
Co-authored-by: Stuart Brady <stuart.brady@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-02-06 11:04:16 -08:00
laddoc
725017a588 Support extension EXT_shader_quad_control 2024-01-30 16:28:38 -05:00
Arcady Goldmints-Orlov
e854c8de10 Remove various warning suppression pragmas
This requires a small change to to use strncpy() instead of strcpy(),
as well as change of include paths to not use "..". The other warnings
are just not being hit anymore.
2023-12-01 11:59:54 -05:00
Nathaniel Cesario
40394bf5c6 Fix conversion warnings related to bitfields
This fixes several GCC warnings about converting from signed integers to
signed bitfields.
2023-11-28 19:16:16 -05:00
Nathaniel Cesario
19d541a91d Fix some compiler warnings
This change primarily fixes some -Wconversion warnings from gcc, but
also silences a warning triggered in glslang_tab.cpp, which is generated
code from bison.

There are still several GCC conversion warnings in Types.h due to the
use of bit fields that will be resolved in a future change.
2023-11-28 19:16:16 -05:00
Arcady Goldmints-Orlov
f6cc939499 Remove custom implementations of isinf and isnan
Use the ones from the <cmath> header instead, now that that is available
on all the currently supported versions of MSVC.
2023-11-20 18:30:35 -05:00
Rex Xu
65f59c81e7 GL_EXT_spirv_intrinsics: Fix a typo in function naming
hasSprivDecorate => hasSpirvDecorate

Also, revise a comment.
2023-11-06 12:50:02 -05:00
alelenv
3f02132668
Add support for GL_NV_displacement_micromap.
* Add support for GL_NV_displacement_micromap.
* Update known_good for spirv-headers and spirv-tools.
2023-10-02 15:07:50 -04:00
Nathaniel Cesario
4c57db1595 Add --no-link option
Adds the --no-link option which outputs the compiled shader binaries
without linking them. This is a first step towards allowing users to
create SPIR-v binary, non-executable libraries.

When using the --no-link option, all functions are decorated with the
Export linkage attribute.
2023-09-18 17:31:05 -04:00
Rex Xu
323836e46b Use std::variant to represent TSpirvTypeParameter
This PR is try to address the review comment:
https://github.com/KhronosGroup/glslang/pull/3253#discussion_r1254932979.
2023-09-11 21:12:35 -04:00
Pedro Olsen Ferreira
adfcaba7ae Fix ODR violations
On a shared build, these symbols exist in both libglslang.so and
libSPIRV.so, leading to an ODR violation at runtime.
2023-08-24 12:48:35 -06:00
Wooyoung Kim
db8719ae07
extension: GL_QCOM_image_processing support 2023-08-21 18:14:52 -06:00
dan sinclair
d291b15911
Remove GLSLANG_WEB and GLSLANG_WEB_DEVEL
This CL removes the GLSLANG_WEB and GLSLANG_WEB_DEVEL
cmake build options and their usage in the codebase.

Issue #2958
2023-07-28 11:49:10 -06:00
Ben Clayton
775864ef74 Simplify PoolAlloc with use of thread_local.
glslang is using C++ 11, which has first class support for variables of the `thread_local` storage class.

By dropping the use of the `OS_[GS]etTLSValue`, we can simplify the logic, and have it support a thread-local default allocator if none is provided.

Issue: #2346
2023-07-26 18:11:41 -06:00
Boris Zanin
808c7ed17c Implement support for GL_KHR_cooperative_matrix extension 2023-07-26 16:39:17 -06:00
Rex Xu
051f18c0cc Spirv_intrinsics: Add support of type specifier to spirv_type
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.
2023-07-11 13:26:22 -04:00
Sven van Haastregt
4d95e22826 Fix -Wmaybe-uninitialized warnings
Fix some potentially uninitialized uses that are reported by GCC 13
with `-O3`.
2023-06-12 07:52:56 -07:00
rcombs
b587425025 glslang_c_interface: use valid C function prototypes
Prototypes are required in C.
2023-05-29 14:55:51 -06:00
Arcady Goldmints-Orlov
1e4955adbc Include <cstdint> header in Common.h
This change also cleans up some ifdef'd code for no longer supported
versions of MSVC.

Fixes: #3139
2023-05-15 14:06:02 -06:00
Johannes Kauffmann
d9c3c7538b Common.h: don't use to_string workaround on MSVC
Pre-VS2012 is no longer supported.

It might still be needed on Android, I haven't tested this.
2023-05-10 09:55:02 -06:00
Alexey Ozeritskiy
84d11c472a Use custom callbacks if they are available in 'i->callbacks' 2023-05-09 10:38:08 -06:00