fix bug when use .dll with diff env (e.g. debug/release).
This commit is contained in:
parent
f07557ee28
commit
7506a66008
21
glsl2spv.cpp
21
glsl2spv.cpp
@ -215,14 +215,17 @@ extern "C"
|
|||||||
|
|
||||||
enum class ShaderType
|
enum class ShaderType
|
||||||
{
|
{
|
||||||
GLSL,
|
GLSL=0,
|
||||||
HLSL
|
HLSL,
|
||||||
};
|
|
||||||
|
MAX=0xff
|
||||||
|
};//enum class ShaderType
|
||||||
|
|
||||||
struct CompileInfo
|
struct CompileInfo
|
||||||
{
|
{
|
||||||
ShaderType shader_type = ShaderType::GLSL;
|
ShaderType shader_type = ShaderType::GLSL;
|
||||||
std::vector<std::string> include_dirs;
|
uint32_t includes_count;
|
||||||
|
const char** includes;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class VertexAttribBaseType
|
enum class VertexAttribBaseType
|
||||||
@ -346,9 +349,9 @@ extern "C"
|
|||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
SPVData(const char* log)
|
SPVData(const char* log) : SPVData(log, log)
|
||||||
{
|
{
|
||||||
SPVData(log, log);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SPVData(const std::vector<uint32_t> &spirv)
|
SPVData(const std::vector<uint32_t> &spirv)
|
||||||
@ -497,8 +500,10 @@ extern "C"
|
|||||||
shader.setEntryPoint("main");
|
shader.setEntryPoint("main");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& dir:compile_info->include_dirs)
|
for (uint32_t i = 0; i < compile_info->includes_count; i++)
|
||||||
includer.pushExternalLocalDirectory(dir);
|
{
|
||||||
|
includer.pushExternalLocalDirectory(compile_info->includes[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shaderStrings[0] = shader_source;
|
shaderStrings[0] = shader_source;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user