RHI: Add embedded shader source support via ShaderCompileDesc
- Add ShaderLanguage enum (HLSL, GLSL, SPIRV) - Extend ShaderCompileDesc with source/sourceLanguage fields - D3D12Device::CompileShader supports both file and embedded source - OpenGLDevice::CompileShader supports embedded GLSL source - Refactor test_shader.cpp to use embedded source for both backends This enables consistent shader compilation across D3D12 and OpenGL backends while maintaining backend-specific shader language support.
This commit is contained in:
@@ -19,6 +19,13 @@ enum class ShaderType : uint8_t {
|
||||
Library
|
||||
};
|
||||
|
||||
enum class ShaderLanguage : uint8_t {
|
||||
Unknown,
|
||||
HLSL,
|
||||
GLSL,
|
||||
SPIRV
|
||||
};
|
||||
|
||||
enum class CullMode : uint8_t {
|
||||
None,
|
||||
Front,
|
||||
|
||||
@@ -43,10 +43,14 @@ struct ShaderCompileMacro {
|
||||
std::wstring definition;
|
||||
};
|
||||
|
||||
enum class ShaderLanguage : uint8_t;
|
||||
|
||||
struct ShaderCompileDesc {
|
||||
std::wstring fileName;
|
||||
std::vector<uint8_t> source;
|
||||
ShaderLanguage sourceLanguage = ShaderLanguage::Unknown;
|
||||
std::wstring entryPoint;
|
||||
std::wstring profile;
|
||||
std::wstring fileName;
|
||||
std::vector<ShaderCompileMacro> macros;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user