From: Brendan Shanks bshanks@codeweavers.com
--- configure.ac | 26 ++++++++------------------ dlls/winemac.drv/cocoa_window.m | 16 ---------------- dlls/winemac.drv/macdrv_cocoa.h | 4 ---- 3 files changed, 8 insertions(+), 38 deletions(-)
diff --git a/configure.ac b/configure.ac index 8689c7ba425..cff8fba397a 100644 --- a/configure.ac +++ b/configure.ac @@ -669,9 +669,6 @@ case $host_os in ;;
darwin*|macosx*) - AC_LANG_PUSH([Objective C]) - AC_CHECK_HEADERS(Metal/Metal.h) - AC_LANG_POP([Objective C]) LIBEXT="dylib" DLLFLAGS="$DLLFLAGS -fPIC" LDDLLFLAGS="-fPIC" @@ -681,6 +678,7 @@ case $host_os in AC_SUBST(COREFOUNDATION_LIBS,"-framework CoreFoundation") AC_SUBST(DISKARBITRATION_LIBS,"-framework DiskArbitration -framework CoreFoundation") AC_SUBST(IOKIT_LIBS,"-framework IOKit -framework CoreFoundation") + AC_SUBST(METAL_LIBS,"-framework Metal") AC_SUBST(APPLICATIONSERVICES_LIBS,"-framework ApplicationServices") AC_SUBST(CORESERVICES_LIBS,"-framework CoreServices") AC_SUBST(APPKIT_LIBS,"-framework AppKit") @@ -723,22 +721,14 @@ case $host_os in ac_cv_lib_OpenCL_clGetPlatformInfo=yes fi
- if test "$ac_cv_header_Metal_Metal_h" = "yes" - then - AC_SUBST(METAL_LIBS,"-framework Metal") - fi - dnl Check for MTLDevice registryID property - if test "$ac_cv_header_Metal_Metal_h" = "yes" - then - AC_MSG_CHECKING([whether MTLDevice protocol supports registryID property]) - AC_LANG_PUSH([Objective C]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Metal/Metal.h>]], [[id<MTLDevice> device; device.registryID;]])], - [AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MTLDEVICE_REGISTRYID, 1, [Define if MTLDevice protocol has registryID property.])], - [AC_MSG_RESULT(no)]) - AC_LANG_POP([Objective C]) - fi + AC_MSG_CHECKING([whether MTLDevice protocol supports registryID property]) + AC_LANG_PUSH([Objective C]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Metal/Metal.h>]], [[id<MTLDevice> device; device.registryID;]])], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_MTLDEVICE_REGISTRYID, 1, [Define if MTLDevice protocol has registryID property.])], + [AC_MSG_RESULT(no)]) + AC_LANG_POP([Objective C])
UNIXLDFLAGS="-dynamiclib -install_name @rpath/$(UNIXLIB) -Wl,-rpath,@loader_path/" AC_SUBST(LIBWINE_SHAREDLIB,"libwine.$libwine_version.dylib") diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index bfa7e2fe8cc..2525c894d09 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -23,9 +23,7 @@ #define GL_SILENCE_DEPRECATION #import <Carbon/Carbon.h> #import <CoreVideo/CoreVideo.h> -#ifdef HAVE_METAL_METAL_H #import <Metal/Metal.h> -#endif #import <QuartzCore/QuartzCore.h>
#import "cocoa_window.h" @@ -339,7 +337,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi @end
-#ifdef HAVE_METAL_METAL_H @interface WineMetalView : WineBaseView { id<MTLDevice> _device; @@ -348,7 +345,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi - (id) initWithFrame:(NSRect)frame device:(id<MTLDevice>)device;
@end -#endif
@interface WineContentView : WineBaseView <NSTextInputClient, NSViewLayerContentScaleDelegate> @@ -366,9 +362,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi BOOL _retinaMode; int backingSize[2];
-#ifdef HAVE_METAL_METAL_H WineMetalView *_metalView; -#endif }
@property (readonly, nonatomic) BOOL everHadGLContext; @@ -380,9 +374,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi - (void) wine_getBackingSize:(int*)outBackingSize; - (void) wine_setBackingSize:(const int*)newBackingSize;
-#ifdef HAVE_METAL_METAL_H - (WineMetalView*) newMetalViewWithDevice:(id<MTLDevice>)device; -#endif
@end
@@ -657,7 +649,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi } }
-#ifdef HAVE_METAL_METAL_H - (WineMetalView*) newMetalViewWithDevice:(id<MTLDevice>)device { if (_metalView) return _metalView; @@ -672,7 +663,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
return _metalView; } -#endif
- (void) setRetinaMode:(int)mode { @@ -754,10 +744,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi if (!view->_cachedHasGLDescendantValid || view->_cachedHasGLDescendant) [self invalidateHasGLDescendant]; } -#ifdef HAVE_METAL_METAL_H if (subview == _metalView) _metalView = nil; -#endif [super willRemoveSubview:subview]; }
@@ -904,7 +892,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi @end
-#ifdef HAVE_METAL_METAL_H @implementation WineMetalView
- (id) initWithFrame:(NSRect)frame device:(id<MTLDevice>)device @@ -948,7 +935,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi }
@end -#endif
@implementation WineWindow @@ -3797,7 +3783,6 @@ void macdrv_remove_view_opengl_context(macdrv_view v, macdrv_opengl_context c) [pool release]; }
-#ifdef HAVE_METAL_METAL_H macdrv_metal_device macdrv_create_metal_device(void) { macdrv_metal_device ret; @@ -3853,7 +3838,6 @@ void macdrv_view_release_metal_view(macdrv_metal_view v) [view release]; }); } -#endif
int macdrv_get_view_backing_size(macdrv_view v, int backing_size[2]) { diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h index 27b130ca32e..6196032c08d 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -137,11 +137,9 @@ typedef struct macdrv_opaque_window* macdrv_window; typedef struct macdrv_opaque_event_queue* macdrv_event_queue; typedef struct macdrv_opaque_view* macdrv_view; typedef struct macdrv_opaque_opengl_context* macdrv_opengl_context; -#ifdef HAVE_METAL_METAL_H typedef struct macdrv_opaque_metal_device* macdrv_metal_device; typedef struct macdrv_opaque_metal_view* macdrv_metal_view; typedef struct macdrv_opaque_metal_layer* macdrv_metal_layer; -#endif typedef struct macdrv_opaque_status_item* macdrv_status_item; struct macdrv_event; struct macdrv_query; @@ -589,13 +587,11 @@ extern void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_windo extern void macdrv_set_view_hidden(macdrv_view v, int hidden) DECLSPEC_HIDDEN; extern void macdrv_add_view_opengl_context(macdrv_view v, macdrv_opengl_context c) DECLSPEC_HIDDEN; extern void macdrv_remove_view_opengl_context(macdrv_view v, macdrv_opengl_context c) DECLSPEC_HIDDEN; -#ifdef HAVE_METAL_METAL_H extern macdrv_metal_device macdrv_create_metal_device(void) DECLSPEC_HIDDEN; extern void macdrv_release_metal_device(macdrv_metal_device d) DECLSPEC_HIDDEN; extern macdrv_metal_view macdrv_view_create_metal_view(macdrv_view v, macdrv_metal_device d) DECLSPEC_HIDDEN; extern macdrv_metal_layer macdrv_view_get_metal_layer(macdrv_metal_view v) DECLSPEC_HIDDEN; extern void macdrv_view_release_metal_view(macdrv_metal_view v) DECLSPEC_HIDDEN; -#endif extern int macdrv_get_view_backing_size(macdrv_view v, int backing_size[2]) DECLSPEC_HIDDEN; extern void macdrv_set_view_backing_size(macdrv_view v, const int backing_size[2]) DECLSPEC_HIDDEN; extern uint32_t macdrv_window_background_color(void) DECLSPEC_HIDDEN;