add custom entrypoint support (hlsl).

This commit is contained in:
Jayou 2020-10-21 20:44:04 +08:00
parent 38fb792d79
commit 42a198ea6e

View File

@ -224,8 +224,9 @@ extern "C"
struct CompileInfo struct CompileInfo
{ {
ShaderType shader_type = ShaderType::GLSL; ShaderType shader_type = ShaderType::GLSL;
const char *entrypoint;
uint32_t includes_count; uint32_t includes_count;
const char** includes; const char **includes;
}; };
enum class VertexAttribBaseType enum class VertexAttribBaseType
@ -498,7 +499,7 @@ extern "C"
messages = (EShMessages)(EShMsgReadHlsl | EShMsgSpvRules | EShMsgVulkanRules); messages = (EShMessages)(EShMsgReadHlsl | EShMsgSpvRules | EShMsgVulkanRules);
// HLSL Request! // HLSL Request!
shader.setEntryPoint("main"); shader.setEntryPoint(compile_info->entrypoint);
} }
for (uint32_t i = 0; i < compile_info->includes_count; i++) for (uint32_t i = 0; i < compile_info->includes_count; i++)