mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-25 00:04:15 +00:00
Publish 0.5.0
This commit is contained in:
parent
a8dfc332cb
commit
9e83984278
16
README.md
16
README.md
@ -1,4 +1,6 @@
|
||||
# Vulkano
|
||||
# [Vulkano](http://vulkano.rs)
|
||||
|
||||
See also [vulkano.rs](http://vulkano.rs).
|
||||
|
||||
Vulkano is a Rust wrapper around [the Vulkan graphics API](https://www.khronos.org/vulkan/).
|
||||
It follows the Rust philosophy, which is that as long as you don't use unsafe code you shouldn't
|
||||
@ -27,11 +29,6 @@ required.
|
||||
|
||||
## Development status
|
||||
|
||||
**Please read this section.**
|
||||
|
||||
The latest released version on crates.io is version 0.4. This version is not stable, and most
|
||||
likely differs from the code on github.
|
||||
|
||||
Vulkano is still in heavy development and doesn't yet meet its goals of being very robust. However
|
||||
the general structure of the library is most likely definitive, and all future breaking changes
|
||||
will likely be straight-forward to fix in user code.
|
||||
@ -43,9 +40,13 @@ will likely be straight-forward to fix in user code.
|
||||
To get started you are encouraged to read the examples in `examples/src/bin`, starting with
|
||||
the `triangle` example.
|
||||
|
||||
## Donate
|
||||
|
||||
[![Become a patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/tomaka)
|
||||
|
||||
## Structure
|
||||
|
||||
This repository contains five libraries:
|
||||
This repository contains six libraries:
|
||||
|
||||
- `vulkano` is the main one.
|
||||
- `vulkano-shaders` can analyse SPIR-V shaders at compile-time.
|
||||
@ -55,6 +56,7 @@ This repository contains five libraries:
|
||||
a window where to render to.
|
||||
- `glsl-to-spirv` can compile GLSL to SPIR-V by wrapping around `glslang`. `glsl-to-spirv` is an
|
||||
implementation detail that you don't need to use manually if you use vulkano.
|
||||
- `vk-sys` contains raw bindings for Vulkan. You can use it even if you don't care about vulkano.
|
||||
|
||||
Once procedural macros are stabilized in Rust, the `vulkano-shaders` and `vulkano-shader-derive`
|
||||
crates will be merged with the `vulkano` crate. The `glsl-to-spirv` crate is an implementation
|
||||
|
@ -2,6 +2,7 @@
|
||||
name = "examples"
|
||||
version = "0.1.0"
|
||||
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
vulkano = { path = "../vulkano" }
|
||||
@ -9,5 +10,5 @@ vulkano-shader-derive = { path = "../vulkano-shader-derive" }
|
||||
vulkano-win = { path = "../vulkano-win" }
|
||||
cgmath = "0.14.1"
|
||||
image = "0.14.0"
|
||||
winit = "0.6.4"
|
||||
winit = "0.7.0"
|
||||
time = "0.1.37"
|
||||
|
@ -37,7 +37,7 @@ fn main() {
|
||||
.next().expect("no device available");
|
||||
println!("Using device: {} (type: {:?})", physical.name(), physical.ty());
|
||||
|
||||
let events_loop = winit::EventsLoop::new();
|
||||
let mut events_loop = winit::EventsLoop::new();
|
||||
let window = winit::WindowBuilder::new().build_vk_surface(&events_loop, instance.clone()).unwrap();
|
||||
|
||||
let queue = physical.queue_families().find(|&q| q.supports_graphics() &&
|
||||
|
@ -37,7 +37,7 @@ fn main() {
|
||||
.next().expect("no device available");
|
||||
println!("Using device: {} (type: {:?})", physical.name(), physical.ty());
|
||||
|
||||
let events_loop = winit::EventsLoop::new();
|
||||
let mut events_loop = winit::EventsLoop::new();
|
||||
let window = winit::WindowBuilder::new().build_vk_surface(&events_loop, instance.clone()).unwrap();
|
||||
|
||||
let queue = physical.queue_families().find(|&q| q.supports_graphics() &&
|
||||
|
@ -102,7 +102,7 @@ fn main() {
|
||||
//
|
||||
// This returns a `vulkano_win::Window` object that contains both a cross-platform winit
|
||||
// window and a cross-platform Vulkan surface that represents the surface of the window.
|
||||
let events_loop = winit::EventsLoop::new();
|
||||
let mut events_loop = winit::EventsLoop::new();
|
||||
let window = winit::WindowBuilder::new().build_vk_surface(&events_loop, instance.clone()).unwrap();
|
||||
|
||||
// The next step is to choose which GPU queue will execute our draw commands.
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vk-sys"
|
||||
version = "0.2.4"
|
||||
version = "0.2.5"
|
||||
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
repository = "https://github.com/tomaka/vulkano"
|
||||
description = "Bindings for the Vulkan graphics API"
|
||||
|
@ -1,4 +0,0 @@
|
||||
# Temporary Vulkan symbols loading library
|
||||
|
||||
Hastily written library that loads Vulkan symbols.
|
||||
Temporary. Do not use. A better library needs to be written.
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vulkano-shader-derive"
|
||||
version = "0.4.4"
|
||||
version = "0.5.0"
|
||||
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
repository = "https://github.com/tomaka/vulkano"
|
||||
description = "Safe wrapper for the Vulkan graphics API"
|
||||
@ -15,4 +15,4 @@ proc-macro = true
|
||||
[dependencies]
|
||||
glsl-to-spirv = { version = "0.1.2", path = "../glsl-to-spirv" }
|
||||
syn = { version = "0.10", features = ["aster", "visit"] }
|
||||
vulkano-shaders = { version = "0.4", path = "../vulkano-shaders" }
|
||||
vulkano-shaders = { version = "0.5", path = "../vulkano-shaders" }
|
||||
|
@ -1,47 +0,0 @@
|
||||
# Usage
|
||||
|
||||
This replaces `vulkano-shaders`.
|
||||
|
||||
Either provide glsl source code directly as an attribute:
|
||||
|
||||
```rust
|
||||
#[macro_use]
|
||||
extern crate vulkano_shader_derive;
|
||||
|
||||
mod fs {
|
||||
#[derive(VulkanoShader)]
|
||||
#[ty = "fragment"]
|
||||
#[src = "
|
||||
#version 450
|
||||
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
#extension GL_ARB_shading_language_450pack : enable
|
||||
|
||||
layout(location = 0) out vec4 f_color;
|
||||
|
||||
void main() {
|
||||
f_color = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
}"]
|
||||
struct Dummy;
|
||||
}
|
||||
|
||||
let fs = fs::Shader::load(&device).expect("failed to create shader module");
|
||||
```
|
||||
|
||||
Or by providing a path to a file containing the glsl code:
|
||||
|
||||
```rust
|
||||
#[macro_use]
|
||||
extern crate vulkano_shader_derive;
|
||||
|
||||
mod fs {
|
||||
#[derive(VulkanoShader)]
|
||||
#[ty = "fragment"]
|
||||
#[path = "shader/fragment.glsl"]
|
||||
struct Dummy;
|
||||
}
|
||||
|
||||
let fs = fs::Shader::load(&device).expect("failed to create shader module");
|
||||
```
|
||||
|
||||
Note that this file path is relative to the project's Cargo.toml, and not to the file the attribute is being used in.
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vulkano-shaders"
|
||||
version = "0.4.4"
|
||||
version = "0.5.0"
|
||||
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
repository = "https://github.com/tomaka/vulkano"
|
||||
description = "Shaders "
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vulkano-win"
|
||||
version = "0.4.4"
|
||||
version = "0.5.0"
|
||||
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
repository = "https://github.com/tomaka/vulkano"
|
||||
description = "Link between vulkano and winit"
|
||||
@ -8,8 +8,8 @@ license = "MIT/Apache-2.0"
|
||||
categories = ["rendering::graphics-api"]
|
||||
|
||||
[dependencies]
|
||||
vulkano = { version = "0.4.0", path = "../vulkano" }
|
||||
winit = "0.6.4"
|
||||
vulkano = { version = "0.5.0", path = "../vulkano" }
|
||||
winit = "0.7.0"
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
metal-rs = "0.3.0"
|
||||
|
@ -1,26 +0,0 @@
|
||||
# Contributing
|
||||
|
||||
The project is in its initial development phase. All code is potentially a draft.
|
||||
If you want to contribute, you are encouraged to ask whether it's ok to implement something before
|
||||
starting to do so. Otherwise your work could end up being useless or against the intended design.
|
||||
|
||||
For each module, the tile is checked if the code inside it is in an "acceptable" state:
|
||||
|
||||
- [x] Buffer
|
||||
- [ ] Command buffer
|
||||
- [ ] Descriptor set
|
||||
- [x] Device
|
||||
- [x] Features
|
||||
- [x] Formats
|
||||
- [x] Framebuffer
|
||||
- [ ] Image
|
||||
- [ ] Instance
|
||||
- [x] Lib
|
||||
- [x] Memory
|
||||
- [ ] Pipeline
|
||||
- [ ] Query
|
||||
- [x] Sampler
|
||||
- [ ] Shader
|
||||
- [x] Swapchain
|
||||
- [x] Sync
|
||||
- [x] Version
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vulkano"
|
||||
version = "0.4.4"
|
||||
version = "0.5.0"
|
||||
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
repository = "https://github.com/tomaka/vulkano"
|
||||
description = "Safe wrapper for the Vulkan graphics API"
|
||||
@ -15,4 +15,4 @@ fnv = "1.0.5"
|
||||
shared_library = "0.1.5"
|
||||
smallvec = "0.3.1"
|
||||
lazy_static = "0.2.2"
|
||||
vk-sys = { version = "0.2.4", path = "../vk-sys" }
|
||||
vk-sys = { version = "0.2.5", path = "../vk-sys" }
|
||||
|
@ -1,44 +0,0 @@
|
||||
# Vulkano
|
||||
|
||||
Safe Rust wrapper around Vulkan.
|
||||
|
||||
- Much easier to use than raw Vulkan.
|
||||
|
||||
- Any error that the validation layer would trigger is avoided in the first
|
||||
place. This is done through a lot of compile-time checks and a few runtime
|
||||
checks.
|
||||
|
||||
- Anything that is possible to do with Vulkan should be possible with vulkano
|
||||
as well. Please open an issue if this is not the case.
|
||||
|
||||
- Safety is favored over performances. In particular, compared to raw Vulkan
|
||||
vulkano does some runtime checks and wraps most objects around
|
||||
reference-counted pointers.
|
||||
|
||||
## Usage
|
||||
|
||||
Add to your Cargo.toml:
|
||||
|
||||
```toml
|
||||
vulkano = "0.1"
|
||||
```
|
||||
|
||||
Note that this library doesn't handle creating and managing windows. In order
|
||||
to render to a window, you will have to create that window separately and use
|
||||
an unsafe function of this library to link to it.
|
||||
|
||||
This only concerns windows. Safe fullscreen rendering is possible with this
|
||||
library alone.
|
||||
|
||||
## Shaders handling
|
||||
|
||||
The API of vulkano related to shader modules is entirely unsafe. This is
|
||||
because you're not supposed to use it directly.
|
||||
|
||||
Instead, you are encouraged to use the `vulkano-shaders` crate which compiles
|
||||
and analyses your shader, and generates Rust code that wraps around vulkano's
|
||||
API.
|
||||
|
||||
Thanks to this, vulkano can provide compile-time guarantees about your
|
||||
specialization constants, push constants, descriptor sets, vertex layouts, and
|
||||
so on.
|
Loading…
Reference in New Issue
Block a user