VideoBackends / VideoCommon: refactor Vulkan to use new SPIRV functionality

This commit is contained in:
iwubcode
2022-05-24 23:12:47 -05:00
parent c2d3b7e7f5
commit dda1479ecf
5 changed files with 49 additions and 213 deletions

View File

@ -8,7 +8,10 @@
#include <string_view>
#include <vector>
#include "ShaderLang.h"
#include "Common/CommonTypes.h"
#include "VideoCommon/VideoCommon.h"
namespace SPIRV
{
@ -17,14 +20,18 @@ using CodeType = u32;
using CodeVector = std::vector<CodeType>;
// Compile a vertex shader to SPIR-V.
std::optional<CodeVector> CompileVertexShader(std::string_view source_code);
std::optional<CodeVector> CompileVertexShader(std::string_view source_code, APIType api_type,
glslang::EShTargetLanguageVersion language_version);
// Compile a geometry shader to SPIR-V.
std::optional<CodeVector> CompileGeometryShader(std::string_view source_code);
std::optional<CodeVector> CompileGeometryShader(std::string_view source_code, APIType api_type,
glslang::EShTargetLanguageVersion language_version);
// Compile a fragment shader to SPIR-V.
std::optional<CodeVector> CompileFragmentShader(std::string_view source_code);
std::optional<CodeVector> CompileFragmentShader(std::string_view source_code, APIType api_type,
glslang::EShTargetLanguageVersion language_version);
// Compile a compute shader to SPIR-V.
std::optional<CodeVector> CompileComputeShader(std::string_view source_code);
std::optional<CodeVector> CompileComputeShader(std::string_view source_code, APIType api_type,
glslang::EShTargetLanguageVersion language_version);
} // namespace SPIRV