diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index f1c84b42..98e30a50 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -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 diff --git a/Core/FileFormats/RagnarokGRF.lua b/Core/FileFormats/RagnarokGRF.lua index 46d0f309..bd00ca9c 100644 --- a/Core/FileFormats/RagnarokGRF.lua +++ b/Core/FileFormats/RagnarokGRF.lua @@ -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 diff --git a/Core/NativeClient/WebGPU/GPU.lua b/Core/NativeClient/WebGPU/GPU.lua index 8a7db747..4bb927a0 100644 --- a/Core/NativeClient/WebGPU/GPU.lua +++ b/Core/NativeClient/WebGPU/GPU.lua @@ -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, }) @@ -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"), @@ -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) diff --git a/Core/NativeClient/WebGPU/Surface.lua b/Core/NativeClient/WebGPU/Surface.lua index d8d51e47..96905a3e 100644 --- a/Core/NativeClient/WebGPU/Surface.lua +++ b/Core/NativeClient/WebGPU/Surface.lua @@ -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") diff --git a/download-runtime.sh b/download-runtime.sh index e2c1cbb8..0534d32a 100755 --- a/download-runtime.sh +++ b/download-runtime.sh @@ -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)