chromium/third_party/vulkan-validation-layers/src/layers/gpu/spirv/type_manager.cpp

/* Copyright (c) 2024 LunarG, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "type_manager.h"
#include "module.h"

namespace gpu {
namespace spirv {

// Simplest way to check if same type is see if items line up.
// Even if types have an RefId, it should be the same unless there are already duplicated types.
bool Type::operator==(Type const& other) const {}

// return %A in:
//   %B = OpTypePointer Input %A
//   %C = OpVariable %B Input
const Type* Variable::PointerType(TypeManager& type_manager_) const {}

const Type& TypeManager::AddType(std::unique_ptr<Instruction> new_inst, SpvType spv_type) {}

const Type* TypeManager::FindTypeById(uint32_t id) const {}

const Type* TypeManager::FindFunctionType(const Instruction& inst) const {}

const Type& TypeManager::GetTypeVoid() {}

const Type& TypeManager::GetTypeBool() {}

const Type& TypeManager::GetTypeSampler() {}

const Type& TypeManager::GetTypeRayQuery() {}

const Type& TypeManager::GetTypeAccelerationStructure() {}

const Type& TypeManager::GetTypeInt(uint32_t bit_width, bool is_signed) {}

const Type& TypeManager::GetTypeFloat(uint32_t bit_width) {}

const Type& TypeManager::GetTypeArray(const Type& element_type, const Constant& length) {}

const Type& TypeManager::GetTypeRuntimeArray(const Type& element_type) {}

const Type& TypeManager::GetTypeVector(const Type& component_type, uint32_t component_count) {}

const Type& TypeManager::GetTypeMatrix(const Type& column_type, uint32_t column_count) {}

const Type& TypeManager::GetTypeSampledImage(const Type& image_type) {}

const Type& TypeManager::GetTypePointer(spv::StorageClass storage_class, const Type& pointer_type) {}

const Type& TypeManager::GetTypePointerBuiltInInput(spv::BuiltIn built_in) {}

uint32_t TypeManager::TypeLength(const Type& type) {}

const Constant& TypeManager::AddConstant(std::unique_ptr<Instruction> new_inst, const Type& type) {}

const Constant* TypeManager::FindConstantInt32(uint32_t type_id, uint32_t value) const {}

const Constant* TypeManager::FindConstantFloat32(uint32_t type_id, uint32_t value) const {}

const Constant* TypeManager::FindConstantById(uint32_t id) const {}

const Constant& TypeManager::CreateConstantUInt32(uint32_t value) {}

const Constant& TypeManager::GetConstantUInt32(uint32_t value) {}

// It is common to use uint32_t(0) as a default, so having it cached is helpful
const Constant& TypeManager::GetConstantZeroUint32() {}

// It is common to use float(0) as a default, so having it cached is helpful
const Constant& TypeManager::GetConstantZeroFloat32() {}

const Constant& TypeManager::GetConstantZeroVec3() {}

const Constant& TypeManager::GetConstantNull(const Type& type) {}

const Variable& TypeManager::AddVariable(std::unique_ptr<Instruction> new_inst, const Type& type) {}

const Variable* TypeManager::FindVariableById(uint32_t id) const {}

uint32_t TypeManager::FindTypeByteSize(uint32_t type_id, uint32_t matrix_stride, bool col_major, bool in_matrix) {}

}  // namespace spirv
}  // namespace gpu