mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-11 02:28:51 +00:00
VideoCommon: add common spirv helper functions
Co-authored-by: tellowkrinkle <tellowkrinkle@gmail.com>
This commit is contained in:
parent
1c90d836a5
commit
3790c99a7d
4 changed files with 248 additions and 0 deletions
30
Source/Core/VideoCommon/Spirv.h
Normal file
30
Source/Core/VideoCommon/Spirv.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2022 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
namespace SPIRV
|
||||
{
|
||||
// SPIR-V compiled code type
|
||||
using CodeType = u32;
|
||||
using CodeVector = std::vector<CodeType>;
|
||||
|
||||
// Compile a vertex shader to SPIR-V.
|
||||
std::optional<CodeVector> CompileVertexShader(std::string_view source_code);
|
||||
|
||||
// Compile a geometry shader to SPIR-V.
|
||||
std::optional<CodeVector> CompileGeometryShader(std::string_view source_code);
|
||||
|
||||
// Compile a fragment shader to SPIR-V.
|
||||
std::optional<CodeVector> CompileFragmentShader(std::string_view source_code);
|
||||
|
||||
// Compile a compute shader to SPIR-V.
|
||||
std::optional<CodeVector> CompileComputeShader(std::string_view source_code);
|
||||
} // namespace SPIRV
|
Loading…
Add table
Add a link
Reference in a new issue