[*] Yet another dumb fuck issue hidden by a flag only the compiler exes can trigger

This commit is contained in:
Reece Wilson 2024-08-18 17:53:11 +01:00
parent c5dbad906e
commit 351791143c
2 changed files with 7 additions and 2 deletions

View File

@ -26,6 +26,7 @@
#include "spirv_cfg.hpp" #include "spirv_cfg.hpp"
#include "spirv_common.hpp" #include "spirv_common.hpp"
#include "spirv_parser.hpp" #include "spirv_parser.hpp"
#include "spirv_cross_util.hpp"
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <utility> #include <utility>
@ -3190,7 +3191,7 @@ VariableID Compiler::build_dummy_sampler_for_combined_images()
return 0; return 0;
} }
void Compiler::build_combined_image_samplers() void Compiler::build_combined_image_samplers(bool bReserve)
{ {
ir.for_each_typed_id<SPIRFunction>([&](uint32_t, SPIRFunction &func) { ir.for_each_typed_id<SPIRFunction>([&](uint32_t, SPIRFunction &func) {
func.combined_parameters.clear(); func.combined_parameters.clear();
@ -3201,6 +3202,10 @@ void Compiler::build_combined_image_samplers()
combined_image_samplers.clear(); combined_image_samplers.clear();
CombinedImageSamplerHandler handler(*this); CombinedImageSamplerHandler handler(*this);
traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler); traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler);
if (bReserve)
{
spirv_cross_util::inherit_combined_sampler_bindings(*this);
}
} }
SmallVector<SpecializationConstant> Compiler::get_specialization_constants() const SmallVector<SpecializationConstant> Compiler::get_specialization_constants() const

View File

@ -429,7 +429,7 @@ public:
// Combined image samplers originating from this set are always considered active variables. // 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. // Arrays of separate samplers are not supported, but arrays of separate images are supported.
// Array of images + sampler -> Array of combined image samplers. // 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. // Gets a remapping for the combined image samplers.
const SmallVector<CombinedImageSampler> &get_combined_image_samplers() const const SmallVector<CombinedImageSampler> &get_combined_image_samplers() const