#include "src/tint/lang/wgsl/inspector/inspector_builder_test.h"
#include <memory>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include "gtest/gtest.h"
#include "src/tint/lang/core/fluent_types.h"
#include "src/tint/lang/wgsl/resolver/resolve.h"
usingnamespacetint::core::fluent_types;
namespace tint::inspector {
InspectorBuilder::InspectorBuilder() = default;
InspectorBuilder::~InspectorBuilder() = default;
void InspectorBuilder::MakeEmptyBodyFunction(std::string name,
VectorRef<const ast::Attribute*> attributes) { … }
void InspectorBuilder::MakeCallerBodyFunction(std::string caller,
VectorRef<std::string> callees,
VectorRef<const ast::Attribute*> attributes) { … }
const ast::Struct* InspectorBuilder::MakeInOutStruct(std::string name,
VectorRef<InOutInfo> inout_vars) { … }
const ast::Function* InspectorBuilder::MakePlainGlobalReferenceBodyFunction(
std::string func,
std::string var,
ast::Type type,
VectorRef<const ast::Attribute*> attributes) { … }
bool InspectorBuilder::ContainsName(VectorRef<StageVariable> vec, const std::string& name) { … }
std::string InspectorBuilder::StructMemberName(size_t idx, ast::Type type) { … }
const ast::Struct* InspectorBuilder::MakeStructType(const std::string& name,
VectorRef<ast::Type> member_types) { … }
const ast::Struct* InspectorBuilder::MakeStructTypeFromMembers(
const std::string& name,
VectorRef<const ast::StructMember*> members) { … }
const ast::StructMember* InspectorBuilder::MakeStructMember(
size_t index,
ast::Type type,
VectorRef<const ast::Attribute*> attributes) { … }
const ast::Struct* InspectorBuilder::MakeUniformBufferType(const std::string& name,
VectorRef<ast::Type> member_types) { … }
std::function<ast::Type()> InspectorBuilder::MakeStorageBufferTypes(
const std::string& name,
VectorRef<ast::Type> member_types) { … }
void InspectorBuilder::AddUniformBuffer(const std::string& name,
ast::Type type,
uint32_t group,
uint32_t binding) { … }
void InspectorBuilder::AddWorkgroupStorage(const std::string& name, ast::Type type) { … }
void InspectorBuilder::AddStorageBuffer(const std::string& name,
ast::Type type,
core::Access access,
uint32_t group,
uint32_t binding) { … }
void InspectorBuilder::MakeStructVariableReferenceBodyFunction(
std::string func_name,
std::string struct_name,
VectorRef<std::tuple<size_t, ast::Type>> members) { … }
void InspectorBuilder::AddSampler(const std::string& name, uint32_t group, uint32_t binding) { … }
void InspectorBuilder::AddComparisonSampler(const std::string& name,
uint32_t group,
uint32_t binding) { … }
void InspectorBuilder::AddResource(const std::string& name,
ast::Type type,
uint32_t group,
uint32_t binding) { … }
void InspectorBuilder::AddGlobalVariable(const std::string& name, ast::Type type) { … }
const ast::Function* InspectorBuilder::MakeSamplerReferenceBodyFunction(
const std::string& func_name,
const std::string& texture_name,
const std::string& sampler_name,
const std::string& coords_name,
ast::Type base_type,
VectorRef<const ast::Attribute*> attributes) { … }
const ast::Function* InspectorBuilder::MakeSamplerReferenceBodyFunction(
const std::string& func_name,
const std::string& texture_name,
const std::string& sampler_name,
const std::string& coords_name,
const std::string& array_index,
ast::Type base_type,
VectorRef<const ast::Attribute*> attributes) { … }
const ast::Function* InspectorBuilder::MakeComparisonSamplerReferenceBodyFunction(
const std::string& func_name,
const std::string& texture_name,
const std::string& sampler_name,
const std::string& coords_name,
const std::string& depth_name,
ast::Type base_type,
VectorRef<const ast::Attribute*> attributes) { … }
ast::Type InspectorBuilder::GetBaseType(ResourceBinding::SampledKind sampled_kind) { … }
ast::Type InspectorBuilder::GetCoordsType(core::type::TextureDimension dim, ast::Type scalar) { … }
ast::Type InspectorBuilder::MakeStorageTextureTypes(core::type::TextureDimension dim,
core::TexelFormat format,
core::Access access) { … }
void InspectorBuilder::AddStorageTexture(const std::string& name,
ast::Type type,
uint32_t group,
uint32_t binding) { … }
const ast::Function* InspectorBuilder::MakeStorageTextureBodyFunction(
const std::string& func_name,
const std::string& st_name,
ast::Type dim_type,
VectorRef<const ast::Attribute*> attributes) { … }
std::function<ast::Type()> InspectorBuilder::GetTypeFunction(ComponentType component,
CompositionType composition) { … }
Inspector& InspectorBuilder::Build() { … }
}