engine/util: separate into rust_library
parent
4e1cd3d4aa
commit
f46c925e1f
|
@ -39,14 +39,9 @@ rust_library(
|
|||
"render/vulkan/surface_binding.rs",
|
||||
"render/vulkan/swapchain_binding.rs",
|
||||
"render/vulkan/worker.rs",
|
||||
|
||||
"util/mod.rs",
|
||||
"util/counter.rs",
|
||||
"util/file.rs",
|
||||
"util/profiler.rs",
|
||||
"util/resourcemap.rs",
|
||||
],
|
||||
deps = [
|
||||
"//engine/util",
|
||||
"//lib/ecs",
|
||||
"//third_party/cargo:cgmath",
|
||||
"//third_party/cargo:image",
|
||||
|
@ -56,7 +51,6 @@ rust_library(
|
|||
"//third_party/cargo:env_logger",
|
||||
"//third_party/cargo:vulkano",
|
||||
"//third_party/cargo:vulkano_win",
|
||||
"@rules_rust//tools/runfiles",
|
||||
],
|
||||
proc_macro_deps = [
|
||||
"//lib/ecs_macros",
|
||||
|
|
|
@ -17,6 +17,5 @@
|
|||
pub mod globals;
|
||||
pub mod input;
|
||||
pub mod render;
|
||||
pub mod util;
|
||||
pub mod physics;
|
||||
pub mod scripting;
|
||||
|
|
|
@ -23,10 +23,11 @@ use vulkano::device as vd;
|
|||
use vulkano::format as vf;
|
||||
use vulkano::image as vm;
|
||||
|
||||
use engine_util::file;
|
||||
|
||||
use crate::physics::color;
|
||||
use crate::render::vulkan::data;
|
||||
use crate::render::vulkan::material::ChannelLayoutVulkan;
|
||||
use crate::util::file;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Texture<T: ChannelLayoutVulkan> {
|
||||
|
|
|
@ -27,6 +27,9 @@ use vulkano::instance as vi;
|
|||
use vulkano::swapchain as vs;
|
||||
use vulkano::sync::{FenceSignalFuture, GpuFuture};
|
||||
|
||||
use engine_util::counter::Counter;
|
||||
use engine_util::profiler::Profiler;
|
||||
|
||||
pub mod data;
|
||||
pub mod material;
|
||||
mod surface_binding;
|
||||
|
@ -37,8 +40,6 @@ mod shaders;
|
|||
mod swapchain_binding;
|
||||
mod worker;
|
||||
|
||||
use crate::util::counter::Counter;
|
||||
use crate::util::profiler::Profiler;
|
||||
use crate::render::{Light, Material, Mesh, ResourceID};
|
||||
use crate::render::resource;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ use vulkano::descriptor::pipeline_layout as vdp;
|
|||
use vulkano::device as vd;
|
||||
use vulkano::pipeline::shader as vps;
|
||||
|
||||
use crate::util::file;
|
||||
use engine_util::file;
|
||||
|
||||
pub struct ShaderDefinition {
|
||||
pub name: String,
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::sync::{Arc, Mutex, RwLock, atomic};
|
|||
use std::io::Read;
|
||||
|
||||
use crate::render;
|
||||
use crate::util;
|
||||
use engine_util as util;
|
||||
use crate::globals::Time;
|
||||
|
||||
use mlua::prelude::LuaError::RuntimeError;
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
load("@rules_rust//rust:rust.bzl", "rust_library")
|
||||
|
||||
rust_library(
|
||||
name = "util",
|
||||
crate_name = "engine_util",
|
||||
edition = "2018",
|
||||
rustc_flags = [
|
||||
"-C", "opt-level=3",
|
||||
"-C", "overflow-checks=n",
|
||||
"-C", "force-frame-pointers=y",
|
||||
"-C", "lto=off",
|
||||
"-Zpolonius",
|
||||
"-Zborrowck=mir",
|
||||
],
|
||||
srcs = [
|
||||
"lib.rs",
|
||||
|
||||
"counter.rs",
|
||||
"file.rs",
|
||||
"profiler.rs",
|
||||
"resourcemap.rs",
|
||||
],
|
||||
deps = [
|
||||
"@rules_rust//tools/runfiles",
|
||||
"//third_party/cargo:log",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
|
@ -20,6 +20,7 @@ rust_binary(
|
|||
],
|
||||
deps = [
|
||||
"//engine",
|
||||
"//engine/util",
|
||||
"//lib/ecs",
|
||||
"//third_party/cargo:cgmath",
|
||||
"//third_party/cargo:env_logger",
|
||||
|
|
|
@ -2,11 +2,13 @@ use std::sync::Arc;
|
|||
use cgmath as cgm;
|
||||
|
||||
use ecs_macros::Access;
|
||||
use engine::{globals, input, render, scripting, util};
|
||||
use engine::{globals, input, render, scripting};
|
||||
use engine::render::material;
|
||||
use engine::render::vulkan::data;
|
||||
use engine::physics;
|
||||
|
||||
use engine_util as util;
|
||||
|
||||
struct Main {
|
||||
light1: ecs::EntityID,
|
||||
cube1: ecs::EntityID,
|
||||
|
|
Loading…
Reference in New Issue