2025年は趣味開発環境の変化が大きかったので備忘録として残しておく。
前提:
- 趣味開発はほぼ毎日している
- 開発するのはコマンドラインツールやライブラリが多い
- 言語はほぼRust
- 開発はほぼAndroid上
With its latest reales qemu added the Venus patches so that virtio-gpu now support venus encapsulation for vulkan. This is one more piece to the puzzle towards full Vulkan support.
An outdated blog post on clollabora described in 2021 how to enable 3D acceleration of Vulkan applications in QEMU through the Venus experimental Vulkan driver for VirtIO-GPU with a local development environment. Following up on the outdated write up, this is how its done today.
Let's start with the brief description of the projects mentioned in the post & extend them:
| // | |
| // KeyboardToolbar.swift | |
| // | |
| // Created by James Sedlacek on 9/20/23. | |
| // | |
| import SwiftUI | |
| import Combine | |
| @Observable |
| # ------------------------------------------------------------------ | |
| # EDIT: I eventually found a faster way to run SD on macOS, via MPSGraph (~0.8s / step on M1 Pro): | |
| # https://github.com/madebyollin/maple-diffusion | |
| # The original CoreML-related code & discussion is preserved below :) | |
| # ------------------------------------------------------------------ | |
| # you too can run stable diffusion on the apple silicon GPU (no ANE sadly) | |
| # | |
| # quick test portraits (each took 50 steps x 2s / step ~= 100s on my M1 Pro): | |
| # * https://i.imgur.com/5ywISvm.png |
Here's how to get your environment set up to:
If you just want to enable GUI debugging of macOS Rust projects in Xcode, I'm not actually sure whether you need cargo-mobile at all. But one benefit of installing it is that it automatically installs rust-xcode-plugin for you, giving you syntax highlighting of Rust sources in Xcode.
明日の下書き
| /*: | |
| This is a concept re-implementation of the @Binding and @State property wrappers from SwiftUI | |
| The only purpose of this code is to implement those wrappers myself | |
| just to understand how they work internally and why they are needed, | |
| ⚠️ This is not supposed to be a reference implementation nor cover all | |
| subtleties of the real Binding and State types. | |
| The only purpose of this playground is to show how re-implementing | |
| them myself has helped me understand the whole thing better |
📝 企業を調べる時のメモ書きです。
| SDK = xcrun -sdk macosx | |
| all: compute.metallib compute | |
| compute.metallib: Compute.metal | |
| # Metal intermediate representation (.air) | |
| $(SDK) metal -c -Wall -Wextra -std=osx-metal2.0 -o /tmp/Compute.air $^ | |
| # Metal library (.metallib) | |
| $(SDK) metallib -o $@ /tmp/Compute.air |