mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-22 03:48:21 -06:00
lifetime errors :є
This commit is contained in:
parent
58e4eed14e
commit
1d9fafd408
|
@ -36,7 +36,7 @@ impl AssetPaths for BlockTexture {
|
|||
}
|
||||
|
||||
#[derive(Unique)]
|
||||
pub struct Textures {
|
||||
pub struct TexturePrefabs {
|
||||
pub block_diffuse_texture: wgpu::Texture,
|
||||
pub block_diffuse_bind_group: wgpu::BindGroup,
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ pub fn load_prefabs(
|
|||
}
|
||||
]
|
||||
});
|
||||
storages.add_unique_non_send_sync(Textures {
|
||||
storages.add_unique_non_send_sync(TexturePrefabs {
|
||||
block_diffuse_texture,
|
||||
block_diffuse_bind_group,
|
||||
});
|
||||
|
|
|
@ -2,7 +2,13 @@ use bytemuck::{Pod, Zeroable};
|
|||
use glam::{IVec3, Vec3};
|
||||
use shipyard::{AllStoragesView, IntoIter, NonSendSync, Unique, UniqueView, UniqueViewMut, View};
|
||||
use kubi_shared::{chunk::CHUNK_SIZE, transform::Transform};
|
||||
use crate::{camera::Camera, settings::GameSettings, world::{ChunkMeshStorage, ChunkStorage}};
|
||||
use wgpu::util::RenderEncoder;
|
||||
use crate::{
|
||||
camera::Camera,
|
||||
prefabs::TexturePrefabs,
|
||||
settings::GameSettings,
|
||||
world::{ChunkMeshStorage, ChunkStorage},
|
||||
};
|
||||
use super::Renderer;
|
||||
|
||||
#[derive(Clone, Copy, Pod, Zeroable)]
|
||||
|
@ -36,6 +42,7 @@ pub fn init_trans_chunk_queue(storages: AllStoragesView) {
|
|||
|
||||
pub fn draw_world(
|
||||
(render_pass, renderer): (&mut wgpu::RenderPass, &Renderer),
|
||||
textures: UniqueView<TexturePrefabs>,
|
||||
chunks: UniqueView<ChunkStorage>,
|
||||
meshes: NonSendSync<UniqueView<ChunkMeshStorage>>,
|
||||
transform: View<Transform>,
|
||||
|
@ -66,6 +73,7 @@ pub fn draw_world(
|
|||
//Draw chunk mesh
|
||||
if mesh.main.index.size() > 0 {
|
||||
//TODO
|
||||
render_pass.set_bind_group(0, &textures.block_diffuse_bind_group, &[]);
|
||||
}
|
||||
|
||||
//TODO trans chunks
|
||||
|
|
Loading…
Reference in a new issue