Here is a simple fragment shader with uniform buffers:
const std = @import("std");
const gpu = std.gpu;
const UBO = extern struct {
object_color: @Vector(4, f32),
light_color: @Vector(4, f32),| import os | |
| import sys | |
| import time | |
| import math | |
| import pickle | |
| from contextlib import nullcontext | |
| from pathlib import Path | |
| import subprocess | |
| from dataclasses import dataclass | |
| import inspect |
| // This is for the Zig 0.15. | |
| // See https://gist.github.com/karlseguin/c6bea5b35e4e8d26af6f81c22cb5d76b/1f317ebc9cd09bc50fd5591d09c34255e15d1d85 | |
| // for a version that workson Zig 0.14.1. | |
| // in your build.zig, you can specify a custom test runner: | |
| // const tests = b.addTest(.{ | |
| // .root_module = $MODULE_BEING_TESTED, | |
| // .test_runner = .{ .path = b.path("test_runner.zig"), .mode = .simple }, | |
| // }); |
| #![feature(fn_traits, unboxed_closures)] | |
| macro_rules! orelse { | |
| (($($lhs:tt)+), $rhs:tt) => {$($lhs)+}; | |
| ((), ($($rhs:tt)*)) => {$($rhs)*} | |
| } | |
| macro_rules! overload { | |
| ( | |
| $v:vis fn $fn_name:ident { |
| version: "3" | |
| services: | |
| vpn: | |
| image: qmcgaw/gluetun | |
| container_name: vpn | |
| cap_add: | |
| - NET_ADMIN | |
| ports: | |
| - 8888:8888/tcp # HTTP proxy | |
| - 8388:8388/tcp # Shadowsocks |
Podman is such a cool project! However, there is no easy way to setup the nvidia-container-runtime and podman so that we can run unprivileged container in a gpu host. This is specially interesting in environments with multiple people accessing the same host (strong isolation between containers!!!).
Ubuntu: add-apt-repository -y ppa:projectatomic/ppa && apt install podman buildah skopeo
| package; | |
| import haxe.io.Bytes; | |
| import lime.utils.UInt8Array; | |
| import lime.graphics.Image; | |
| import lime.graphics.ImageBuffer; | |
| import openfl.Assets.AssetLibrary; | |
| import openfl.Assets; | |
| import openfl.Lib; | |
| import openfl.utils.ByteArray; |