From 351791143cd6de36fc0706805b8caa00ae0081a5 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sun, 18 Aug 2024 17:53:11 +0100 Subject: [PATCH] [*] Yet another dumb fuck issue hidden by a flag only the compiler exes can trigger --- spirv_cross.cpp | 7 ++++++- spirv_cross.hpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spirv_cross.cpp b/spirv_cross.cpp index e36093e6..5bf1d9ab 100644 --- a/spirv_cross.cpp +++ b/spirv_cross.cpp @@ -26,6 +26,7 @@ #include "spirv_cfg.hpp" #include "spirv_common.hpp" #include "spirv_parser.hpp" +#include "spirv_cross_util.hpp" #include #include #include @@ -3190,7 +3191,7 @@ VariableID Compiler::build_dummy_sampler_for_combined_images() return 0; } -void Compiler::build_combined_image_samplers() +void Compiler::build_combined_image_samplers(bool bReserve) { ir.for_each_typed_id([&](uint32_t, SPIRFunction &func) { func.combined_parameters.clear(); @@ -3201,6 +3202,10 @@ void Compiler::build_combined_image_samplers() combined_image_samplers.clear(); CombinedImageSamplerHandler handler(*this); traverse_all_reachable_opcodes(get(ir.default_entry_point), handler); + if (bReserve) + { + spirv_cross_util::inherit_combined_sampler_bindings(*this); + } } SmallVector Compiler::get_specialization_constants() const diff --git a/spirv_cross.hpp b/spirv_cross.hpp index 3388c980..e87777bb 100644 --- a/spirv_cross.hpp +++ b/spirv_cross.hpp @@ -429,7 +429,7 @@ public: // Combined image samplers originating from this set are always considered active variables. // Arrays of separate samplers are not supported, but arrays of separate images are supported. // Array of images + sampler -> Array of combined image samplers. - void build_combined_image_samplers(); + void build_combined_image_samplers(bool bPreserve = false); // Gets a remapping for the combined image samplers. const SmallVector &get_combined_image_samplers() const