Stop Apple fanboys from asking where is Metal

This commit is contained in:
Edward Li 2022-09-21 02:10:41 +08:00 committed by flyinghead
parent c9c1218234
commit c2e1425209
10 changed files with 22 additions and 16 deletions

View File

@ -17,7 +17,7 @@ option(USE_HOST_LIBZIP "Use host libzip" ON)
option(USE_OPENMP "Use OpenMP if available" ON)
option(USE_VULKAN "Build with Vulkan support" ON)
option(LIBRETRO "Build libretro core" OFF)
option(USE_OPENGL "Use Open GL API" ON)
option(USE_OPENGL "Use OpenGL API" ON)
option(USE_VIDEOCORE "RPI: use the legacy Broadcom GLES libraries" OFF)
option(APPLE_BREAKPAD "macOS: Build breakpad client and dump symbols" OFF)

View File

@ -125,7 +125,7 @@ public:
#define clamp(minv, maxv, x) ((x) < (minv) ? (minv) : (x) > (maxv) ? (maxv) : (x))
// Open GL
// OpenGL
struct RGBAPacker {
static u32 pack(u8 r, u8 g, u8 b, u8 a) {
return r | (g << 8) | (b << 16) | (a << 24);
@ -485,7 +485,7 @@ constexpr TexConvFP32 texPAL4_VQ32 = texture_VQ<ConvertTwiddlePal4<UnpackerPalTo
constexpr TexConvFP32 texPAL8_VQ32 = texture_VQ<ConvertTwiddlePal8<UnpackerPalToRgb<u32>>>;
namespace opengl {
// Open GL
// OpenGL
//Planar
constexpr TexConvFP tex1555_PL = texture_PL<ConvertPlanar<Unpacker1555>>;

View File

@ -18,7 +18,7 @@
*/
#pragma once
// GLSL code for poly params handling, used by Open GL and Vulkan per-pixel renderers
// GLSL code for poly params handling, used by OpenGL and Vulkan per-pixel renderers
#define OIT_POLY_PARAM " \n\
struct Pixel { \n\

View File

@ -541,7 +541,7 @@ void findGLVersion()
}
#endif
gl.mesa_nouveau = strstr((const char *)glGetString(GL_VERSION), "Mesa") != nullptr && !strcmp((const char *)glGetString(GL_VENDOR), "nouveau");
NOTICE_LOG(RENDERER, "Open GL%s version %d.%d", gl.is_gles ? "ES" : "", gl.gl_major, gl.gl_minor);
NOTICE_LOG(RENDERER, "OpenGL%s version %d.%d", gl.is_gles ? " ES" : "", gl.gl_major, gl.gl_minor);
while (glGetError() != GL_NO_ERROR)
;
}

View File

@ -52,7 +52,7 @@ void TextureCacheData::UploadToGPU(int width, int height, u8 *temp_tex_buffer, b
dim >>= 1;
}
#if !defined(GLES2) && (!defined(__APPLE__) || defined(TARGET_IPHONE))
// Open GL 4.2 or GLES 3.0 min
// OpenGL 4.2 or GLES 3.0 min
if (gl.gl_major > 4 || (gl.gl_major == 4 && gl.gl_minor >= 2)
|| (gl.is_gles && gl.gl_major >= 3))
{

View File

@ -1785,11 +1785,17 @@ static void gui_display_settings()
ImGui::Text("Graphics API:");
ImGui::Columns(apiCount, "renderApi", false);
#ifdef USE_OPENGL
ImGui::RadioButton("Open GL", &renderApi, 0);
ImGui::RadioButton("OpenGL", &renderApi, 0);
ImGui::NextColumn();
#endif
#ifdef USE_VULKAN
#ifdef __APPLE__
ImGui::RadioButton("Vulkan (Metal)", &renderApi, 1);
ImGui::SameLine(0, style.ItemInnerSpacing.x);
ShowHelpMarker("MoltenVK: An implementation of Vulkan that runs on Apple's Metal graphics framework");
#else
ImGui::RadioButton("Vulkan", &renderApi, 1);
#endif // __APPLE__
ImGui::NextColumn();
#endif
#ifdef USE_DX9
@ -2251,7 +2257,7 @@ static void gui_display_settings()
}
ImGui::Spacing();
if (isOpenGL(config::RendererType))
header("Open GL");
header("OpenGL");
else if (isVulkan(config::RendererType))
header("Vulkan");
else if (isDirectX(config::RendererType))

View File

@ -28,7 +28,7 @@
// Dreamcast:
// +Y is down
// Open GL:
// OpenGL:
// +Y is up in clip, NDC and framebuffer coordinates
// Vulkan:
// +Y is down in clip, NDC and framebuffer coordinates

View File

@ -41,8 +41,8 @@ void initRenderApi(void *window, void *display)
theVulkanContext.setWindow(window, display);
if (theVulkanContext.init())
return;
// Fall back to Open GL
WARN_LOG(RENDERER, "Vulkan init failed. Falling back to Open GL.");
// Fall back to OpenGL
WARN_LOG(RENDERER, "Vulkan init failed. Falling back to OpenGL.");
config::RendererType = RenderType::OpenGL;
}
#endif
@ -62,8 +62,8 @@ void initRenderApi(void *window, void *display)
theDXContext.setWindow(window, display);
if (theDXContext.init())
return;
// Fall back to Open GL
WARN_LOG(RENDERER, "DirectX 9 init failed. Falling back to Open GL.");
// Fall back to OpenGL
WARN_LOG(RENDERER, "DirectX 9 init failed. Falling back to OpenGL.");
config::RendererType = RenderType::OpenGL;
}
#endif

View File

@ -90,7 +90,7 @@ bool WGLGraphicsContext::init()
if (!ourOpenGLRenderingContext)
{
INFO_LOG(RENDERER, "Open GL 4.3 not supported");
INFO_LOG(RENDERER, "OpenGL 4.3 not supported");
// Try Gl 3.1
attribs[1] = 3;
attribs[3] = 1;

View File

@ -60,14 +60,14 @@ bool XGLGraphicsContext::init()
context = glXCreateContextAttribsARB((Display *)display, *framebufferConfigs, 0, True, context_attribs);
if (!context)
{
INFO_LOG(RENDERER, "Open GL 4.3 not supported");
INFO_LOG(RENDERER, "OpenGL 4.3 not supported");
// Try GL 3.0
context_attribs[1] = 3;
context_attribs[3] = 0;
context = glXCreateContextAttribsARB((Display *)display, *framebufferConfigs, 0, True, context_attribs);
if (!context)
{
ERROR_LOG(RENDERER, "Open GL 3.0 not supported\n");
ERROR_LOG(RENDERER, "OpenGL 3.0 not supported\n");
return false;
}
}