#include "source/opt/convert_to_sampled_image_pass.h"
#include <cctype>
#include <cstring>
#include "source/opt/ir_builder.h"
#include "source/util/make_unique.h"
#include "source/util/parse_number.h"
namespace spvtools {
namespace opt {
VectorOfDescriptorSetAndBindingPairs;
DescriptorSetBindingToInstruction;
namespace {
ParseNumber;
bool IsSeparator(char ch) { … }
const char* ParseNumberUntilSeparator(const char* str, uint32_t* number) { … }
uint32_t GetImageTypeOfSampledImage(analysis::TypeManager* type_mgr,
Instruction* sampled_image) { … }
Instruction* GetNonCopyObjectDef(analysis::DefUseManager* def_use_mgr,
uint32_t inst_id) { … }
}
bool ConvertToSampledImagePass::GetDescriptorSetBinding(
const Instruction& inst,
DescriptorSetAndBinding* descriptor_set_binding) const { … }
bool ConvertToSampledImagePass::ShouldResourceBeConverted(
const DescriptorSetAndBinding& descriptor_set_binding) const { … }
const analysis::Type* ConvertToSampledImagePass::GetVariableType(
const Instruction& variable) const { … }
spv::StorageClass ConvertToSampledImagePass::GetStorageClass(
const Instruction& variable) const { … }
bool ConvertToSampledImagePass::CollectResourcesToConvert(
DescriptorSetBindingToInstruction* descriptor_set_binding_pair_to_sampler,
DescriptorSetBindingToInstruction* descriptor_set_binding_pair_to_image)
const { … }
Pass::Status ConvertToSampledImagePass::Process() { … }
void ConvertToSampledImagePass::FindUses(const Instruction* inst,
std::vector<Instruction*>* uses,
spv::Op user_opcode) const { … }
void ConvertToSampledImagePass::FindUsesOfImage(
const Instruction* image, std::vector<Instruction*>* uses) const { … }
Instruction* ConvertToSampledImagePass::CreateImageExtraction(
Instruction* sampled_image) { … }
uint32_t ConvertToSampledImagePass::GetSampledImageTypeForImage(
Instruction* image_variable) { … }
Instruction* ConvertToSampledImagePass::UpdateImageUses(
Instruction* sampled_image_load) { … }
bool ConvertToSampledImagePass::
IsSamplerOfSampledImageDecoratedByDescriptorSetBinding(
Instruction* sampled_image_inst,
const DescriptorSetAndBinding& descriptor_set_binding) { … }
void ConvertToSampledImagePass::UpdateSampledImageUses(
Instruction* image_load, Instruction* image_extraction,
const DescriptorSetAndBinding& image_descriptor_set_binding) { … }
void ConvertToSampledImagePass::MoveInstructionNextToType(Instruction* inst,
uint32_t type_id) { … }
bool ConvertToSampledImagePass::ConvertImageVariableToSampledImage(
Instruction* image_variable, uint32_t sampled_image_type_id) { … }
Pass::Status ConvertToSampledImagePass::UpdateImageVariableToSampledImage(
Instruction* image_variable,
const DescriptorSetAndBinding& descriptor_set_binding) { … }
bool ConvertToSampledImagePass::DoesSampledImageReferenceImage(
Instruction* sampled_image_inst, Instruction* image_variable) { … }
Pass::Status ConvertToSampledImagePass::CheckUsesOfSamplerVariable(
const Instruction* sampler_variable,
Instruction* image_to_be_combined_with) { … }
std::unique_ptr<VectorOfDescriptorSetAndBindingPairs>
ConvertToSampledImagePass::ParseDescriptorSetBindingPairsString(
const char* str) { … }
}
}