Add shader compiler for WebGPU
Use existing Vulkan compiler to generate SPIR-V and convert it into WGSL with tint compiler https://github.com/google/dawn/releases/tag/v20260219.200501
This commit is contained in:
@@ -5,6 +5,13 @@
|
||||
#if COMPILE_WITH_VK_SHADER_COMPILER
|
||||
|
||||
#include "Engine/ShadersCompilation/ShaderCompiler.h"
|
||||
#include <vector>
|
||||
|
||||
namespace glslang
|
||||
{
|
||||
class TShader;
|
||||
struct SpvOptions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Implementation of shaders compiler for Vulkan rendering backend.
|
||||
@@ -30,6 +37,11 @@ protected:
|
||||
// [ShaderCompiler]
|
||||
bool CompileShader(ShaderFunctionMeta& meta, WritePermutationData customDataWrite = nullptr) override;
|
||||
bool OnCompileBegin() override;
|
||||
|
||||
protected:
|
||||
virtual void InitParsing(ShaderCompilationContext* context, glslang::TShader& shader);
|
||||
virtual void InitCodegen(ShaderCompilationContext* context, glslang::SpvOptions& spvOptions);
|
||||
virtual bool Write(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, struct SpirvShaderHeader& header, std::vector<unsigned>& spirv);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user