Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4db47d4
[update] component rendering & documentation.
vmarcella Oct 9, 2022
d92cedb
[remove] unused function.
vmarcella Oct 9, 2022
0422f75
[fix] panic that happened when virtual key representations weren't pr…
vmarcella Oct 9, 2022
299e5d4
[update] error message.
vmarcella Oct 9, 2022
ac49d73
[update] print formatting.
vmarcella Oct 9, 2022
d1d2962
[update] event imports & update lambda-platform documentation.
vmarcella Oct 9, 2022
d27f5a5
[add] documentation for gfx fences.
vmarcella Oct 9, 2022
6de1237
[add] test for viewport building.
vmarcella Oct 10, 2022
e8b8236
[update] workflow to run tests for all platforms.
vmarcella Oct 10, 2022
414d911
[add] tests for builder with coordinates.
vmarcella Oct 10, 2022
c5ccf30
[test] properties of the built viewport.
vmarcella Oct 10, 2022
579d666
[update] documentation & tests.
vmarcella Oct 10, 2022
9948be4
[update] the surface size to use a tuple.
vmarcella Oct 10, 2022
05b6dc0
[add] mockall for mocking in platform tests.
vmarcella Oct 10, 2022
c5426b6
[add] mockall to lambda-platform, add a surface builder test.
vmarcella Oct 10, 2022
d2db132
[add] tests for the swapchain builder.
vmarcella Oct 10, 2022
2926726
[refactor] both the shader and shader assembler.
vmarcella Oct 10, 2022
b97dec9
[add] shader module tests.
vmarcella Oct 11, 2022
73ea36b
[add] automock to some traits and make lambda-platform a default member.
vmarcella Oct 11, 2022
33c882b
[remove] unused function create_framebuffer.
vmarcella Oct 13, 2022
d50c09f
[update] documentation.
vmarcella Oct 13, 2022
2600d0d
[add] a resize call to the render api.
vmarcella Oct 14, 2022
b07a245
[add] minor fixes, documentation changes, and updated the runtime con…
vmarcella Oct 15, 2022
7068c55
[update] resize to handle the swapchain not being applied correctly.
vmarcella Oct 15, 2022
8bb176f
[update] demo to customize the window dimensions and title.
vmarcella Oct 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/compile_lambda_rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
rustup default ${{ matrix.rustup-toolchain }}

- name: Build Lambda & other default workspace members.
run: cargo build
run: cargo test --all

- uses: actions/setup-ruby@v1
- name: Send Webhook Notification for build status.
Expand Down
131 changes: 125 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ members = [

default-members = [
"lambda",
"crates/lambda-platform",
"tools/lambda_rs_demo"
]
3 changes: 3 additions & 0 deletions crates/lambda-platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ gfx-backend-vulkan = { version="=0.9.0", optional = true }
gfx-backend-dx11 = { version="=0.9.0", optional = true }
gfx-backend-dx12 = { version="=0.9.0", optional = true }

[dev-dependencies]
mockall = "=0.11.2"

[features]
default=["shaderc/build-from-source"]
detect-platform=[]
Expand Down
3 changes: 3 additions & 0 deletions crates/lambda-platform/src/gfx/api.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! GPU API exports to set the platforms primary rendering API for rendering
//! implementations to use.

cfg_if::cfg_if! {
if #[cfg(feature = "with-gl")] {
pub use gfx_backend_gl as RenderingAPI;
Expand Down
45 changes: 20 additions & 25 deletions crates/lambda-platform/src/gfx/assembler.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
pub mod internal {
pub use gfx_hal::{
pso::{
EntryPoint,
InputAssemblerDesc,
Primitive,
PrimitiveAssemblerDesc,
},
Backend,
};
//! Primitive assembly for the graphics pipeline.

#[inline]
pub fn into_primitive_assembler<'shader, RenderBackend: Backend>(
primitive_assembler: super::PrimitiveAssembler<'shader, RenderBackend>,
) -> PrimitiveAssemblerDesc<'shader, RenderBackend> {
return primitive_assembler.primitive_assembler;
}
}
use gfx_hal::pso;

/// PrimitiveAssemblerBuilder for preparing PrimitiveAssemblers to use in the
/// lambda-platform Rendering pipeline.
Expand All @@ -32,14 +17,13 @@ impl PrimitiveAssemblerBuilder {
self,
vertex_shader: &'shader super::shader::ShaderModule<RenderBackend>,
) -> PrimitiveAssembler<'shader, RenderBackend> {
// TODO(vmarcella): The builder should expose more fields for the
let primitive_assembler = internal::PrimitiveAssemblerDesc::Vertex {
let primitive_assembler = pso::PrimitiveAssemblerDesc::Vertex {
buffers: &[],
attributes: &[],
input_assembler: internal::InputAssemblerDesc::new(
internal::Primitive::TriangleList,
input_assembler: pso::InputAssemblerDesc::new(
pso::Primitive::TriangleList,
),
vertex: internal::EntryPoint {
vertex: pso::EntryPoint {
entry: vertex_shader.entry(),
module: super::internal::module_for(vertex_shader),
specialization: vertex_shader.specializations().clone(),
Expand All @@ -57,11 +41,22 @@ impl PrimitiveAssemblerBuilder {
/// PrimitiveAssembler for used for describing how Vertex Shaders should
/// construct primitives. Each constructed Primitive Assembler should be alive
/// for as long as the shader module that created it is.
pub struct PrimitiveAssembler<'shader, RenderBackend: internal::Backend> {
primitive_assembler: internal::PrimitiveAssemblerDesc<'shader, RenderBackend>,
pub struct PrimitiveAssembler<'shader, RenderBackend: gfx_hal::Backend> {
primitive_assembler: pso::PrimitiveAssemblerDesc<'shader, RenderBackend>,
}

impl<'shader, RenderBackend: internal::Backend>
impl<'shader, RenderBackend: gfx_hal::Backend>
PrimitiveAssembler<'shader, RenderBackend>
{
}

/// Internal functions for the primitive assembler. User applications most
/// likely should not use these functions directly nor should they need to.
pub mod internal {
#[inline]
pub fn into_primitive_assembler<'shader, RenderBackend: gfx_hal::Backend>(
primitive_assembler: super::PrimitiveAssembler<'shader, RenderBackend>,
) -> gfx_hal::pso::PrimitiveAssemblerDesc<'shader, RenderBackend> {
return primitive_assembler.primitive_assembler;
}
}
11 changes: 11 additions & 0 deletions crates/lambda-platform/src/gfx/fence.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! GPU fence & semaphore implementations for rendering synchronizations. These
//! implementations built on top of gfx-hal and are used by the lambda-platform
//! rendering implementations to synchronize GPU operations.

use gfx_hal::device::Device;

pub struct RenderSemaphoreBuilder {}
Expand All @@ -7,6 +11,8 @@ impl RenderSemaphoreBuilder {
return Self {};
}

/// Builds a new render semaphore using the provided GPU. This semaphore can
/// only be used with the GPU that it was created with.
pub fn build<RenderBackend: gfx_hal::Backend>(
self,
gpu: &mut super::gpu::Gpu<RenderBackend>,
Expand All @@ -18,6 +24,7 @@ impl RenderSemaphoreBuilder {
return RenderSemaphore { semaphore };
}
}

pub struct RenderSemaphore<RenderBackend: gfx_hal::Backend> {
semaphore: RenderBackend::Semaphore,
}
Expand All @@ -36,6 +43,8 @@ pub struct RenderSubmissionFenceBuilder {
}

impl RenderSubmissionFenceBuilder {
/// Creates a new Render Submission Fence Builder that defaults to a 1 second
/// timeout for waiting on the fence.
pub fn new() -> Self {
return Self {
default_render_timeout: 1_000_000_000,
Expand All @@ -49,6 +58,8 @@ impl RenderSubmissionFenceBuilder {
return self;
}

/// Builds a new submission fence using the provided GPU. This fence can only
/// be used to block operation on the GPU that created it.
pub fn build<RenderBackend: gfx_hal::Backend>(
self,
gpu: &mut super::gpu::Gpu<RenderBackend>,
Expand Down
Loading