pub fn glam_mat4_mul(lhs: glam::Mat4, rhs: glam::Mat4) -> glam::Mat4 {
lhs * rhs
}
pub fn nalgebra_mat4_mul(
lhs: nalgebra::Matrix4<f32>,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::any::Any; | |
use std::fmt::Debug; | |
use std::marker::PhantomData; | |
// use std::ops::Mul; | |
pub trait Scalar: Copy + PartialEq + Debug + Any {} | |
impl Scalar for f64 {} | |
pub trait Dim: Any + Debug + Copy + PartialEq + Send {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// test_dynamic.rs | |
#![crate_type="lib"] | |
#[cfg(target_arch = "x86")] | |
use std::arch::x86::*; | |
#[cfg(target_arch = "x86_64")] | |
use std::arch::x86_64::*; | |
pub fn add_scalar(a: &[f32], b: &[f32], c: &mut [f32]) { | |
for ((a, b), c) in a.iter().zip(b.iter()).zip(c.iter_mut()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use glam; | |
use rand::{thread_rng, Rng}; | |
fn rand_angle<R: Rng>(rng: &mut R) -> f32 { | |
rng.gen_range(-std::f32::consts::PI, std::f32::consts::PI) | |
} | |
fn rand_quat<R: Rng>(rng: &mut R) -> glam::Quat { | |
let yaw = rand_angle(rng); | |
let pitch = rand_angle(rng); |
I'm generating spriv of glam master branch versus glam refactor branch and overriding what glam rust-gpu is using via a .cargo/config
overrive.
This is with Vec3 being repr(simd) on master.
I'm compiling using cargo run --bin example-runner-wgpu
.
File sizes when built with master:
cam@zx:~/Projects/rust-gpu (main)$ ls -lah target/spirv-builder/spirv-unknown-unknown/release/*.spv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; id = {0xffffffff}, range = [0x000000018008f810-0x000000018008fab0), name="fmaf" | |
; Source location: unknown | |
7FFF8B1DF810: 48 8B C4 movq %rsp, %rax | |
7FFF8B1DF813: 55 pushq %rbp | |
7FFF8B1DF814: 53 pushq %rbx | |
7FFF8B1DF815: 56 pushq %rsi | |
7FFF8B1DF816: 57 pushq %rdi | |
7FFF8B1DF817: 41 56 pushq %r14 | |
7FFF8B1DF819: 48 8D 68 A1 leaq -0x5f(%rax), %rbp | |
7FFF8B1DF81D: 48 81 EC B0 00 00 00 subq $0xb0, %rsp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nushell version 0.93.0 | |
# some short flags cannot be added to extern completers due to this bug https://github.com/nushell/nushell/issues/8318 | |
# List Perforce help topics | |
def "nu-complete p4 help topics" [] { | |
[ | |
'add', | |
'annotate', | |
'client', | |
'clients', |
OlderNewer