sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (8c91dc3c5e3fdeedb5af562f252deffce0210f10)
- From: Pavel Vinogradov <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (8c91dc3c5e3fdeedb5af562f252deffce0210f10)
- Date: Sun, 1 Jun 2025 05:17:15 +0000
GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:
vulkan/shaderc/DETAILS
| 5
vulkan/shaderc/HISTORY
| 3
vulkan/spirv-headers/DETAILS
| 4
vulkan/spirv-headers/HISTORY
| 3
vulkan/spirv-tools/DETAILS
| 5
vulkan/spirv-tools/HISTORY
| 7
vulkan/spirv-tools/PRE_BUILD
| 4
vulkan/spirv-tools/patches/0001-linker-run-dedup-earlier.patch
| 50 -
vulkan/spirv-tools/patches/0002-spirv-link-allow-linking-functions.patch
| 290 ------
vulkan/spirv-tools/patches/0003-test-linker-add-tests-to-test-the-AllowPtrTypeMismatch-feature.patch
| 434 ----------
10 files changed, 20 insertions(+), 785 deletions(-)
New commits:
commit 8c91dc3c5e3fdeedb5af562f252deffce0210f10
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
vulkan/shaderc: version 2025.2
commit 348fdaf81a931a711e29512198228f0361723ea0
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
vulkan/spirv-tools: version 2025.1
commit ce7f4de5944f7a4cf24128502667db60872f123e
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
vulkan/spirv-headers: version 1.4.313.0
diff --git a/vulkan/shaderc/DETAILS b/vulkan/shaderc/DETAILS
index 7cfb3ef..b243aad 100755
--- a/vulkan/shaderc/DETAILS
+++ b/vulkan/shaderc/DETAILS
@@ -1,10 +1,11 @@
. "${GRIMOIRE}/CMAKE_FUNCTIONS"
SPELL=shaderc
- VERSION=2023.8
+ VERSION=2025.2
+
SOURCE_HASH=sha512:6761372591075944fddd926e9f7c2ea9447496566d2d549f523c6c529c3bd753d459b66d499f76d955bdcfb335016daddbeba49b087f4ecabf37d76a46ac14cd
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
SOURCE_URL[0]=https://github.com/google/${SPELL}/archive/v${VERSION}.tar.gz
-
SOURCE_HASH=sha512:2a5e59a2bb6c4b5462758d824747fee0edaf177dc64f30fe698fd2d2cc21cddab1a19ec2b2d63bd3d2e209330a13519f399395398379370b15daa39e6ee6b2bf
+# Watch: https://github.com/google/shaderc/tags/ tags/v([0-9.]+)[.]tar
LICENSE[0]=APACHE
WEB_SITE=https://github.com/google/shaderc/
ENTERED=20240116
diff --git a/vulkan/shaderc/HISTORY b/vulkan/shaderc/HISTORY
index f9cd55e..cc63d81 100644
--- a/vulkan/shaderc/HISTORY
+++ b/vulkan/shaderc/HISTORY
@@ -1,3 +1,6 @@
+2025-05-31 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 2025.2, added Watch line
+
2024-01-16 Conner Clere <xenanthropy AT sourcemage.org>
* BUILD, PRE_BUILD, CONFIGURE, DEPENDS, DETAILS: version 2023.8, new
spell
diff --git a/vulkan/spirv-headers/DETAILS b/vulkan/spirv-headers/DETAILS
index 588ec0f..7e70558 100755
--- a/vulkan/spirv-headers/DETAILS
+++ b/vulkan/spirv-headers/DETAILS
@@ -1,7 +1,7 @@
SPELL=spirv-headers
SPELLX=SPIRV-Headers
- VERSION=1.3.290.0
-
SOURCE_HASH="sha512:d3328cd4ddf87d075afacfb7ada01dbd16a3ff39b831e9ebe4ce3c32af0ff0c8822811b0e0d273a54b4acaba29b63b099efcf0150424bd9074d24d04a9974d89"
+ VERSION=1.4.313.0
+
SOURCE_HASH="sha512:c89b7992d8bdf956b551b3efa0fe67135574379973be446d18d215b4868799a3f5dab3002d230ccc54d723391ee37240cf0f2cd394898326d40685cbec673670"
SOURCE="${SPELL}-sdk-${VERSION}.tar.gz"
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELLX}-vulkan-sdk-${VERSION}"
WEB_SITE="https://github.com/KhronosGroup/$SPELLX"
diff --git a/vulkan/spirv-headers/HISTORY b/vulkan/spirv-headers/HISTORY
index 90b1e3a..0639e21 100644
--- a/vulkan/spirv-headers/HISTORY
+++ b/vulkan/spirv-headers/HISTORY
@@ -1,3 +1,6 @@
+2025-05-31 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 1.4.313.0
+
2025-01-17 Justin Boffemmyer <flux AT sourcemage.org>
* DETAILS: version 1.3.290.0
diff --git a/vulkan/spirv-tools/DETAILS b/vulkan/spirv-tools/DETAILS
index 27cde56..cb7dc88 100755
--- a/vulkan/spirv-tools/DETAILS
+++ b/vulkan/spirv-tools/DETAILS
@@ -1,8 +1,7 @@
SPELL=spirv-tools
SPELLX=SPIRV-Tools
- VERSION=2024.3
- PATCHLEVEL=1
-
SOURCE_HASH="sha512:804e2a076025a9afde2d7b0b6950fa7b7289b9aa911348b10aad45cc3515116b7484e886d49b524315f75e8d1a2009c2f26310352c154d1b23a58864e8535324"
+ VERSION=2025.1
+
SOURCE_HASH="sha512:8b2da6d38324a9cbb1a3471f30025a000f3ec77f351b2e3bf779ce99b8e03e1e8425b12f5318df1487dc3d27631f0e71b251adf9835252e1283cf472f96840c7"
SOURCE="$SPELL-$VERSION.tar.gz"
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELLX}-${VERSION}"
WEB_SITE="https://github.com/KhronosGroup/$SPELLX"
diff --git a/vulkan/spirv-tools/HISTORY b/vulkan/spirv-tools/HISTORY
index 5c46973..4183018 100644
--- a/vulkan/spirv-tools/HISTORY
+++ b/vulkan/spirv-tools/HISTORY
@@ -1,3 +1,10 @@
+2025-06-01 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 2025.1
+ * PRE_BUILD, patches/0001-linker-run-dedup-earlier.patch,
+ patches/0002-spirv-link-allow-linking-functions.patch,
+
patches/0003-test-linker-add-tests-to-test-the-AllowPtrTypeMismatch-feature.patch:
+ removed, applied in upstream
+
2025-02-24 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: PATCHLEVEL++
* PRE_BUILD, patches/0001-linker-run-dedup-earlier.patch,
diff --git a/vulkan/spirv-tools/PRE_BUILD b/vulkan/spirv-tools/PRE_BUILD
deleted file mode 100755
index 6c5c8c9..0000000
--- a/vulkan/spirv-tools/PRE_BUILD
+++ /dev/null
@@ -1,4 +0,0 @@
-default_pre_build &&
-cd "${SOURCE_DIRECTORY}" &&
-
-apply_patch_dir "patches"
diff --git a/vulkan/spirv-tools/patches/0001-linker-run-dedup-earlier.patch
b/vulkan/spirv-tools/patches/0001-linker-run-dedup-earlier.patch
deleted file mode 100644
index 48b9751..0000000
--- a/vulkan/spirv-tools/patches/0001-linker-run-dedup-earlier.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 4db0a60368a854542fc6800342acf0ea175dc901 Mon Sep 17 00:00:00 2001
-From: Karol Herbst <kherbst AT redhat.com>
-Date: Wed, 3 Jul 2024 19:50:45 +0200
-Subject: [PATCH] linker: run dedup earlier
-
-Otherwise `linkings_to_do` might end up with stale IDs.
----
- source/link/linker.cpp | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/source/link/linker.cpp b/source/link/linker.cpp
-index 58930e452e..9e6520eaa8 100644
---- a/source/link/linker.cpp
-+++ b/source/link/linker.cpp
-@@ -773,7 +773,14 @@ spv_result_t Link(const Context& context, const
uint32_t* const* binaries,
- if (res != SPV_SUCCESS) return res;
- }
-
-- // Phase 4: Find the import/export pairs
-+ // Phase 4: Remove duplicates
-+ PassManager manager;
-+ manager.SetMessageConsumer(consumer);
-+ manager.AddPass<RemoveDuplicatesPass>();
-+ opt::Pass::Status pass_res = manager.Run(&linked_context);
-+ if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
-+
-+ // Phase 5: Find the import/export pairs
- LinkageTable linkings_to_do;
- res = GetImportExportPairs(consumer, linked_context,
- *linked_context.get_def_use_mgr(),
-@@ -781,18 +788,11 @@ spv_result_t Link(const Context& context, const
uint32_t* const* binaries,
- options.GetAllowPartialLinkage(),
&linkings_to_do);
- if (res != SPV_SUCCESS) return res;
-
-- // Phase 5: Ensure the import and export have the same types and
decorations.
-+ // Phase 6: Ensure the import and export have the same types and
decorations.
- res =
- CheckImportExportCompatibility(consumer, linkings_to_do,
&linked_context);
- if (res != SPV_SUCCESS) return res;
-
-- // Phase 6: Remove duplicates
-- PassManager manager;
-- manager.SetMessageConsumer(consumer);
-- manager.AddPass<RemoveDuplicatesPass>();
-- opt::Pass::Status pass_res = manager.Run(&linked_context);
-- if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
--
- // Phase 7: Remove all names and decorations of import variables/functions
- for (const auto& linking_entry : linkings_to_do) {
- linked_context.KillNamesAndDecorates(linking_entry.imported_symbol.id);
diff --git
a/vulkan/spirv-tools/patches/0002-spirv-link-allow-linking-functions.patch
b/vulkan/spirv-tools/patches/0002-spirv-link-allow-linking-functions.patch
deleted file mode 100644
index 4afaf87..0000000
--- a/vulkan/spirv-tools/patches/0002-spirv-link-allow-linking-functions.patch
+++ /dev/null
@@ -1,290 +0,0 @@
-From f72b6cc7ca65ec9e017094ab908eb02a4a18cf65 Mon Sep 17 00:00:00 2001
-From: Karol Herbst <kherbst AT redhat.com>
-Date: Wed, 17 Jan 2024 16:17:10 +0100
-Subject: [PATCH] linker: allow linking functions with different pointer
- arguments
-
-Since llvm-17 there are no typed pointers and hte SPIRV-LLVM-Translator
-doesn't know the function signature of imported functions.
-
-I'm investigating different ways of solving this problem and adding an
-option to work around it inside `spirv-link` is one of those.
-
-The code is almost complete, just I'm having troubles constructing the
-bitcast to cast the pointer parameters to the final type.
-
-Closes: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2153
----
- include/spirv-tools/linker.hpp | 7 ++-
- source/link/linker.cpp | 105 ++++++++++++++++++++++++++++++---
- tools/link/linker.cpp | 24 +++++---
- 3 files changed, 119 insertions(+), 17 deletions(-)
-
-diff --git a/include/spirv-tools/linker.hpp b/include/spirv-tools/linker.hpp
-index 6ba6e9654a..9037b94889 100644
---- a/include/spirv-tools/linker.hpp
-+++ b/include/spirv-tools/linker.hpp
-@@ -16,7 +16,6 @@
- #define INCLUDE_SPIRV_TOOLS_LINKER_HPP_
-
- #include <cstdint>
--
- #include <memory>
- #include <vector>
-
-@@ -63,11 +62,17 @@ class SPIRV_TOOLS_EXPORT LinkerOptions {
- use_highest_version_ = use_highest_vers;
- }
-
-+ bool GetAllowPtrTypeMismatch() const { return allow_ptr_type_mismatch_; }
-+ void SetAllowPtrTypeMismatch(bool allow_ptr_type_mismatch) {
-+ allow_ptr_type_mismatch_ = allow_ptr_type_mismatch;
-+ }
-+
- private:
- bool create_library_{false};
- bool verify_ids_{false};
- bool allow_partial_linkage_{false};
- bool use_highest_version_{false};
-+ bool allow_ptr_type_mismatch_{false};
- };
-
- // Links one or more SPIR-V modules into a new SPIR-V module. That is,
combine
-diff --git a/source/link/linker.cpp b/source/link/linker.cpp
-index 9e6520eaa8..e6aa72e32c 100644
---- a/source/link/linker.cpp
-+++ b/source/link/linker.cpp
-@@ -31,6 +31,7 @@
- #include "source/opt/build_module.h"
- #include "source/opt/compact_ids_pass.h"
- #include "source/opt/decoration_manager.h"
-+#include "source/opt/ir_builder.h"
- #include "source/opt/ir_loader.h"
- #include "source/opt/pass_manager.h"
- #include "source/opt/remove_duplicates_pass.h"
-@@ -46,12 +47,14 @@ namespace spvtools {
- namespace {
-
- using opt::Instruction;
-+using opt::InstructionBuilder;
- using opt::IRContext;
- using opt::Module;
- using opt::PassManager;
- using opt::RemoveDuplicatesPass;
- using opt::analysis::DecorationManager;
- using opt::analysis::DefUseManager;
-+using opt::analysis::Function;
- using opt::analysis::Type;
- using opt::analysis::TypeManager;
-
-@@ -126,6 +129,7 @@ spv_result_t GetImportExportPairs(const MessageConsumer&
consumer,
- // checked.
- spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer,
- const LinkageTable&
linkings_to_do,
-+ bool allow_ptr_type_mismatch,
- opt::IRContext* context);
-
- // Remove linkage specific instructions, such as prototypes of imported
-@@ -502,6 +506,7 @@ spv_result_t GetImportExportPairs(const MessageConsumer&
consumer,
-
- spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer,
- const LinkageTable&
linkings_to_do,
-+ bool allow_ptr_type_mismatch,
- opt::IRContext* context) {
- spv_position_t position = {};
-
-@@ -513,7 +518,34 @@ spv_result_t CheckImportExportCompatibility(const
MessageConsumer& consumer,
- type_manager.GetType(linking_entry.imported_symbol.type_id);
- Type* exported_symbol_type =
- type_manager.GetType(linking_entry.exported_symbol.type_id);
-- if (!(*imported_symbol_type == *exported_symbol_type))
-+ if (!(*imported_symbol_type == *exported_symbol_type)) {
-+ Function* imported_symbol_type_func =
imported_symbol_type->AsFunction();
-+ Function* exported_symbol_type_func =
exported_symbol_type->AsFunction();
-+
-+ if (imported_symbol_type_func && exported_symbol_type_func) {
-+ const auto& imported_params =
imported_symbol_type_func->param_types();
-+ const auto& exported_params =
exported_symbol_type_func->param_types();
-+ // allow_ptr_type_mismatch allows linking functions where the
pointer
-+ // type of arguments doesn't match. Everything else still needs to
be
-+ // equal. This is to workaround LLVM-17+ not having typed pointers
and
-+ // generated SPIR-Vs not knowing the actual pointer types in some
cases.
-+ if (allow_ptr_type_mismatch &&
-+ imported_params.size() == exported_params.size()) {
-+ bool correct = true;
-+ for (size_t i = 0; i < imported_params.size(); i++) {
-+ const auto& imported_param = imported_params[i];
-+ const auto& exported_param = exported_params[i];
-+
-+ if (!imported_param->IsSame(exported_param) &&
-+ (imported_param->kind() != Type::kPointer ||
-+ exported_param->kind() != Type::kPointer)) {
-+ correct = false;
-+ break;
-+ }
-+ }
-+ if (correct) continue;
-+ }
-+ }
- return DiagnosticStream(position, consumer, "",
SPV_ERROR_INVALID_BINARY)
- << "Type mismatch on symbol \""
- << linking_entry.imported_symbol.name
-@@ -521,6 +553,7 @@ spv_result_t CheckImportExportCompatibility(const
MessageConsumer& consumer,
- << linking_entry.imported_symbol.id
- << " and exported variable/function %"
- << linking_entry.exported_symbol.id << ".";
-+ }
- }
-
- // Ensure the import and export decorations are similar
-@@ -696,6 +729,57 @@ spv_result_t VerifyLimits(const MessageConsumer&
consumer,
- return SPV_SUCCESS;
- }
-
-+spv_result_t FixFunctionCallTypes(opt::IRContext& context,
-+ const LinkageTable& linkings) {
-+ auto mod = context.module();
-+ const auto type_manager = context.get_type_mgr();
-+ const auto def_use_mgr = context.get_def_use_mgr();
-+
-+ for (auto& func : *mod) {
-+ func.ForEachInst([&](Instruction* inst) {
-+ if (inst->opcode() != spv::Op::OpFunctionCall) return;
-+ opt::Operand& target = inst->GetInOperand(0);
-+
-+ // only fix calls to imported functions
-+ auto linking = std::find_if(
-+ linkings.begin(), linkings.end(), [&](const auto& entry) {
-+ return entry.exported_symbol.id == target.AsId();
-+ });
-+ if (linking == linkings.end()) return;
-+
-+ auto builder = InstructionBuilder(&context, inst);
-+ for (uint32_t i = 1; i < inst->NumInOperands(); ++i) {
-+ auto exported_func_param =
-+ def_use_mgr->GetDef(linking->exported_symbol.parameter_ids[i -
1]);
-+ const Type* target_type =
-+ type_manager->GetType(exported_func_param->type_id());
-+ if (target_type->kind() != Type::kPointer) continue;
-+
-+ opt::Operand& arg = inst->GetInOperand(i);
-+ const Type* param_type =
-+
type_manager->GetType(def_use_mgr->GetDef(arg.AsId())->type_id());
-+
-+ // No need to cast if it already matches
-+ if (*param_type == *target_type) continue;
-+
-+ auto new_id = context.TakeNextId();
-+
-+ // cast to the expected pointer type
-+ builder.AddInstruction(MakeUnique<opt::Instruction>(
-+ &context, spv::Op::OpBitcast, exported_func_param->type_id(),
-+ new_id,
-+ opt::Instruction::OperandList(
-+ {{SPV_OPERAND_TYPE_ID, {arg.AsId()}}})));
-+
-+ inst->SetInOperand(i, {new_id});
-+ }
-+ });
-+ }
-+ context.InvalidateAnalyses(opt::IRContext::kAnalysisDefUse |
-+ opt::IRContext::kAnalysisInstrToBlockMapping);
-+ return SPV_SUCCESS;
-+}
-+
- } // namespace
-
- spv_result_t Link(const Context& context,
-@@ -789,8 +873,9 @@ spv_result_t Link(const Context& context, const
uint32_t* const* binaries,
- if (res != SPV_SUCCESS) return res;
-
- // Phase 6: Ensure the import and export have the same types and
decorations.
-- res =
-- CheckImportExportCompatibility(consumer, linkings_to_do,
&linked_context);
-+ res = CheckImportExportCompatibility(consumer, linkings_to_do,
-+ options.GetAllowPtrTypeMismatch(),
-+ &linked_context);
- if (res != SPV_SUCCESS) return res;
-
- // Phase 7: Remove all names and decorations of import variables/functions
-@@ -815,21 +900,27 @@ spv_result_t Link(const Context& context, const
uint32_t* const* binaries,
- &linked_context);
- if (res != SPV_SUCCESS) return res;
-
-- // Phase 10: Compact the IDs used in the module
-+ // Phase 10: Optionally fix function call types
-+ if (options.GetAllowPtrTypeMismatch()) {
-+ res = FixFunctionCallTypes(linked_context, linkings_to_do);
-+ if (res != SPV_SUCCESS) return res;
-+ }
-+
-+ // Phase 11: Compact the IDs used in the module
- manager.AddPass<opt::CompactIdsPass>();
- pass_res = manager.Run(&linked_context);
- if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
-
-- // Phase 11: Recompute EntryPoint variables
-+ // Phase 12: Recompute EntryPoint variables
- manager.AddPass<opt::RemoveUnusedInterfaceVariablesPass>();
- pass_res = manager.Run(&linked_context);
- if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
-
-- // Phase 12: Warn if SPIR-V limits were exceeded
-+ // Phase 13: Warn if SPIR-V limits were exceeded
- res = VerifyLimits(consumer, linked_context);
- if (res != SPV_SUCCESS) return res;
-
-- // Phase 13: Output the module
-+ // Phase 14: Output the module
- linked_context.module()->ToBinary(linked_binary, true);
-
- return SPV_SUCCESS;
-diff --git a/tools/link/linker.cpp b/tools/link/linker.cpp
-index f3898aab0d..7dbd8596fa 100644
---- a/tools/link/linker.cpp
-+++ b/tools/link/linker.cpp
-@@ -48,6 +48,10 @@ Options (in lexicographical order):
- --allow-partial-linkage
- Allow partial linkage by accepting imported symbols to be
- unresolved.
-+ --allow-pointer-mismatch
-+ Allow pointer function parameters to mismatch the target link
-+ target. This is useful to workaround lost correct parameter
type
-+ information due to LLVM's opaque pointers.
- --create-library
- Link the binaries into a library, keeping all exported
symbols.
- -h, --help
-@@ -77,15 +81,16 @@ Options (in lexicographical order):
- } // namespace
-
- // clang-format off
--FLAG_SHORT_bool( h, /* default_value= */ false,
/* required= */ false);
--FLAG_LONG_bool( help, /* default_value= */ false,
/* required= */false);
--FLAG_LONG_bool( version, /* default_value= */ false,
/* required= */ false);
--FLAG_LONG_bool( verify_ids, /* default_value= */ false,
/* required= */ false);
--FLAG_LONG_bool( create_library, /* default_value= */ false,
/* required= */ false);
--FLAG_LONG_bool( allow_partial_linkage, /* default_value= */ false,
/* required= */ false);
--FLAG_SHORT_string(o, /* default_value= */ "",
/* required= */ false);
--FLAG_LONG_string( target_env, /* default_value= */
kDefaultEnvironment, /* required= */ false);
--FLAG_LONG_bool( use_highest_version, /* default_value= */ false,
/* required= */ false);
-+FLAG_SHORT_bool( h, /* default_value= */ false,
/* required= */ false);
-+FLAG_LONG_bool( help, /* default_value= */ false,
/* required= */ false);
-+FLAG_LONG_bool( version, /* default_value= */ false,
/* required= */ false);
-+FLAG_LONG_bool( verify_ids, /* default_value= */ false,
/* required= */ false);
-+FLAG_LONG_bool( create_library, /* default_value= */ false,
/* required= */ false);
-+FLAG_LONG_bool( allow_partial_linkage, /* default_value= */ false,
/* required= */ false);
-+FLAG_LONG_bool( allow_pointer_mismatch, /* default_value= */ false,
/* required= */ false);
-+FLAG_SHORT_string(o, /* default_value= */ "",
/* required= */ false);
-+FLAG_LONG_string( target_env, /* default_value= */
kDefaultEnvironment, /* required= */ false);
-+FLAG_LONG_bool( use_highest_version, /* default_value= */ false,
/* required= */ false);
- // clang-format on
-
- int main(int, const char* argv[]) {
-@@ -126,6 +131,7 @@ int main(int, const char* argv[]) {
-
- spvtools::LinkerOptions options;
- options.SetAllowPartialLinkage(flags::allow_partial_linkage.value());
-+ options.SetAllowPtrTypeMismatch(flags::allow_pointer_mismatch.value());
- options.SetCreateLibrary(flags::create_library.value());
- options.SetVerifyIds(flags::verify_ids.value());
- options.SetUseHighestVersion(flags::use_highest_version.value());
diff --git
a/vulkan/spirv-tools/patches/0003-test-linker-add-tests-to-test-the-AllowPtrTypeMismatch-feature.patch
b/vulkan/spirv-tools/patches/0003-test-linker-add-tests-to-test-the-AllowPtrTypeMismatch-feature.patch
deleted file mode 100644
index cc9639f..0000000
---
a/vulkan/spirv-tools/patches/0003-test-linker-add-tests-to-test-the-AllowPtrTypeMismatch-feature.patch
+++ /dev/null
@@ -1,434 +0,0 @@
-From 6a0d3b836cd09d771204cfc13c076b4fe9764ae3 Mon Sep 17 00:00:00 2001
-From: Karol Herbst <kherbst AT redhat.com>
-Date: Thu, 11 Jul 2024 11:54:13 +0200
-Subject: [PATCH] test/linker: add tests to test the AllowPtrTypeMismatch
- feature
-
----
- .../link/matching_imports_to_exports_test.cpp | 393 +++++++++++++++++-
- 1 file changed, 370 insertions(+), 23 deletions(-)
-
-diff --git a/test/link/matching_imports_to_exports_test.cpp
b/test/link/matching_imports_to_exports_test.cpp
-index 6b02fc46dd..c7c962fa20 100644
---- a/test/link/matching_imports_to_exports_test.cpp
-+++ b/test/link/matching_imports_to_exports_test.cpp
-@@ -174,14 +174,18 @@ OpDecorate %1 LinkageAttributes "foo" Export
- %1 = OpVariable %2 Uniform %3
- )";
-
-- spvtest::Binary linked_binary;
-- EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
-- AssembleAndLink({body1, body2}, &linked_binary))
-- << GetErrorMessage();
-- EXPECT_THAT(
-- GetErrorMessage(),
-- HasSubstr("Type mismatch on symbol \"foo\" between imported "
-- "variable/function %1 and exported variable/function %4"));
-+ LinkerOptions options;
-+ for (int i = 0; i < 2; i++) {
-+ spvtest::Binary linked_binary;
-+ options.SetAllowPtrTypeMismatch(i == 1);
-+ EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
-+ AssembleAndLink({body1, body2}, &linked_binary))
-+ << GetErrorMessage();
-+ EXPECT_THAT(
-+ GetErrorMessage(),
-+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
-+ "variable/function %1 and exported variable/function
%4"));
-+ }
- }
-
- TEST_F(MatchingImportsToExports, MultipleDefinitions) {
-@@ -216,13 +220,17 @@ OpDecorate %1 LinkageAttributes "foo" Export
- %1 = OpVariable %2 Uniform %3
- )";
-
-- spvtest::Binary linked_binary;
-- EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
-- AssembleAndLink({body1, body2, body3}, &linked_binary))
-- << GetErrorMessage();
-- EXPECT_THAT(GetErrorMessage(),
-- HasSubstr("Too many external references, 2, were found "
-- "for \"foo\"."));
-+ LinkerOptions options;
-+ for (int i = 0; i < 2; i++) {
-+ spvtest::Binary linked_binary;
-+ options.SetAllowPtrTypeMismatch(i == 1);
-+ EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
-+ AssembleAndLink({body1, body2, body3}, &linked_binary))
-+ << GetErrorMessage();
-+ EXPECT_THAT(GetErrorMessage(),
-+ HasSubstr("Too many external references, 2, were found "
-+ "for \"foo\"."));
-+ }
- }
-
- TEST_F(MatchingImportsToExports, SameNameDifferentTypes) {
-@@ -289,14 +297,18 @@ OpDecorate %1 LinkageAttributes "foo" Export
- %1 = OpVariable %2 Uniform %3
- )";
-
-- spvtest::Binary linked_binary;
-- EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
-- AssembleAndLink({body1, body2}, &linked_binary))
-- << GetErrorMessage();
-- EXPECT_THAT(
-- GetErrorMessage(),
-- HasSubstr("Type mismatch on symbol \"foo\" between imported "
-- "variable/function %1 and exported variable/function %4"));
-+ LinkerOptions options;
-+ for (int i = 0; i < 2; i++) {
-+ spvtest::Binary linked_binary;
-+ options.SetAllowPtrTypeMismatch(i == 1);
-+ EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
-+ AssembleAndLink({body1, body2}, &linked_binary))
-+ << GetErrorMessage();
-+ EXPECT_THAT(
-+ GetErrorMessage(),
-+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
-+ "variable/function %1 and exported variable/function
%4"));
-+ }
- }
-
- TEST_F(MatchingImportsToExports,
-@@ -557,5 +569,340 @@ OpFunctionEnd
- EXPECT_EQ(expected_res, res_body);
- }
-
-+TEST_F(MatchingImportsToExports, FunctionCall) {
-+ const std::string body1 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %3 "param"
-+OpDecorate %1 LinkageAttributes "foo" Import
-+ %5 = OpTypeVoid
-+ %6 = OpTypeInt 32 0
-+ %9 = OpTypePointer Function %6
-+ %7 = OpTypeFunction %5 %9
-+ %1 = OpFunction %5 None %7
-+ %3 = OpFunctionParameter %9
-+OpFunctionEnd
-+ %8 = OpFunction %5 None %7
-+ %4 = OpFunctionParameter %9
-+%10 = OpLabel
-+%11 = OpFunctionCall %5 %1 %4
-+OpReturn
-+OpFunctionEnd
-+)";
-+ const std::string body2 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %2 "param"
-+OpDecorate %1 LinkageAttributes "foo" Export
-+%3 = OpTypeVoid
-+%4 = OpTypeInt 32 0
-+%7 = OpTypePointer Function %4
-+%5 = OpTypeFunction %3 %7
-+%1 = OpFunction %3 None %5
-+%2 = OpFunctionParameter %7
-+%6 = OpLabel
-+OpReturn
-+OpFunctionEnd
-+)";
-+
-+ LinkerOptions options;
-+ for (int i = 0; i < 2; i++) {
-+ spvtest::Binary linked_binary;
-+ options.SetAllowPtrTypeMismatch(i == 1);
-+ ASSERT_EQ(SPV_SUCCESS,
-+ AssembleAndLink({body1, body2}, &linked_binary, options))
-+ << GetErrorMessage();
-+
-+ const std::string expected_res = R"(OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %2 "param"
-+OpModuleProcessed "Linked by SPIR-V Tools Linker"
-+%3 = OpTypeVoid
-+%4 = OpTypeInt 32 0
-+%5 = OpTypePointer Function %4
-+%6 = OpTypeFunction %3 %5
-+%7 = OpFunction %3 None %6
-+%8 = OpFunctionParameter %5
-+%9 = OpLabel
-+%10 = OpFunctionCall %3 %1 %8
-+OpReturn
-+OpFunctionEnd
-+%1 = OpFunction %3 None %6
-+%2 = OpFunctionParameter %5
-+%11 = OpLabel
-+OpReturn
-+OpFunctionEnd
-+)";
-+
-+ std::string res_body;
-+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
-+ ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body))
-+ << GetErrorMessage();
-+ EXPECT_EQ(expected_res, res_body);
-+ }
-+}
-+
-+TEST_F(MatchingImportsToExports, FunctionSignatureMismatchPointer) {
-+ const std::string body1 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %3 "param"
-+OpDecorate %1 LinkageAttributes "foo" Import
-+ %5 = OpTypeVoid
-+ %6 = OpTypeInt 8 0
-+ %9 = OpTypePointer Function %6
-+ %7 = OpTypeFunction %5 %9
-+ %1 = OpFunction %5 None %7
-+ %3 = OpFunctionParameter %9
-+OpFunctionEnd
-+ %8 = OpFunction %5 None %7
-+ %4 = OpFunctionParameter %9
-+%10 = OpLabel
-+%11 = OpFunctionCall %5 %1 %4
-+OpReturn
-+OpFunctionEnd
-+)";
-+ const std::string body2 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %2 "param"
-+OpDecorate %1 LinkageAttributes "foo" Export
-+%3 = OpTypeVoid
-+%4 = OpTypeInt 32 0
-+%7 = OpTypePointer Function %4
-+%5 = OpTypeFunction %3 %7
-+%1 = OpFunction %3 None %5
-+%2 = OpFunctionParameter %7
-+%6 = OpLabel
-+OpReturn
-+OpFunctionEnd
-+)";
-+
-+ spvtest::Binary linked_binary;
-+ ASSERT_EQ(SPV_ERROR_INVALID_BINARY,
-+ AssembleAndLink({body1, body2}, &linked_binary))
-+ << GetErrorMessage();
-+ EXPECT_THAT(
-+ GetErrorMessage(),
-+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
-+ "variable/function %1 and exported variable/function %11"));
-+
-+ LinkerOptions options;
-+ options.SetAllowPtrTypeMismatch(true);
-+ ASSERT_EQ(SPV_SUCCESS,
-+ AssembleAndLink({body1, body2}, &linked_binary, options))
-+ << GetErrorMessage();
-+
-+ const std::string expected_res = R"(OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %2 "param"
-+OpModuleProcessed "Linked by SPIR-V Tools Linker"
-+%3 = OpTypeVoid
-+%4 = OpTypeInt 8 0
-+%5 = OpTypePointer Function %4
-+%6 = OpTypeFunction %3 %5
-+%7 = OpTypeInt 32 0
-+%8 = OpTypePointer Function %7
-+%9 = OpTypeFunction %3 %8
-+%10 = OpFunction %3 None %6
-+%11 = OpFunctionParameter %5
-+%12 = OpLabel
-+%13 = OpBitcast %8 %11
-+%14 = OpFunctionCall %3 %1 %13
-+OpReturn
-+OpFunctionEnd
-+%1 = OpFunction %3 None %9
-+%2 = OpFunctionParameter %8
-+%15 = OpLabel
-+OpReturn
-+OpFunctionEnd
-+)";
-+ std::string res_body;
-+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
-+ ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body))
-+ << GetErrorMessage();
-+ EXPECT_EQ(expected_res, res_body);
-+}
-+
-+TEST_F(MatchingImportsToExports, FunctionSignatureMismatchValue) {
-+ const std::string body1 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %3 "param"
-+OpDecorate %1 LinkageAttributes "foo" Import
-+ %5 = OpTypeVoid
-+ %6 = OpTypeInt 8 0
-+ %7 = OpTypeFunction %5 %6
-+ %1 = OpFunction %5 None %7
-+ %3 = OpFunctionParameter %6
-+OpFunctionEnd
-+ %8 = OpFunction %5 None %7
-+ %4 = OpFunctionParameter %6
-+%10 = OpLabel
-+%11 = OpFunctionCall %5 %1 %4
-+OpReturn
-+OpFunctionEnd
-+)";
-+ const std::string body2 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %2 "param"
-+OpDecorate %1 LinkageAttributes "foo" Export
-+%3 = OpTypeVoid
-+%4 = OpTypeInt 32 0
-+%5 = OpTypeFunction %3 %4
-+%1 = OpFunction %3 None %5
-+%2 = OpFunctionParameter %4
-+%6 = OpLabel
-+OpReturn
-+OpFunctionEnd
-+)";
-+
-+ LinkerOptions options;
-+ for (int i = 0; i < 2; i++) {
-+ spvtest::Binary linked_binary;
-+ options.SetAllowPtrTypeMismatch(i == 1);
-+ ASSERT_EQ(SPV_ERROR_INVALID_BINARY,
-+ AssembleAndLink({body1, body2}, &linked_binary))
-+ << GetErrorMessage();
-+ EXPECT_THAT(
-+ GetErrorMessage(),
-+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
-+ "variable/function %1 and exported variable/function
%10"));
-+ }
-+}
-+
-+TEST_F(MatchingImportsToExports, FunctionSignatureMismatchTypePointerInt) {
-+ const std::string body1 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %3 "param"
-+OpDecorate %1 LinkageAttributes "foo" Import
-+ %5 = OpTypeVoid
-+ %6 = OpTypeInt 64 0
-+ %7 = OpTypeFunction %5 %6
-+ %1 = OpFunction %5 None %7
-+ %3 = OpFunctionParameter %6
-+OpFunctionEnd
-+ %8 = OpFunction %5 None %7
-+ %4 = OpFunctionParameter %6
-+%10 = OpLabel
-+%11 = OpFunctionCall %5 %1 %4
-+OpReturn
-+OpFunctionEnd
-+)";
-+ const std::string body2 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %2 "param"
-+OpDecorate %1 LinkageAttributes "foo" Export
-+%3 = OpTypeVoid
-+%4 = OpTypeInt 64 0
-+%7 = OpTypePointer Function %4
-+%5 = OpTypeFunction %3 %7
-+%1 = OpFunction %3 None %5
-+%2 = OpFunctionParameter %7
-+%6 = OpLabel
-+OpReturn
-+OpFunctionEnd
-+)";
-+
-+ LinkerOptions options;
-+ for (int i = 0; i < 2; i++) {
-+ spvtest::Binary linked_binary;
-+ options.SetAllowPtrTypeMismatch(i == 1);
-+ ASSERT_EQ(SPV_ERROR_INVALID_BINARY,
-+ AssembleAndLink({body1, body2}, &linked_binary))
-+ << GetErrorMessage();
-+ EXPECT_THAT(
-+ GetErrorMessage(),
-+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
-+ "variable/function %1 and exported variable/function
%10"));
-+ }
-+}
-+
-+TEST_F(MatchingImportsToExports, FunctionSignatureMismatchTypeIntPointer) {
-+ const std::string body1 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %3 "param"
-+OpDecorate %1 LinkageAttributes "foo" Import
-+ %5 = OpTypeVoid
-+ %6 = OpTypeInt 64 0
-+ %9 = OpTypePointer Function %6
-+ %7 = OpTypeFunction %5 %9
-+ %1 = OpFunction %5 None %7
-+ %3 = OpFunctionParameter %9
-+OpFunctionEnd
-+ %8 = OpFunction %5 None %7
-+ %4 = OpFunctionParameter %9
-+%10 = OpLabel
-+%11 = OpFunctionCall %5 %1 %4
-+OpReturn
-+OpFunctionEnd
-+)";
-+ const std::string body2 = R"(
-+OpCapability Linkage
-+OpCapability Addresses
-+OpCapability Kernel
-+OpMemoryModel Physical64 OpenCL
-+OpName %1 "foo"
-+OpName %2 "param"
-+OpDecorate %1 LinkageAttributes "foo" Export
-+%3 = OpTypeVoid
-+%4 = OpTypeInt 64 0
-+%5 = OpTypeFunction %3 %4
-+%1 = OpFunction %3 None %5
-+%2 = OpFunctionParameter %4
-+%6 = OpLabel
-+OpReturn
-+OpFunctionEnd
-+)";
-+
-+ LinkerOptions options;
-+ for (int i = 0; i < 2; i++) {
-+ spvtest::Binary linked_binary;
-+ options.SetAllowPtrTypeMismatch(i == 1);
-+ ASSERT_EQ(SPV_ERROR_INVALID_BINARY,
-+ AssembleAndLink({body1, body2}, &linked_binary))
-+ << GetErrorMessage();
-+ EXPECT_THAT(
-+ GetErrorMessage(),
-+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
-+ "variable/function %1 and exported variable/function
%11"));
-+ }
-+}
-+
- } // namespace
- } // namespace spvtools
- [[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (8c91dc3c5e3fdeedb5af562f252deffce0210f10), Pavel Vinogradov, 06/01/2025
Archive powered by MHonArc 2.6.24.