Skip to content
Permalink
Browse files
8276905: Use appropriate macosx_version_minimum value while compiling…
… metal shaders

Backport-of: 9a9a157a7d45cbfb016d4427931e1d5345210f7a
  • Loading branch information
jayathirthrao committed Nov 19, 2021
1 parent 55f8d8c commit 19201da54cae257d34d610fe76ebef78fb7668a5
Showing 1 changed file with 16 additions and 1 deletion.
@@ -834,6 +834,19 @@ endif

################################################################################

# MACOSX_METAL_VERSION_MIN specifies the lowest version of Macosx
# that should be used to compile Metal shaders. We support Metal
# pipeline only on Macosx >=10.14. For Macosx versions <10.14 even if
# we enable Metal pipeline using -Dsun.java2d.metal=true, at
# runtime we force it to use OpenGL pipeline. And MACOSX_VERSION_MIN
# for aarch64 has always been >10.14 so we use continue to use
# MACOSX_VERSION_MIN for aarch64.
ifeq ($(OPENJDK_TARGET_CPU_ARCH), xaarch64)
MACOSX_METAL_VERSION_MIN=$(MACOSX_VERSION_MIN)
else
MACOSX_METAL_VERSION_MIN=10.14.0
endif

ifeq ($(call isTargetOs, macosx), true)
SHADERS_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/shaders.metal
SHADERS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libosxui
@@ -845,7 +858,9 @@ ifeq ($(call isTargetOs, macosx), true)
DEPS := $(SHADERS_SRC), \
OUTPUT_FILE := $(SHADERS_AIR), \
SUPPORT_DIR := $(SHADERS_SUPPORT_DIR), \
COMMAND := $(METAL) -c -std=osx-metal2.0 -o $(SHADERS_AIR) $(SHADERS_SRC), \
COMMAND := $(METAL) -c -std=osx-metal2.0 \
-mmacosx-version-min=$(MACOSX_METAL_VERSION_MIN) \
-o $(SHADERS_AIR) $(SHADERS_SRC), \
))

$(eval $(call SetupExecute, metallib_shaders, \

1 comment on commit 19201da

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 19201da Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.