From d26fcbdda30cb7335b4ccfa10d5f9b34f3415586 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Fri, 21 Jul 2023 02:19:19 +0200 Subject: [PATCH] remove unsafe garbage, i'll just wait for pr 3626 instead --- kubi/src/rendering/world.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/kubi/src/rendering/world.rs b/kubi/src/rendering/world.rs index 72d8c05..1d47d01 100644 --- a/kubi/src/rendering/world.rs +++ b/kubi/src/rendering/world.rs @@ -1,6 +1,6 @@ use glam::{Vec3, Mat4, Quat, ivec3}; use shipyard::{NonSendSync, UniqueView, UniqueViewMut, View, IntoIter, track, Unique, AllStoragesView}; -use wgpu::{util::DeviceExt, RenderPass}; +use wgpu::util::DeviceExt; use crate::{ camera::Camera, player::MainPlayer, @@ -147,8 +147,8 @@ pub fn init_gpu_data( storages.add_unique(GpuData { pipeline, uniform_buffer, bind_group }); } -pub fn draw_world( - render_pass: &mut RenderPass, +pub fn draw_world ( + render_pass: &mut wgpu::RenderPass, renderer: UniqueView, gpu_data: UniqueView, chunks: UniqueView, @@ -167,10 +167,8 @@ pub fn draw_world( //Draw chunk mesh for (&position, chunk) in &chunks.chunks { - // //! //TODO THIS IS PROBABLY UB - // AND I DONT FUCKING CARE - let mesh = unsafe { yolo(meshes.get(key).expect("Mesh index pointing to nothing")) }; - let gpu_data = unsafe { yolo(gpu_data.as_ref()) }; + let mesh = meshes.get(key).expect("Mesh index pointing to nothing"); + let gpu_data = gpu_data.as_ref(); render_pass.set_pipeline(&gpu_data.pipeline); render_pass.set_bind_group(0, &gpu_data.bind_group, &[]); render_pass.set_vertex_buffer(0, mesh.vertex_buffer.slice(..));