#include "source/opt/desc_sroa.h"
#include "source/opt/desc_sroa_util.h"
#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
namespace {
bool IsDecorationBinding(Instruction* inst) { … }
}
Pass::Status DescriptorScalarReplacement::Process() { … }
bool DescriptorScalarReplacement::ReplaceCandidate(Instruction* var) { … }
bool DescriptorScalarReplacement::ReplaceAccessChain(Instruction* var,
Instruction* use) { … }
bool DescriptorScalarReplacement::ReplaceEntryPoint(Instruction* var,
Instruction* use) { … }
uint32_t DescriptorScalarReplacement::GetReplacementVariable(Instruction* var,
uint32_t idx) { … }
void DescriptorScalarReplacement::CopyDecorationsForNewVariable(
Instruction* old_var, uint32_t index, uint32_t new_var_id,
uint32_t new_var_ptr_type_id, const bool is_old_var_array,
const bool is_old_var_struct, Instruction* old_var_type) { … }
uint32_t DescriptorScalarReplacement::GetNewBindingForElement(
uint32_t old_binding, uint32_t index, uint32_t new_var_ptr_type_id,
const bool is_old_var_array, const bool is_old_var_struct,
Instruction* old_var_type) { … }
void DescriptorScalarReplacement::CreateNewDecorationForNewVariable(
Instruction* old_decoration, uint32_t new_var_id, uint32_t new_binding) { … }
void DescriptorScalarReplacement::CreateNewDecorationForMemberDecorate(
Instruction* old_member_decoration, uint32_t new_var_id) { … }
uint32_t DescriptorScalarReplacement::CreateReplacementVariable(
Instruction* var, uint32_t idx) { … }
uint32_t DescriptorScalarReplacement::GetNumBindingsUsedByType(
uint32_t type_id) { … }
bool DescriptorScalarReplacement::ReplaceLoadedValue(Instruction* var,
Instruction* value) { … }
bool DescriptorScalarReplacement::ReplaceCompositeExtract(
Instruction* var, Instruction* extract) { … }
}
}