Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt update && sudo apt install libgtk-3-0 libwebkit2gtk-4.0-37 --yes
run: sudo apt-get install gtk+-3.0-dev webkit2gtk-4.1-dev --yes

- name: Download Lua runtime
run: ./download-runtime.sh && ./evo version
Expand Down
15 changes: 4 additions & 11 deletions Core/FileFormats/RagnarokGRF.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,13 @@ function RagnarokGRF:DecodeFileName(input)
local pointerToNullTerminatedStringBytes = input

local originalLength = cstring.size(pointerToNullTerminatedStringBytes)
self.preallocatedConversionBuffer:reset()
local ptr, len = self.preallocatedConversionBuffer:reserve(originalLength * 3) -- Worst case (no 4-byte chars exist for EUC-KR)
local result =
iconv.bindings.iconv_convert(pointerToNullTerminatedStringBytes, originalLength, "CP949", "UTF-8", ptr, len)
local numBytesWritten = tonumber(result.num_bytes_written)
self.preallocatedConversionBuffer:commit(numBytesWritten)
local decodedFileName, decodedLength = self.preallocatedConversionBuffer:ref()
local decodedFileName =
iconv.convert(ffi.string(pointerToNullTerminatedStringBytes, originalLength), "CP949", "UTF-8")

local decodedLength = #decodedFileName
assert(decodedLength > 0, "Failed to decode file name (no bytes written while translating from CP949 to UTF-8)")

cstring.tolower(decodedFileName, decodedLength)
cstring.normalize(decodedFileName, decodedLength)

return ffi_string(decodedFileName), originalLength
return self:GetNormalizedFilePath(decodedFileName), originalLength
end

-- To measure (and optimize) the worst-case decompression time, it'll be convenient to find the largest files easily
Expand Down
16 changes: 9 additions & 7 deletions Core/NativeClient/WebGPU/GPU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end

function GPU:RequestAdapter(instance, window)
local adapterOptions = new("WGPURequestAdapterOptions", {
compatibleSurface = glfw.bindings.glfw_get_wgpu_surface(instance, window),
compatibleSurface = glfw.bindings.glfw_create_window_wgpu_surface(instance, window),
powerPreference = ffi.C.WGPUPowerPreference_HighPerformance,
})

Expand Down Expand Up @@ -80,7 +80,7 @@ function GPU:RequestLogicalDevice(adapter, options)
maxSampledTexturesPerShaderStage = GPU.MAX_TEXTURE_ARRAY_SIZE,
maxSamplersPerShaderStage = GPU.MAX_TEXTURE_ARRAY_SIZE,
maxUniformBufferBindingSize = GPU.MAX_UNIFORM_BUFFER_BINDING_SIZE,
maxBindingsPerBindGroup = 2, -- Max. allowed binding index
maxBindingsPerBindGroup = 3, -- Max. allowed binding index
maxDynamicUniformBuffersPerPipelineLayout = 1,
minStorageBufferOffsetAlignment = 32,
minUniformBufferOffsetAlignment = ffi.sizeof("mesh_uniform_t"),
Expand All @@ -102,17 +102,19 @@ function GPU:RequestLogicalDevice(adapter, options)
end
requestedDevice = device
end
webgpu.bindings.wgpu_adapter_request_device(adapter, deviceDescriptor, onDeviceRequested, nil)

-- This is blocking in the wgpu-native implementation, but it might change in the future...
assert(requestedDevice, "onDeviceRequested did not trigger, but it should have")

local function onDeviceError(errorType, message, userdata)
local errorDetails = format("Type: %s, Message: %s", tonumber(errorType), ffi_string(message))
error("Uncaptured device error - " .. errorDetails)
end

webgpu.bindings.wgpu_device_set_uncaptured_error_callback(requestedDevice, onDeviceError, nil)
local jit = require("jit")
jit.off(onDeviceError)

deviceDescriptor.uncapturedErrorCallbackInfo.callback = onDeviceError
webgpu.bindings.wgpu_adapter_request_device(adapter, deviceDescriptor, onDeviceRequested, nil)

-- This is blocking in the wgpu-native implementation, but it might change in the future...

local canUseTextureArrays =
webgpu.bindings.wgpu_device_has_feature(requestedDevice, ffi.C.WGPUNativeFeature_TextureBindingArray)
Expand Down
2 changes: 1 addition & 1 deletion Core/NativeClient/WebGPU/Surface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Surface:Construct(wgpuInstance, wgpuAdapter, wgpuDevice, glfwWindow)
self.wgpuDevice = wgpuDevice
self.glfwWindow = glfwWindow

self.wgpuSurface = glfw.bindings.glfw_get_wgpu_surface(wgpuInstance, glfwWindow)
self.wgpuSurface = glfw.bindings.glfw_create_window_wgpu_surface(wgpuInstance, glfwWindow)
self.wgpuSurfaceConfiguration = new("WGPUSurfaceConfiguration")
self.wgpuSurfaceTexture = new("WGPUSurfaceTexture")
self.wgpuTextureViewDescriptor = new("WGPUTextureViewDescriptor")
Expand Down
2 changes: 1 addition & 1 deletion download-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set -e

GITHUB_ORGANIZATION="evo-lua"
GITHUB_REPOSITORY="evo-runtime"
REQUIRED_RUNTIME_VERSION="v0.0.20"
REQUIRED_RUNTIME_VERSION="v0.0.22"

PLATFORM=$(uname)
ARCHITECTURE=$(uname -m)
Expand Down
Loading