renderer_vulkan: Add experimental Vulkan renderer

This commit is contained in:
emufan4568
2022-09-16 17:19:09 +03:00
committed by GPUCode
parent 945faf8e92
commit 9675811bbe
70 changed files with 10347 additions and 161 deletions

View File

@ -6,6 +6,7 @@
#include <cstddef>
#include <cstring>
#include <concepts>
#include "common/cityhash.h"
#include "common/common_types.h"
@ -41,6 +42,13 @@ inline u64 HashCombine(std::size_t& seed, const u64 hash) {
return seed ^= hash + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
template <std::integral T>
struct IdentityHash {
T operator()(const T& value) const {
return value;
}
};
/// A helper template that ensures the padding in a struct is initialized by memsetting to 0.
template <typename T>
struct HashableStruct {

View File

@ -236,6 +236,7 @@ void DebuggerBackend::Write(const Entry& entry) {
CLS(Render) \
SUB(Render, Software) \
SUB(Render, OpenGL) \
SUB(Render, Vulkan) \
CLS(Audio) \
SUB(Audio, DSP) \
SUB(Audio, Sink) \

View File

@ -4,8 +4,8 @@
#pragma once
#include <type_traits>
#include <fmt/format.h>
#include <type_traits>
// adapted from https://github.com/fmtlib/fmt/issues/2704
// a generic formatter for enum classes

View File

@ -8,6 +8,7 @@
#include <array>
#include "common/common_types.h"
#include "common/logging/formatter.h"
namespace Log {
// trims up to and including the last of ../, ..\, src/, src\ in a string
@ -103,6 +104,7 @@ enum class Class : ClassType {
Render, ///< Emulator video output and hardware acceleration
Render_Software, ///< Software renderer backend
Render_OpenGL, ///< OpenGL backend
Render_Vulkan, ///< Vulkan backend
Audio, ///< Audio emulation
Audio_DSP, ///< The HLE and LLE implementations of the DSP
Audio_Sink, ///< Emulator audio output backend

View File

@ -5,6 +5,7 @@
#pragma once
#include <cstdlib>
#include <compare>
#include <type_traits>
namespace Common {

View File

@ -446,7 +446,7 @@ struct Values {
Setting<bool> allow_plugin_loader{true, "allow_plugin_loader"};
// Renderer
SwitchableSetting<GraphicsAPI> graphics_api{GraphicsAPI::OpenGL, "graphics_api"};
SwitchableSetting<GraphicsAPI> graphics_api{GraphicsAPI::Vulkan, "graphics_api"};
SwitchableSetting<bool> use_hw_renderer{true, "use_hw_renderer"};
SwitchableSetting<bool> use_hw_shader{true, "use_hw_shader"};
SwitchableSetting<bool> separable_shader{false, "use_separable_shader"};