Rewrite host GPU abstraction
- Don't have to repeat the same thing for 4 renderers. - Add native Metal renderer.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "host_display.h"
|
||||
#include "gpu_device.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@@ -20,10 +20,15 @@ public:
|
||||
std::string GenerateUVQuadVertexShader();
|
||||
std::string GenerateFillFragmentShader();
|
||||
std::string GenerateCopyFragmentShader();
|
||||
std::string GenerateSampleFragmentShader();
|
||||
std::string GenerateDisplayVertexShader();
|
||||
std::string GenerateDisplayFragmentShader(bool set_alpha_to_one = false);
|
||||
|
||||
std::string GenerateImGuiVertexShader();
|
||||
std::string GenerateImGuiFragmentShader();
|
||||
|
||||
protected:
|
||||
ALWAYS_INLINE bool IsVulkan() const { return (m_render_api == RenderAPI::Vulkan); }
|
||||
ALWAYS_INLINE bool IsMetal() const { return (m_render_api == RenderAPI::Metal); }
|
||||
|
||||
const char* GetInterpolationQualifier(bool interface_block, bool centroid_interpolation, bool sample_interpolation,
|
||||
bool is_out) const;
|
||||
@@ -52,9 +57,11 @@ protected:
|
||||
|
||||
RenderAPI m_render_api;
|
||||
bool m_glsl;
|
||||
bool m_spirv;
|
||||
bool m_supports_dual_source_blend;
|
||||
bool m_use_glsl_interface_blocks;
|
||||
bool m_use_glsl_binding_layout;
|
||||
bool m_has_uniform_buffer = false;
|
||||
|
||||
std::string m_glsl_version_string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user