diff --git a/src/scenes/world.rs b/src/scenes/world.rs index c8be8d8..faab0b2 100644 --- a/src/scenes/world.rs +++ b/src/scenes/world.rs @@ -11,7 +11,7 @@ use std::collections::BTreeMap; use std::marker::PhantomData; use std::time::SystemTime; -use gfx::{self, tex}; +use gfx::{self, texture}; use gfx::traits::FactoryExt; use na::{self, ToHomogeneous}; use num_traits::identities::One; @@ -164,8 +164,8 @@ impl> WorldScene { constants_dirty: true, locals: factory.create_constant_buffer(1), atlas: tile::get_tiles::<_, _, view::ColorFormat>(device, factory, aux_command), - sampler: factory.create_sampler(tex::SamplerInfo::new(tex::FilterMethod::Jrd, - tex::WrapMode::Tile)), + sampler: factory.create_sampler(texture::SamplerInfo::new(texture::FilterMethod::Jrd, + texture::WrapMode::Tile)), f: PhantomData, vbuf: vertex_buffer, diff --git a/src/tile.rs b/src/tile.rs index 57a15a8..d2a636d 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -4,8 +4,8 @@ use ::std; use std::io::Read; use std::path::Path; -use gfx::{self, CommandBuffer, Typed}; -use gfx::tex; +use gfx::{self, texture, CommandBuffer}; +use gfx::memory::Typed; const TILEDIM: u16 = 16; @@ -30,18 +30,21 @@ pub fn get_tiles(device: &mut D, let ega_page = ega::decode(&ega_bytes, ega::Compression::Uncompressed, ega::Tiling::Tiled(TILEDIM)); let mipmap = ega_page.mipmap(2); - let tex = factory.create_texture_const_u8::(tex::Kind::D2Array(mipmap.dim as u16, - mipmap.dim as u16, - mipmap.len as u16, - tex::AaMode::Single), - &mipmap.slices()) - .expect("create tile texture"); + let tex = factory.create_texture_immutable_u8::(texture::Kind::D2Array(mipmap.dim as u16, + mipmap.dim as u16, + mipmap.len as u16, + texture::AaMode::Single), + &mipmap.slices()) + .expect("create tile texture"); { let mut manager = gfx::handle::Manager::::new(); + // XXX: Find out if Textures need to be/can be fenced like Buffers, + // Seems like I should mark tex.1 as being read/written, but it's not a Buffer? + let access = gfx::pso::AccessInfo::new(); let view = manager.ref_srv(tex.1.raw()); command.generate_mipmap(*view); - device.submit(command); + device.submit(command, &access); } tex.1 } diff --git a/src/vr.rs b/src/vr.rs index 8764357..80f1af6 100644 --- a/src/vr.rs +++ b/src/vr.rs @@ -6,7 +6,8 @@ pub use self::vr::Eye; pub use self::vr::common::Size; pub use self::openvr_sys::VRControllerState_t; -use gfx::{self, tex, Factory, Typed}; +use gfx::{self, texture, Factory}; +use gfx::memory::Typed; use na::{self, Inverse}; use num_traits::identities::Zero; use num_traits::identities::One; @@ -153,15 +154,15 @@ pub fn create_eyebuffer(factory: &mut gfx_device_gl::Factory, where T: gfx::format::RenderFormat + gfx::format::TextureFormat, D: gfx::format::DepthFormat + gfx::format::TextureFormat { let tex = factory - .create_texture(tex::Kind::D2(size.width as tex::Size, - size.height as tex::Size, - tex::AaMode::Single), + .create_texture(texture::Kind::D2(size.width as texture::Size, + size.height as texture::Size, + texture::AaMode::Single), 1, // levels gfx::RENDER_TARGET, // bind - gfx::Usage::GpuOnly, // Usage + gfx::memory::Usage::GpuOnly, // Usage Some(::get_channel_type()))?; // hint: format::ChannelType? let tgt = factory.view_texture_as_render_target(&tex, 0, None)?; - let depth = factory.create_depth_stencil_view_only(size.width as tex::Size, - size.height as tex::Size)?; + let depth = factory.create_depth_stencil_view_only(size.width as texture::Size, + size.height as texture::Size)?; Ok(EyeBuffer { tex: tex, target: tgt, depth: depth }) }