chromium/third_party/vulkan-validation-layers/src/layers/gpu/spirv/module.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 "module.h"
#include <spirv/unified1/spirv.hpp>
#include "gpu/shaders/gpu_shaders_constants.h"
#include "error_message/logging.h"

#include "buffer_device_address_pass.h"
#include "bindless_descriptor_pass.h"
#include "non_bindless_oob_buffer_pass.h"
#include "non_bindless_oob_texel_buffer_pass.h"
#include "ray_query_pass.h"
#include "debug_printf_pass.h"

#include <iostream>

namespace gpu {
namespace spirv {

Module::Module(vvl::span<const uint32_t> words, DebugReport* debug_report, const Settings& settings)
    :{}

bool Module::HasCapability(spv::Capability capability) {}

static void StringToSpirv(const char* input, std::vector<uint32_t>& output) {}

// Will only add if not already added
void Module::AddCapability(spv::Capability capability) {}

void Module::AddExtension(const char* extension) {}

void Module::AddDebugName(const char* name, uint32_t id) {}

void Module::AddDecoration(uint32_t target_id, spv::Decoration decoration, const std::vector<uint32_t>& operands) {}

void Module::AddMemberDecoration(uint32_t target_id, uint32_t index, spv::Decoration decoration,
                                 const std::vector<uint32_t>& operands) {}

bool Module::RunPassBindlessDescriptor() {}

bool Module::RunPassNonBindlessOOBBuffer() {}

bool Module::RunPassNonBindlessOOBTexelBuffer() {}

bool Module::RunPassBufferDeviceAddress() {}

bool Module::RunPassRayQuery() {}

// binding slot allows debug printf to be slotted in the same set as GPU-AV if needed
bool Module::RunPassDebugPrintf(uint32_t binding_slot) {}

uint32_t Module::TakeNextId() {}

// walk through each list and append the buffer
void Module::ToBinary(std::vector<uint32_t>& out) {}

// We need to apply variable to the Entry Point interface if using SPIR-V 1.4+ (or input/output)
void Module::AddInterfaceVariables(uint32_t id, spv::StorageClass storage_class) {}

// Takes the current module and injects the function into it
// This is done by first apply any new Types/Constants/Variables and then copying in the instructions of the Function
void Module::LinkFunction(const LinkInfo& info) {}

// Things that need to be done once if there is any instrumentation.
void Module::PostProcess() {}

void Module::InternalWarning(const char* tag, const char* message) {}

void Module::InternalError(const char* tag, const char* message) {}

}  // namespace spirv
}  // namespace gpu