mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-26 08:44:08 +00:00
validate for strip_index_format being used with non-strip topology
This commit is contained in:
parent
aea2af588c
commit
9dd88cb338
@ -2004,6 +2004,18 @@ impl<B: GfxBackend> Device<B> {
|
||||
}
|
||||
}
|
||||
|
||||
if desc.primitive.strip_index_format.is_some()
|
||||
&& desc.primitive.topology != wgt::PrimitiveTopology::LineStrip
|
||||
&& desc.primitive.topology != wgt::PrimitiveTopology::TriangleStrip
|
||||
{
|
||||
return Err(
|
||||
pipeline::CreateRenderPipelineError::StripIndexFormatForNonStripTopology {
|
||||
strip_index_format: desc.primitive.strip_index_format,
|
||||
topology: desc.primitive.topology,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
let input_assembler = conv::map_primitive_state_to_input_assembler(&desc.primitive);
|
||||
|
||||
let blender = hal::pso::BlendDesc {
|
||||
|
@ -191,7 +191,7 @@ pub struct RenderPipelineDescriptor<'a> {
|
||||
pub enum CreateRenderPipelineError {
|
||||
#[error(transparent)]
|
||||
Device(#[from] DeviceError),
|
||||
#[error("pipelie layout is invalid")]
|
||||
#[error("pipeline layout is invalid")]
|
||||
InvalidLayout,
|
||||
#[error("unable to derive an implicit layout")]
|
||||
Implicit(#[from] ImplicitLayoutError),
|
||||
@ -211,6 +211,11 @@ pub enum CreateRenderPipelineError {
|
||||
location: wgt::ShaderLocation,
|
||||
offset: wgt::BufferAddress,
|
||||
},
|
||||
#[error("strip index format was not set to None but to {strip_index_format:?} while using the non-strip topology {topology:?}")]
|
||||
StripIndexFormatForNonStripTopology {
|
||||
strip_index_format: Option<wgt::IndexFormat>,
|
||||
topology: wgt::PrimitiveTopology,
|
||||
},
|
||||
#[error("missing required device features {0:?}")]
|
||||
MissingFeature(wgt::Features),
|
||||
#[error("error in stage {flag:?}")]
|
||||
|
Loading…
Reference in New Issue
Block a user