#include "includer.hpp" #include #include extern "C" { #include "plat.h" } using IncludeResult = glslang::TShader::Includer::IncludeResult; IncludeResult* Includer::includeSystem( const char* headerName, const char* includerName, size_t inclusionDepth ) { return 0; } extern bool rf(const char* n, char*& buf, size_t& size); IncludeResult* Includer::includeLocal( const char* header_name, const char* includer_name, size_t inclusionDepth ) { char* src; size_t src_size; std::filesystem::path inc(includer_name); inc.remove_filename(); inc /= header_name; auto hn = std::filesystem::absolute(inc).string(); if (!rf(hn.c_str(), src, src_size)) { print_err("Failed to include %s\n", header_name); print_err("\tTried %s\n", hn.c_str()); return 0; } return new IncludeResult(hn, src, src_size, 0); } void Includer::releaseInclude(IncludeResult* i) { delete i; }