Rewrite host GPU abstraction

- Don't have to repeat the same thing for 4 renderers.
 - Add native Metal renderer.
This commit is contained in:
Stenzek
2023-08-13 13:42:02 +10:00
parent bfa792ddbf
commit e3d9ba4c99
249 changed files with 28851 additions and 32222 deletions

View File

@ -15,8 +15,8 @@
#include "common/string_util.h"
#include "common/threading.h"
#include "common/timer.h"
#include "gpu_device.h"
#include "core/host.h"
#include "host_display.h"
#include "fmt/core.h"
#include "imgui_internal.h"
#include "imgui_stdlib.h"
@ -267,8 +267,9 @@ std::optional<Common::RGBA8Image> ImGuiFullscreen::LoadTextureImage(const char*
std::shared_ptr<GPUTexture> ImGuiFullscreen::UploadTexture(const char* path, const Common::RGBA8Image& image)
{
std::unique_ptr<GPUTexture> texture = g_host_display->CreateTexture(
image.GetWidth(), image.GetHeight(), 1, 1, 1, GPUTexture::Format::RGBA8, image.GetPixels(), image.GetPitch());
std::unique_ptr<GPUTexture> texture =
g_gpu_device->CreateTexture(image.GetWidth(), image.GetHeight(), 1, 1, 1, GPUTexture::Type::Texture,
GPUTexture::Format::RGBA8, image.GetPixels(), image.GetPitch());
if (!texture)
{
Log_ErrorPrintf("failed to create %ux%u texture for resource", image.GetWidth(), image.GetHeight());