示例#1
0
文件: Util.cpp 项目: t27duck/dolphin
VkShaderModule CompileAndCreateComputeShader(const std::string& source_code)
{
  ShaderCompiler::SPIRVCodeVector code;
  if (!ShaderCompiler::CompileComputeShader(&code, source_code.c_str(), source_code.length()))
    return VK_NULL_HANDLE;

  return CreateShaderModule(code.data(), code.size());
}
示例#2
0
文件: Util.cpp 项目: stenzek/dolphin
VkShaderModule CompileAndCreateFragmentShader(const std::string& source_code, bool prepend_header)
{
  ShaderCompiler::SPIRVCodeVector code;
  if (!ShaderCompiler::CompileFragmentShader(&code, source_code.c_str(), source_code.length(),
                                             prepend_header))
  {
    return VK_NULL_HANDLE;
  }

  return CreateShaderModule(code.data(), code.size());
}