update to gfx 0.13
This commit is contained in:
21
src/tile.rs
21
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<D, F, T>(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::<T>(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::<T>(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::<D::Resources>::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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user