mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Vulkan: Use VK_NV_glsl extension where available, and skip glslang
Seems to produce faster ubershaders, at least.
This commit is contained in:
@ -275,50 +275,38 @@ VkShaderModule CreateShaderModule(const u32* spv, size_t spv_word_count)
|
||||
return module;
|
||||
}
|
||||
|
||||
VkShaderModule CompileAndCreateVertexShader(const std::string& source_code, bool prepend_header)
|
||||
VkShaderModule CompileAndCreateVertexShader(const std::string& source_code)
|
||||
{
|
||||
ShaderCompiler::SPIRVCodeVector code;
|
||||
if (!ShaderCompiler::CompileVertexShader(&code, source_code.c_str(), source_code.length(),
|
||||
prepend_header))
|
||||
{
|
||||
if (!ShaderCompiler::CompileVertexShader(&code, source_code.c_str(), source_code.length()))
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
return CreateShaderModule(code.data(), code.size());
|
||||
}
|
||||
|
||||
VkShaderModule CompileAndCreateGeometryShader(const std::string& source_code, bool prepend_header)
|
||||
VkShaderModule CompileAndCreateGeometryShader(const std::string& source_code)
|
||||
{
|
||||
ShaderCompiler::SPIRVCodeVector code;
|
||||
if (!ShaderCompiler::CompileGeometryShader(&code, source_code.c_str(), source_code.length(),
|
||||
prepend_header))
|
||||
{
|
||||
if (!ShaderCompiler::CompileGeometryShader(&code, source_code.c_str(), source_code.length()))
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
return CreateShaderModule(code.data(), code.size());
|
||||
}
|
||||
|
||||
VkShaderModule CompileAndCreateFragmentShader(const std::string& source_code, bool prepend_header)
|
||||
VkShaderModule CompileAndCreateFragmentShader(const std::string& source_code)
|
||||
{
|
||||
ShaderCompiler::SPIRVCodeVector code;
|
||||
if (!ShaderCompiler::CompileFragmentShader(&code, source_code.c_str(), source_code.length(),
|
||||
prepend_header))
|
||||
{
|
||||
if (!ShaderCompiler::CompileFragmentShader(&code, source_code.c_str(), source_code.length()))
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
return CreateShaderModule(code.data(), code.size());
|
||||
}
|
||||
|
||||
VkShaderModule CompileAndCreateComputeShader(const std::string& source_code, bool prepend_header)
|
||||
VkShaderModule CompileAndCreateComputeShader(const std::string& source_code)
|
||||
{
|
||||
ShaderCompiler::SPIRVCodeVector code;
|
||||
if (!ShaderCompiler::CompileComputeShader(&code, source_code.c_str(), source_code.length(),
|
||||
prepend_header))
|
||||
{
|
||||
if (!ShaderCompiler::CompileComputeShader(&code, source_code.c_str(), source_code.length()))
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
return CreateShaderModule(code.data(), code.size());
|
||||
}
|
||||
|
Reference in New Issue
Block a user