add set_layout
This commit is contained in:
parent
d787a0fc1f
commit
f995079348
@ -1,4 +1,4 @@
|
|||||||
use super::ShaderDefVal;
|
use super::{empty_bind_group_layout, ShaderDefVal};
|
||||||
use crate::mesh::VertexBufferLayout;
|
use crate::mesh::VertexBufferLayout;
|
||||||
use crate::{
|
use crate::{
|
||||||
define_atomic_id,
|
define_atomic_id,
|
||||||
@ -112,6 +112,20 @@ pub struct RenderPipelineDescriptor {
|
|||||||
pub zero_initialize_workgroup_memory: bool,
|
pub zero_initialize_workgroup_memory: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug, Error)]
|
||||||
|
#[error("RenderPipelineDescriptor has no FragmentState configured")]
|
||||||
|
pub struct NoFragmentStateError;
|
||||||
|
|
||||||
|
impl RenderPipelineDescriptor {
|
||||||
|
pub fn fragment_mut(&mut self) -> Result<&mut FragmentState, NoFragmentStateError> {
|
||||||
|
self.fragment.as_mut().ok_or(NoFragmentStateError)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_layout(&mut self, index: usize, layout: BindGroupLayout) {
|
||||||
|
filling_set_at(&mut self.layout, index, empty_bind_group_layout(), layout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, Default)]
|
#[derive(Clone, Debug, Eq, PartialEq, Default)]
|
||||||
pub struct VertexState {
|
pub struct VertexState {
|
||||||
/// The compiled shader module for this stage.
|
/// The compiled shader module for this stage.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user