From 56e89c9e4fb00b5c2af4536d4c50294608d0c46c Mon Sep 17 00:00:00 2001 From: Radosław Kujawa Date: Sun, 2 Aug 2026 22:04:06 +0200 Subject: Performance improvements, support userspace simulators --- configs/darwin-glide-sim | 38 ++++++++++++++++++++++++++++++++++++++ configs/darwin-osmesa | 28 ++++++++++++++++++++++++++++ configs/darwin-verite-sim | 36 ++++++++++++++++++++++++++++++++++++ configs/linux-glide-sim | 30 ++++++++++++++++++++++++++++++ configs/linux-verite-sim | 29 +++++++++++++++++++++++++++++ configs/netbsd-glide-sim | 29 +++++++++++++++++++++++++++++ configs/netbsd-verite-sim | 28 ++++++++++++++++++++++++++++ 7 files changed, 218 insertions(+) create mode 100644 configs/darwin-glide-sim create mode 100644 configs/darwin-osmesa create mode 100644 configs/darwin-verite-sim create mode 100644 configs/linux-glide-sim create mode 100644 configs/linux-verite-sim create mode 100644 configs/netbsd-glide-sim create mode 100644 configs/netbsd-verite-sim (limited to 'configs') diff --git a/configs/darwin-glide-sim b/configs/darwin-glide-sim new file mode 100644 index 0000000..7cf5559 --- /dev/null +++ b/configs/darwin-glide-sim @@ -0,0 +1,38 @@ +# 3dfx/Glide driver (fxMesa) over the userspace Voodoo simulator +# on macOS +# +# ws3dgl-sim repo built and linked exactly like real Glide, +# with the Glide3 SDK headers coming from its include/. +# +# The whole fxMesa driver stack builds and runs unmodified. +# +# Build the simulator first: gmake -C $(WS3DGL_SIM) +# Then here: gmake darwin-glide-sim + +include $(TOP)/configs/default + +CONFIG_NAME = darwin-glide-sim + +CC = cc +CXX = c++ + +WS3DGL_SIM ?= $(abspath $(TOP)/../ws3dgl-sim) + +CFLAGS = -O2 -fsigned-char -fno-strict-aliasing -ffast-math -g -MMD -MP \ + -I$(WS3DGL_SIM)/include -DFX +CXXFLAGS = $(CFLAGS) + +# no makedepend on macOS +MKDEP = true + +MKLIB_OPTIONS = -static +GL_LIB_NAME = libGL.a +OSMESA_LIB_NAME = libOSMesa.a + +SRC_DIRS = mesa +DRIVER_DIRS = glide-sim +PROGRAM_DIRS = + +GL_LIB_DEPS = +APP_LIB_DEPS = -L$(LIB_DIR) -lGL -lm \ + -L$(WS3DGL_SIM)/lib -lglide3x -Wl,-rpath,$(WS3DGL_SIM)/lib diff --git a/configs/darwin-osmesa b/configs/darwin-osmesa new file mode 100644 index 0000000..2866451 --- /dev/null +++ b/configs/darwin-osmesa @@ -0,0 +1,28 @@ +# Configuration for macOS (arm64 / x86-64), software-only static libOSMesa. +# +# Build with GNU make: gmake darwin-osmesa + +include $(TOP)/configs/default + +CONFIG_NAME = darwin-osmesa + +CC = cc +CXX = c++ + +# -g costs nothing at runtime and lets sample(1)/Instruments attribute +# time to functions inside the static library. +CFLAGS = -O2 -fsigned-char -fno-strict-aliasing -ffast-math -g -MMD -MP +CXXFLAGS = $(CFLAGS) + +# no makedepend on macOS, header deps come from -MMD above +MKDEP = true + +MKLIB_OPTIONS = -static +OSMESA_LIB_NAME = libOSMesa.a + +SRC_DIRS = mesa +DRIVER_DIRS = osmesa +PROGRAM_DIRS = + +OSMESA_LIB_DEPS = +APP_LIB_DEPS = -L$(LIB_DIR) -lOSMesa -lm diff --git a/configs/darwin-verite-sim b/configs/darwin-verite-sim new file mode 100644 index 0000000..505444b --- /dev/null +++ b/configs/darwin-verite-sim @@ -0,0 +1,36 @@ +# Rendition Verite driver over the userspace simulator on macOS +# +# Build the simulator first: gmake -C $(WS3DGL_SIM) +# Then here: gmake darwin-verite-sim +# Run examples with: VERITE_UCODE=sim ./examples/cube +# +# (the simulator ignores the microcode; the driver only requires the +# variable to be set) + +include $(TOP)/configs/default + +CONFIG_NAME = darwin-verite-sim + +CC = cc +CXX = c++ + +WS3DGL_SIM ?= $(abspath $(TOP)/../ws3dgl-sim) + +CFLAGS = -O2 -fsigned-char -fno-strict-aliasing -ffast-math -g -MMD -MP \ + -I$(TOP)/src/mesa/ppc +CXXFLAGS = $(CFLAGS) + +MKDEP = true + +MKLIB_OPTIONS = -static +GL_LIB_NAME = libGL.a +OSMESA_LIB_NAME = libOSMesa.a + +SRC_DIRS = mesa +DRIVER_DIRS = verite-sim +PROGRAM_DIRS = + +# libv3dsim carries its own Metal/Cocoa/MoltenVK dependencies +GL_LIB_DEPS = +APP_LIB_DEPS = -L$(LIB_DIR) -lGL -lm \ + -L$(WS3DGL_SIM)/lib -lv3dsim -Wl,-rpath,$(WS3DGL_SIM)/lib diff --git a/configs/linux-glide-sim b/configs/linux-glide-sim new file mode 100644 index 0000000..44345ce --- /dev/null +++ b/configs/linux-glide-sim @@ -0,0 +1,30 @@ +# 3dfx/Glide driver (fxMesa) over the Voodoo simulator on Linux +# + +include $(TOP)/configs/default + +CONFIG_NAME = linux-glide-sim + +CC = cc +CXX = c++ + +WS3DGL_SIM ?= $(abspath $(TOP)/../ws3dgl-sim) + +CFLAGS = -O2 -fsigned-char -fno-strict-aliasing -ffast-math -g -MMD -MP \ + -I$(WS3DGL_SIM)/include -DFX +CXXFLAGS = $(CFLAGS) + +MKDEP = true + +MKLIB_OPTIONS = -static +GL_LIB_NAME = libGL.a +OSMESA_LIB_NAME = libOSMesa.a + +SRC_DIRS = mesa +DRIVER_DIRS = glide-sim +PROGRAM_DIRS = + +# libglide3x.so carries its own -lvulkan dependency. +GL_LIB_DEPS = +APP_LIB_DEPS = -L$(LIB_DIR) -lGL -lm \ + -L$(WS3DGL_SIM)/lib -lglide3x -Wl,-rpath,$(WS3DGL_SIM)/lib diff --git a/configs/linux-verite-sim b/configs/linux-verite-sim new file mode 100644 index 0000000..1cd5436 --- /dev/null +++ b/configs/linux-verite-sim @@ -0,0 +1,29 @@ +# Rendition Verite driver over the simulator on Linux + +include $(TOP)/configs/default + +CONFIG_NAME = linux-verite-sim + +CC = cc +CXX = c++ + +WS3DGL_SIM ?= $(abspath $(TOP)/../ws3dgl-sim) + +CFLAGS = -O2 -fsigned-char -fno-strict-aliasing -ffast-math -g -MMD -MP \ + -I$(TOP)/src/mesa/ppc +CXXFLAGS = $(CFLAGS) + +MKDEP = true + +MKLIB_OPTIONS = -static +GL_LIB_NAME = libGL.a +OSMESA_LIB_NAME = libOSMesa.a + +SRC_DIRS = mesa +DRIVER_DIRS = verite-sim +PROGRAM_DIRS = + +# libv3dsim.so carries its own -lvulkan dependency. +GL_LIB_DEPS = +APP_LIB_DEPS = -L$(LIB_DIR) -lGL -lm \ + -L$(WS3DGL_SIM)/lib -lv3dsim -Wl,-rpath,$(WS3DGL_SIM)/lib diff --git a/configs/netbsd-glide-sim b/configs/netbsd-glide-sim new file mode 100644 index 0000000..dacb87a --- /dev/null +++ b/configs/netbsd-glide-sim @@ -0,0 +1,29 @@ +# 3dfx/Glide driver (fxMesa) over the Voodoo simulator on NetBSD + +include $(TOP)/configs/default + +CONFIG_NAME = netbsd-glide-sim + +CC = cc +CXX = c++ + +WS3DGL_SIM ?= $(abspath $(TOP)/../ws3dgl-sim) + +CFLAGS = -O2 -fsigned-char -fno-strict-aliasing -ffast-math -g -MMD -MP \ + -I$(WS3DGL_SIM)/include -DFX +CXXFLAGS = $(CFLAGS) + +MKDEP = true + +MKLIB_OPTIONS = -static +GL_LIB_NAME = libGL.a +OSMESA_LIB_NAME = libOSMesa.a + +SRC_DIRS = mesa +DRIVER_DIRS = glide-sim +PROGRAM_DIRS = + +# libglide3x.so carries its own vulkan dependency. +GL_LIB_DEPS = +APP_LIB_DEPS = -L$(LIB_DIR) -lGL -lm \ + -L$(WS3DGL_SIM)/lib -lglide3x -Wl,-R$(WS3DGL_SIM)/lib diff --git a/configs/netbsd-verite-sim b/configs/netbsd-verite-sim new file mode 100644 index 0000000..cbf0ee8 --- /dev/null +++ b/configs/netbsd-verite-sim @@ -0,0 +1,28 @@ +# Rendition Verite driver over the simulator on NetBSD +include $(TOP)/configs/default + +CONFIG_NAME = netbsd-verite-sim + +CC = cc +CXX = c++ + +WS3DGL_SIM ?= $(abspath $(TOP)/../ws3dgl-sim) + +CFLAGS = -O2 -fsigned-char -fno-strict-aliasing -ffast-math -g -MMD -MP \ + -I$(TOP)/src/mesa/ppc +CXXFLAGS = $(CFLAGS) + +MKDEP = true + +MKLIB_OPTIONS = -static +GL_LIB_NAME = libGL.a +OSMESA_LIB_NAME = libOSMesa.a + +SRC_DIRS = mesa +DRIVER_DIRS = verite-sim +PROGRAM_DIRS = + +# libv3dsim.so carries its own vulkan dependency. +GL_LIB_DEPS = +APP_LIB_DEPS = -L$(LIB_DIR) -lGL -lm \ + -L$(WS3DGL_SIM)/lib -lv3dsim -Wl,-R$(WS3DGL_SIM)/lib -- cgit