[fx] use swiftshader by default on MacOS

Host GPU is still used by default on Linux and can be enabled
on MacOS with --host-gpu flag.

Bug: 47134
Change-Id: If56c705ee7fc1d32e1cf1be9ee219667f295cae7
diff --git a/tools/devshell/emu b/tools/devshell/emu
index 1890a52..973d8da 100755
--- a/tools/devshell/emu
+++ b/tools/devshell/emu
@@ -24,6 +24,7 @@
 ##   -k <authorized_keys_file> SSH authorized keys file, otherwise defaults to //.ssh/authorized_keys
 ##   --audio run with audio hardware added to the virtual machine
 ##   --headless run in headless mode
+##   --host-gpu run with host GPU acceleration
 ##   --software-gpu run without host GPU acceleration
 ##   --debugger pause on launch and wait for a debugger process to attach before resuming
 
@@ -45,7 +46,7 @@
 GRPC=
 RTCFPS="30"
 TURNCFG=""
-GPU="host"
+GPU="auto"
 VULKAN=1
 HTTP=0
 GRPCWEBPROXY_DIR=""
@@ -152,6 +153,9 @@
   --debugger)
     DEBUGGER=1
     ;;
+  --host-gpu)
+    GPU="host"
+    ;;
   --software-gpu)
     GPU="swiftshader_indirect"
     ;;
@@ -206,6 +210,14 @@
   fi
 fi
 
+if [[ "$GPU" == "auto" ]]; then
+  if [[ "$(uname -s)" == "Darwin" ]]; then
+    GPU="swiftshader_indirect"
+  else
+    GPU="host"
+  fi
+fi
+
 case "$FUCHSIA_ARCH" in
 x64)
   ARGS+=("-machine" "q35")