Skip to content

Instantly share code, notes, and snippets.

@lilly-lizard
lilly-lizard / steam-sysinfo-full
Created March 13, 2023 03:06
Steam system information
Computer Information:
Manufacturer: ASRock
Model: B450 Pro4
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 5 2600 Six-Core Processor
CPU Family: 0x17
@lilly-lizard
lilly-lizard / simple-logger.rs
Last active March 13, 2023 03:07
Simple custom rust logging (using `log` and `colored` crates)
use colored::{Color, Colorize};
use log::{Level, Metadata, Record};
pub struct ConsoleLogger;
impl log::Log for ConsoleLogger {
fn enabled(&self, metadata: &Metadata) -> bool {
metadata.level() <= Level::Info
}
fn log(&self, record: &Record) {
@lilly-lizard
lilly-lizard / glsl-pre-compile-build.rs
Last active March 13, 2023 03:08
Rust build.rs: pre-compile glsl shaders to spirv (using shaderc-rs)
use shaderc::{CompileOptions, Compiler, IncludeType, ResolvedInclude, ShaderKind};
use std::fs::File;
use std::io::{Read, Write};
use std::path::PathBuf;
/// Compile glsl shaders in src/shaders and output spirv binaries to assets/shader_binares.
/// Requirements:
/// - Entry point must be "main".
/// - File extensions must be in the format FILE_NAME.SHADER_STAGE
/// If you install the shaderc libraries on your system you can avoid compiling them in