#include "source/opt/spread_volatile_semantics.h"
#include "source/opt/decoration_manager.h"
#include "source/spirv_constant.h"
namespace spvtools {
namespace opt {
namespace {
constexpr uint32_t kOpDecorateInOperandBuiltinDecoration = …;
constexpr uint32_t kOpLoadInOperandMemoryOperands = …;
constexpr uint32_t kOpEntryPointInOperandEntryPoint = …;
constexpr uint32_t kOpEntryPointInOperandInterface = …;
bool HasBuiltinDecoration(analysis::DecorationManager* decoration_manager,
uint32_t var_id, uint32_t built_in) { … }
bool IsBuiltInForRayTracingVolatileSemantics(spv::BuiltIn built_in) { … }
bool HasBuiltinForRayTracingVolatileSemantics(
analysis::DecorationManager* decoration_manager, uint32_t var_id) { … }
bool HasVolatileDecoration(analysis::DecorationManager* decoration_manager,
uint32_t var_id) { … }
}
Pass::Status SpreadVolatileSemantics::Process() { … }
Pass::Status SpreadVolatileSemantics::SpreadVolatileSemanticsToVariables(
const bool is_vk_memory_model_enabled) { … }
bool SpreadVolatileSemantics::IsTargetUsedByNonVolatileLoadInEntryPoint(
uint32_t var_id, Instruction* entry_point) { … }
bool SpreadVolatileSemantics::HasInterfaceInConflictOfVolatileSemantics() { … }
void SpreadVolatileSemantics::MarkVolatileSemanticsForVariable(
uint32_t var_id, Instruction* entry_point) { … }
void SpreadVolatileSemantics::CollectTargetsForVolatileSemantics(
const bool is_vk_memory_model_enabled) { … }
void SpreadVolatileSemantics::DecorateVarWithVolatile(Instruction* var) { … }
bool SpreadVolatileSemantics::VisitLoadsOfPointersToVariableInEntries(
uint32_t var_id, const std::function<bool(Instruction*)>& handle_load,
const std::unordered_set<uint32_t>& function_ids) { … }
void SpreadVolatileSemantics::SetVolatileForLoadsInEntries(
Instruction* var, const std::unordered_set<uint32_t>& entry_function_ids) { … }
bool SpreadVolatileSemantics::IsTargetForVolatileSemantics(
uint32_t var_id, spv::ExecutionModel execution_model) { … }
}
}