diff --git a/.github/workflows/ci-mac.yml b/.github/workflows/ci-mac.yml index 84cd52b8..d6500c02 100644 --- a/.github/workflows/ci-mac.yml +++ b/.github/workflows/ci-mac.yml @@ -22,7 +22,15 @@ jobs: build: if: github.event.pull_request.draft == false name: Build for macOS - runs-on: macos-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, macos-14] + include: + - os: macos-latest + arch: x64 + - os: macos-14 + arch: M1 steps: - name: Check out Git repository diff --git a/Core/NativeClient/WebGPU/GPU.lua b/Core/NativeClient/WebGPU/GPU.lua index 3703a0f5..7265329e 100644 --- a/Core/NativeClient/WebGPU/GPU.lua +++ b/Core/NativeClient/WebGPU/GPU.lua @@ -13,51 +13,6 @@ local GPU = { MAX_BUFFER_SIZE = 256 * 1024 * 1024, } --- The FFI bindings don't provide enums for native extensions yet (requires a fix in the runtime) -ffi.cdef([[ - typedef enum WGPUNativeFeature { - WGPUNativeFeature_PushConstants = 0x00030001, - WGPUNativeFeature_TextureAdapterSpecificFormatFeatures = 0x00030002, - WGPUNativeFeature_MultiDrawIndirect = 0x00030003, - WGPUNativeFeature_MultiDrawIndirectCount = 0x00030004, - WGPUNativeFeature_VertexWritableStorage = 0x00030005, - WGPUNativeFeature_TextureBindingArray = 0x00030006, - WGPUNativeFeature_SampledTextureAndStorageBufferArrayNonUniformIndexing = 0x00030007, - WGPUNativeFeature_PipelineStatisticsQuery = 0x00030008, - WGPUNativeFeature_Force32 = 0x7FFFFFFF - } WGPUNativeFeature; - - typedef enum WGPUNativeSType { - // Start at 0003 since that's allocated range for wgpu-native - WGPUSType_DeviceExtras = 0x00030001, - WGPUSType_RequiredLimitsExtras = 0x00030002, - WGPUSType_PipelineLayoutExtras = 0x00030003, - WGPUSType_ShaderModuleGLSLDescriptor = 0x00030004, - WGPUSType_SupportedLimitsExtras = 0x00030005, - WGPUSType_InstanceExtras = 0x00030006, - WGPUSType_BindGroupEntryExtras = 0x00030007, - WGPUSType_BindGroupLayoutEntryExtras = 0x00030008, - WGPUSType_QuerySetDescriptorExtras = 0x00030009, - WGPUSType_SurfaceConfigurationExtras = 0x0003000A, - WGPUNativeSType_Force32 = 0x7FFFFFFF - } WGPUNativeSType; - - typedef struct WGPUBindGroupLayoutEntryExtras { - WGPUChainedStruct chain; - uint32_t count; - } WGPUBindGroupLayoutEntryExtras; - - typedef struct WGPUBindGroupEntryExtras { - WGPUChainedStruct chain; - WGPUBuffer const * buffers; - size_t bufferCount; - WGPUSampler const * samplers; - size_t samplerCount; - WGPUTextureView const * textureViews; - size_t textureViewCount; - } WGPUBindGroupEntryExtras; -]]) - function GPU:CreateInstance() local instanceDescriptor = new("WGPUInstanceDescriptor") local instance = webgpu.bindings.wgpu_create_instance(instanceDescriptor) diff --git a/download-runtime.sh b/download-runtime.sh index f69c24e1..8e598d39 100755 --- a/download-runtime.sh +++ b/download-runtime.sh @@ -2,9 +2,10 @@ set -e GITHUB_ORGANIZATION="evo-lua" GITHUB_REPOSITORY="evo-runtime" -REQUIRED_RUNTIME_VERSION="v0.0.17" +REQUIRED_RUNTIME_VERSION="v0.0.18" PLATFORM=$(uname) +ARCHITECTURE=$(uname -m) echo "Required runtime version: $REQUIRED_RUNTIME_VERSION" @@ -12,7 +13,7 @@ ASSET_FILE_NAME="" EXECUTABLE_NAME="" GITHUB_BASE_URL="https://github.com/$GITHUB_ORGANIZATION/$GITHUB_REPOSITORY/releases/download" -echo "Detected platform: $PLATFORM" +echo "Detected platform: $PLATFORM ($ARCHITECTURE)" case $PLATFORM in MINGW64_NT*|CYGWIN_NT*|MSYS_NT*) @@ -24,7 +25,18 @@ case $PLATFORM in EXECUTABLE_NAME="evo" ;; Darwin) - ASSET_FILE_NAME="evo-macos-x64" + case $ARCHITECTURE in + arm64) + ASSET_FILE_NAME="evo-macos-M1" + ;; + x86_64) + ASSET_FILE_NAME="evo-macos-x64" + ;; + *) + echo "Unsupported architecture: $ARCHITECTURE" + exit 1 + ;; + esac EXECUTABLE_NAME="evo" ;; *)