Skip to content

Instantly share code, notes, and snippets.

View nical's full-sized avatar

Nicolas Silva nical

  • Mozilla
  • Lyon, France
View GitHub Profile
@nical
nical / wgpu_dyn_resource.rs
Last active January 30, 2024 20:21
wgpu-core dyn trait experiment
// In wgpu_core
pub mod core {
use crate::hal::HalDeviceFactory;
use super::hal;
use std::{cell::UnsafeCell, sync::Arc};
pub struct Error;
impl From<hal::Error> for Error {
@nical
nical / .md
Created October 10, 2023 15:48
Rust internal compiler error - incremental compilation error with mir_built
error: internal compiler error: encountered incremental compilation error with mir_built(ab0055d43b79392f-71e52b8a4392be8c)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p wgpu_core` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information

thread 'rustc' panicked at 'Found unstable fingerprints for mir_built(ab0055d43b79392f-71e52b8a4392be8c): Steal { value: RwLock(RefCell { value: Some(Body { basic_blocks: BasicBlocks { basic_blocks: [BasicBlockData { statements: [StorageLive(_3), _3 = std::option::Option::<id::Id<resource::QuerySet<wgpu_hal::empty::Api>>>::None, FakeRead(ForLet(None), _3), AscribeUserType(_3, o, UserTypeProjection { base: UserType(1), projs: [] }), StorageLive(_4), _4 = std::option::Option::<wgpu_types::QuerySetDescriptor<std::option::Option<std::borrow::Cow<'_, str>>>>::None, FakeRea
time: 0.067; rss: 49MB parsing
time: 0.000; rss: 49MB attributes injection
time: 0.000; rss: 49MB garbage collect incremental cache directory
time: 0.000; rss: 49MB recursion limit
time: 0.000; rss: 49MB crate injection
time: 0.000; rss: 49MB plugin loading
time: 0.000; rss: 49MB plugin registration
time: 0.001; rss: 49MB pre ast expansion lint checks
time: 2.078; rss: 1083MB background load prev dep-graph
time: 5.442; rss: 1525MB expand crate
time: 0.086; rss: 50MB parsing
time: 0.000; rss: 50MB attributes injection
time: 0.000; rss: 50MB garbage collect incremental cache directory
time: 0.000; rss: 50MB recursion limit
time: 0.000; rss: 50MB crate injection
time: 0.000; rss: 50MB plugin loading
time: 0.000; rss: 50MB plugin registration
time: 0.000; rss: 50MB background load prev dep-graph
time: 0.001; rss: 50MB pre ast expansion lint checks
time: 5.661; rss: 797MB expand crate
struct Test {
header: NativeInstanceHeader,
frame_count: u64,
}
impl Test {
fn new(header: NativeInstanceHeader) -> Self {
Test {
header,
@nical
nical / test.rs
Created November 22, 2016 18:01
image off by 1 bug
extern crate webrender;
extern crate glutin;
extern crate gleam;
extern crate webrender_traits;
extern crate euclid;
use euclid::{Size2D, Point2D, Rect, Matrix4D};
use gleam::gl;
use std::path::PathBuf;
use std::ffi::CStr;
@nical
nical / vector_traits.rs
Created August 30, 2016 14:22
Prototype proposal for a minimal set of 2d/3d vector traits
//! Common traits for euclidian 2D/3D vector math.
//!
//! The traits aren't meant to provide mathematical abstractions, but rather expose a basic and
//! minimal set of vector math APIs that existing vector crates could agree on and implement.
//! Think of it as a way to paper over the annoyingly fragmented state of vector math in the
//! rust ecosystem.
//!
//! Other crates meant to provide high level algebraic abstractions could be implemented on top of
//! this and automatically work with any vector library that agreed on this minimal set of traits.