Crafter.Build/interfaces/Crafter.Build-Shader.cppm

39 lines
1.3 KiB
Text
Raw Permalink Normal View History

2025-04-24 19:21:09 +02:00
/*
2025-10-31 16:50:47 +01:00
Crafter® Build
2025-04-29 00:15:14 +02:00
Copyright (C) 2025 Catcrafts®
Catcrafts.net
2025-04-24 19:21:09 +02:00
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
2025-10-31 16:50:47 +01:00
License version 3.0 as published by the Free Software Foundation;
2025-04-24 19:21:09 +02:00
2025-10-31 16:50:47 +01:00
This library is distributed in the hope that it will be useful,
2025-04-24 19:21:09 +02:00
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
module;
2025-10-31 16:50:47 +01:00
#include <glslang/SPIRV/GlslangToSpv.h>
2025-04-24 19:21:09 +02:00
#include <glslang/Public/ShaderLang.h>
2025-10-31 16:50:47 +01:00
#include <glslang/Public/ResourceLimits.h>
#include "../lib/DirStackFileIncluder.h"
2025-04-24 19:21:09 +02:00
export module Crafter.Build:Shader;
2025-10-31 16:50:47 +01:00
import std;
2025-04-24 19:21:09 +02:00
namespace fs = std::filesystem;
2025-10-31 16:50:47 +01:00
namespace Crafter {
export class Shader {
2025-04-24 19:21:09 +02:00
public:
fs::path path;
std::string entrypoint;
EShLanguage type;
2025-10-31 16:50:47 +01:00
Shader(fs::path&& path, std::string&& entrypoint, EShLanguage type);
bool Check(const fs::path& outputDir) const;
void Compile(const fs::path& outputDir) const;
2025-04-24 19:21:09 +02:00
};
}