Skip to content

Commit

Permalink
Merge pull request #358 from RagnarokResearchLab/runtime-update-v0.0.18
Browse files Browse the repository at this point in the history
Update the Lua runtime to v0.0.18 (and enable support for M1-based macOS runners)
  • Loading branch information
rdw-software authored Feb 4, 2024
2 parents fab3e72 + a452d46 commit 46192c1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 49 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 0 additions & 45 deletions Core/NativeClient/WebGPU/GPU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 15 additions & 3 deletions download-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ 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"

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*)
Expand All @@ -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"
;;
*)
Expand Down

0 comments on commit 46192c1

Please sign in to comment.