diff --git a/.github/workflows/macos-workflow.yml b/.github/workflows/macos-workflow.yml index f2803e7af1..ffb3c49b01 100644 --- a/.github/workflows/macos-workflow.yml +++ b/.github/workflows/macos-workflow.yml @@ -101,7 +101,6 @@ jobs: run: | brew update brew install sound-touch portaudio wxmac gtk+3 sdl2 libsamplerate - brew install --cask xquartz # We use its OpenGL headers - name: Generate CMake Files run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_PO=FALSE -B build . diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index b58ad515d3..301aeed596 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -134,9 +134,11 @@ else() find_package(SDL REQUIRED) endif() -if(UNIX) +if(UNIX AND NOT APPLE) find_package(X11 REQUIRED) make_imported_target_if_missing(X11::X11 X11) +endif() +if(UNIX) # Most plugins (if not all) and PCSX2 core need gtk2, so set the required flags if (GTK2_API) find_package(GTK2 REQUIRED gtk) diff --git a/common/src/Utilities/CMakeLists.txt b/common/src/Utilities/CMakeLists.txt index 8f9e00a0e6..c947163972 100644 --- a/common/src/Utilities/CMakeLists.txt +++ b/common/src/Utilities/CMakeLists.txt @@ -105,7 +105,7 @@ foreach(library Utilities Utilities_NO_TLS) add_library(${library} "${UtilitiesFinalSources}") target_link_libraries(${library} PRIVATE ${LIBC_LIBRARIES} PUBLIC wxWidgets::all) target_compile_features(${library} PUBLIC cxx_std_17) - target_include_directories(${library} PUBLIC ../../../3rdparty/include ../../include ../../include/Utilities PRIVATE .) + target_include_directories(${library} PUBLIC ../../../3rdparty/include ../../include PRIVATE ../../include/Utilities .) if(COMMAND target_precompile_headers) target_precompile_headers(${library} PRIVATE PrecompiledHeader.h) endif() diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index de72770f9d..b86d441d73 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -1315,9 +1315,6 @@ if (APPLE) # Obviously not being able to make those arrays executable would be a problem target_link_options(${Output} PRIVATE -Wl,-segprot,__DATA,rwx,rw) - # MacOS relies on X11's GL headers even though it doesn't use X11 - target_include_directories(${Output} PRIVATE ${X11_INCLUDE_DIR}) - set_target_properties(${Output} PROPERTIES MACOSX_BUNDLE true MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/gui/Resources/Info.plist.in" diff --git a/pcsx2/GS/Renderers/Common/GSRenderer.cpp b/pcsx2/GS/Renderers/Common/GSRenderer.cpp index 31a8f76524..ca9f9f3d71 100644 --- a/pcsx2/GS/Renderers/Common/GSRenderer.cpp +++ b/pcsx2/GS/Renderers/Common/GSRenderer.cpp @@ -15,7 +15,7 @@ #include "PrecompiledHeader.h" #include "GSRenderer.h" -#if defined(__unix__) || defined(__APPLE__) +#if defined(__unix__) #include #endif @@ -547,6 +547,7 @@ void GSRenderer::EndCapture() void GSRenderer::KeyEvent(GSKeyEventData* e) { +#ifndef __APPLE__ // TODO: Add hotkey support on macOS #ifdef _WIN32 m_shift_key = !!(::GetAsyncKeyState(VK_SHIFT) & 0x8000); m_control_key = !!(::GetAsyncKeyState(VK_CONTROL) & 0x8000); @@ -569,7 +570,7 @@ void GSRenderer::KeyEvent(GSKeyEventData* e) int step = m_shift_key ? -1 : 1; -#if defined(__unix__) || defined(__APPLE__) +#if defined(__unix__) #define VK_F5 XK_F5 #define VK_F6 XK_F6 #define VK_DELETE XK_Delete @@ -617,6 +618,7 @@ void GSRenderer::KeyEvent(GSKeyEventData* e) return; } } +#endif // __APPLE__ } void GSRenderer::PurgePool() diff --git a/pcsx2/GS/Renderers/OpenGL/GLLoader.cpp b/pcsx2/GS/Renderers/OpenGL/GLLoader.cpp index 0073a6c6e0..4b15420a6e 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLLoader.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GLLoader.cpp @@ -17,7 +17,15 @@ #include "GLLoader.h" #include "GS.h" -#if defined(__unix__) || defined(__APPLE__) +#ifdef __APPLE__ +# undef glScissorIndexed +# undef glViewportIndexedf +PFNGLSCISSORINDEXEDPROC gs_glScissorIndexed = glScissorIndexed; +PFNGLVIEWPORTINDEXEDFPROC gs_glViewportIndexedf = glViewportIndexedf; +# define glScissorIndexed gs_glScissorIndexed +# define glViewportIndexedf gs_glViewportIndexedf +#endif +#ifdef __unix__ PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate = NULL; #endif PFNGLTEXTUREPAGECOMMITMENTEXTPROC glTexturePageCommitmentEXT = NULL; diff --git a/pcsx2/GS/Renderers/OpenGL/GLLoader.h b/pcsx2/GS/Renderers/OpenGL/GLLoader.h index 80d8e91e67..7109f53d5d 100644 --- a/pcsx2/GS/Renderers/OpenGL/GLLoader.h +++ b/pcsx2/GS/Renderers/OpenGL/GLLoader.h @@ -15,8 +15,13 @@ #pragma once -#include -#include +#ifdef __APPLE__ + #define GL_SILENCE_DEPRECATION + #include +#else + #include + #include +#endif #define GL_TEX_LEVEL_0 (0) #define GL_TEX_LEVEL_1 (1) @@ -87,6 +92,7 @@ #define ENABLE_GL_VERSION_1_4 1 #endif +#ifndef __APPLE__ // macOS provides up to GL 4.1 #define ENABLE_GL_VERSION_1_5 1 #define ENABLE_GL_VERSION_2_0 1 #define ENABLE_GL_VERSION_2_1 1 @@ -96,6 +102,7 @@ #define ENABLE_GL_VERSION_3_3 1 #define ENABLE_GL_VERSION_4_0 1 #define ENABLE_GL_VERSION_4_1 1 +#endif #define ENABLE_GL_VERSION_4_2 1 #define ENABLE_GL_VERSION_4_3 1 #define ENABLE_GL_VERSION_4_4 1 @@ -110,9 +117,17 @@ typedef void(APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); #endif +#ifdef __APPLE__ +// Apple uses weakly-linked dylibs to provide GL symbols +// This means that it's possible for a symbol to be null, but not writable by us +extern PFNGLSCISSORINDEXEDPROC gs_glScissorIndexed; +extern PFNGLVIEWPORTINDEXEDFPROC gs_glViewportIndexedf; +# define glScissorIndexed gs_glScissorIndexed +# define glViewportIndexedf gs_glViewportIndexedf +#endif // It should be done by ENABLE_GL_VERSION_1_4 but it conflicts with the old gl.h -#if defined(__unix__) || defined(__APPLE__) +#ifdef __unix__ extern PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate; #endif extern PFNGLTEXTUREPAGECOMMITMENTEXTPROC glTexturePageCommitmentEXT; diff --git a/pcsx2/GS/Renderers/OpenGL/glext_extra.h b/pcsx2/GS/Renderers/OpenGL/glext_extra.h index 33595d916a..a537124744 100644 --- a/pcsx2/GS/Renderers/OpenGL/glext_extra.h +++ b/pcsx2/GS/Renderers/OpenGL/glext_extra.h @@ -47,6 +47,204 @@ extern "C" { #define GLAPI extern #endif +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif +#endif /* GL_ARB_debug_output */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +#endif +#endif /* GL_ARB_sparse_texture */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 +#define GL_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E +#define GL_NUM_SAMPLE_COUNTS 0x9380 +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); +typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); +GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount); +GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +#endif +#endif /* GL_VERSION_4_2 */ + #ifndef GL_VERSION_4_3 #define GL_VERSION_4_3 1 typedef void(APIENTRY* GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); diff --git a/pcsx2/GS/Window/GSWnd.cpp b/pcsx2/GS/Window/GSWnd.cpp index 5a84bfb026..fe9bea5047 100644 --- a/pcsx2/GS/Window/GSWnd.cpp +++ b/pcsx2/GS/Window/GSWnd.cpp @@ -26,7 +26,7 @@ void GSWndGL::PopulateGlFunction() #include "PFN_WND.h" // GL1.X mess -#if defined(__unix__) || defined(__APPLE__) +#if defined(__unix__) GL_EXT_LOAD(glBlendFuncSeparate); #endif GL_EXT_LOAD_OPT(glTexturePageCommitmentEXT); diff --git a/pcsx2/PAD/Linux/Config.cpp b/pcsx2/PAD/Linux/Config.cpp index 7ce050a982..ee9fd018e9 100644 --- a/pcsx2/PAD/Linux/Config.cpp +++ b/pcsx2/PAD/Linux/Config.cpp @@ -17,9 +17,28 @@ #include "Device.h" #include "keyboard.h" #include "AppConfig.h" +#ifdef __APPLE__ +#include +#endif void DefaultKeyboardValues() { +#ifdef __APPLE__ + set_keyboard_key(0, kVK_ANSI_A, PAD_L2); + set_keyboard_key(0, kVK_ANSI_Semicolon, PAD_R2); + set_keyboard_key(0, kVK_ANSI_W, PAD_L1); + set_keyboard_key(0, kVK_ANSI_P, PAD_R1); + set_keyboard_key(0, kVK_ANSI_I, PAD_TRIANGLE); + set_keyboard_key(0, kVK_ANSI_L, PAD_CIRCLE); + set_keyboard_key(0, kVK_ANSI_K, PAD_CROSS); + set_keyboard_key(0, kVK_ANSI_J, PAD_SQUARE); + set_keyboard_key(0, kVK_ANSI_V, PAD_SELECT); + set_keyboard_key(0, kVK_ANSI_N, PAD_START); + set_keyboard_key(0, kVK_ANSI_E, PAD_UP); + set_keyboard_key(0, kVK_ANSI_F, PAD_RIGHT); + set_keyboard_key(0, kVK_ANSI_D, PAD_DOWN); + set_keyboard_key(0, kVK_ANSI_S, PAD_LEFT); +#else set_keyboard_key(0, XK_a, PAD_L2); set_keyboard_key(0, XK_semicolon, PAD_R2); set_keyboard_key(0, XK_w, PAD_L1); @@ -34,6 +53,7 @@ void DefaultKeyboardValues() set_keyboard_key(0, XK_f, PAD_RIGHT); set_keyboard_key(0, XK_d, PAD_DOWN); set_keyboard_key(0, XK_s, PAD_LEFT); +#endif } void PADSaveConfig() diff --git a/pcsx2/PAD/Linux/PAD.h b/pcsx2/PAD/Linux/PAD.h index f010b22ba6..88ecced8d5 100644 --- a/pcsx2/PAD/Linux/PAD.h +++ b/pcsx2/PAD/Linux/PAD.h @@ -16,7 +16,7 @@ #pragma once #include "Global.h" -#include "mt_queue.h" +#include "Utilities/mt_queue.h" enum PadOptions { diff --git a/pcsx2/PAD/Linux/keyboard.cpp b/pcsx2/PAD/Linux/keyboard.cpp index fbeee4a7d8..1168215f23 100644 --- a/pcsx2/PAD/Linux/keyboard.cpp +++ b/pcsx2/PAD/Linux/keyboard.cpp @@ -21,7 +21,7 @@ #include "Global.h" #include "keyboard.h" -#include "mt_queue.h" +#include "Utilities/mt_queue.h" extern keyEvent event; extern MtQueue g_ev_fifo; diff --git a/pcsx2/PAD/Linux/keyboard.h b/pcsx2/PAD/Linux/keyboard.h index 5ddcd0b819..cfbdb753a0 100644 --- a/pcsx2/PAD/Linux/keyboard.h +++ b/pcsx2/PAD/Linux/keyboard.h @@ -20,12 +20,14 @@ #if defined(__unix__) || defined(__APPLE__) +#ifndef __APPLE__ #include #include #include // x11 is dumb like that #undef DisableScreenSaver +#endif extern void AnalyzeKeyEvent(keyEvent& evt); extern void UpdateKeyboardInput(); diff --git a/pcsx2/PAD/Linux/wx_dialog/opPanel.h b/pcsx2/PAD/Linux/wx_dialog/opPanel.h index a1bbcac125..ffc793bd05 100644 --- a/pcsx2/PAD/Linux/wx_dialog/opPanel.h +++ b/pcsx2/PAD/Linux/wx_dialog/opPanel.h @@ -17,7 +17,7 @@ #include -#include "EmbeddedImage.h" +#include "Utilities/EmbeddedImage.h" enum gui_img {