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

53 lines
1.5 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
2026-03-09 20:14:44 +01:00
Copyright (C) 2026 Catcrafts®
2025-04-29 00:15:14 +02:00
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;
#include "Crafter.Build-Api.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 {
2026-04-27 07:04:42 +02:00
export enum class ShaderType {
Vertex,
TessControl,
TessEvaluation,
Geometry,
Fragment,
Compute,
RayGen,
Intersect,
AnyHit,
ClosestHit,
Miss,
Callable,
Task,
Mesh,
};
2025-10-31 16:50:47 +01:00
export class Shader {
2025-04-24 19:21:09 +02:00
public:
fs::path path;
std::string entrypoint;
2026-04-27 07:04:42 +02:00
ShaderType type;
CRAFTER_API Shader(fs::path&& path, std::string&& entrypoint, ShaderType type);
CRAFTER_API bool Check(const fs::path& outputDir) const;
2026-05-02 21:08:51 +02:00
CRAFTER_API std::string Compile(const fs::path& outputDir, std::span<const fs::path> includeDirs) const;
2025-04-24 19:21:09 +02:00
};
}