-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: split commands into seperate module and simplify execution
- Loading branch information
1 parent
3466cb9
commit 66d3dd5
Showing
10 changed files
with
138 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// Copyright (c) 2024, SkillerRaptor | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
use std::sync::Arc; | ||
|
||
use crate::{buffer::Buffer, graphics_pipeline::GraphicsPipeline, texture::Texture}; | ||
|
||
#[derive(Clone, Debug)] | ||
pub(crate) enum Command { | ||
// Pass Commands | ||
BeginRenderPass { | ||
texture: Arc<dyn Texture>, | ||
}, | ||
EndRenderPass, | ||
|
||
// Bind Commands | ||
BindDescriptor { | ||
buffer: Arc<dyn Buffer>, | ||
}, | ||
|
||
BindGraphicsPipeline { | ||
graphics_pipeline: Arc<dyn GraphicsPipeline>, | ||
}, | ||
|
||
BindIndexBuffer { | ||
buffer: Arc<dyn Buffer>, | ||
}, | ||
|
||
// Draw commands | ||
Draw { | ||
vertex_count: u32, | ||
instance_count: u32, | ||
first_vertex: u32, | ||
first_instance: u32, | ||
}, | ||
|
||
DrawIndexed { | ||
index_count: u32, | ||
instance_count: u32, | ||
first_index: u32, | ||
vertex_offset: i32, | ||
first_instance: u32, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters