chromium/third_party/dawn/src/tint/lang/wgsl/inspector/inspector_builder_test.cc

// Copyright 2021 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#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;  // NOLINT

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() {}

}  // namespace tint::inspector