This file contains 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
#![feature( | |
allocator_api, | |
slice_ptr_get, | |
slice_ptr_len, | |
ptr_metadata, | |
maybe_uninit_uninit_array, | |
)] | |
use core::{ | |
alloc::{Layout, AllocError}, |
This file contains 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 core::{ | |
ops::{Shr, ShrAssign, Shl, ShlAssign, BitOr, BitOrAssign}, | |
hash::Hash, | |
fmt, | |
}; | |
macro_rules! impl_uint { | |
($int_ty:ty: [$($bits:literal),*]) => { | |
$( | |
impl Uint for u<$bits> { |
This file contains 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::{ | |
cell::UnsafeCell, | |
fmt::{self, Debug}, | |
marker::PhantomData, | |
mem::self, | |
ops::{Deref, DerefMut}, | |
ptr::NonNull, | |
}; |
This file contains 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::ops::{Add, Sub, SubAssign, Mul, Div, Neg, BitOr, BitOrAssign, BitAnd, BitAndAssign}; | |
use std::mem; | |
use std::sync::Arc; | |
#[derive(Debug, Clone)] | |
pub enum Op { | |
Const(f32), | |
X, | |
Y, | |
Z, |
This file contains 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
#version 450 | |
layout(location = 0) in vec4 Vertex_Position; | |
layout(location = 1) in uvec4 Vertex_Normal; | |
layout(location = 2) in uvec4 I_TestInstancing_Property; | |
layout(location = 0) out vec4 v_Position; | |
layout(set = 0, binding = 0) uniform Camera { | |
mat4 ViewProj; | |
}; | |
layout(set = 1, binding = 0) uniform texture2D Texture; |
This file contains 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 crossbeam_queue::SegQueue; | |
use futures::{ | |
future::FutureExt, | |
stream::{FuturesUnordered, StreamExt}, | |
}; | |
use std::{future::Future, pin::Pin, sync::Arc}; | |
type Fut = Pin<Box<dyn Future<Output = Result<wgpu::Buffer, wgpu::BufferAsyncError>>>>; | |
pub struct StagedBuffer { |
This file contains 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 ... | |
pub unsafe trait AllocOwner { | |
fn owns(&self, ptr: NonNull<u8>, layout: Layout) -> bool; | |
} | |
#[derive(Default)] | |
pub struct Local<A> { | |
allocator: UnsafeCell<A>, | |
} |
This file contains 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
pub trait Module { | |
fn id(&self) -> usize; | |
} | |
macro_rules! register { | |
($( $vis:vis static $name:ident: $t:ty = $e:expr; )*) => { | |
$( | |
#[used] | |
$vis static $name: $t = { |
This file contains 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
#![feature(const_type_id, gen_future, const_fn)] | |
use std::any::TypeId; | |
use std::future::get_task_context; | |
// ... | |
// /// Information about the currently-running task. | |
// /// | |
// /// Contexts are always tied to the stack, since they are set up specifically |
This file contains 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
pub struct Function<'a> { | |
signature: &'a FuncSig, | |
module: &'a ModuleInner, | |
instance_inner: &'a mut InstanceInner, | |
func_index: FuncIndex, | |
} |
NewerOlder