mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
wgpu-core: Inform user about possible fix (#5298)
This commit is contained in:
@@ -221,7 +221,7 @@ pub enum BindingZone {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Error)]
|
||||
#[error("Too many bindings of type {kind:?} in {zone}, limit is {limit}, count was {count}")]
|
||||
#[error("Too many bindings of type {kind:?} in {zone}, limit is {limit}, count was {count}. Check the limit `{}` passed to `Adapter::request_device`", .kind.to_config_str())]
|
||||
pub struct BindingTypeMaxCountError {
|
||||
pub kind: BindingTypeMaxCountErrorKind,
|
||||
pub zone: BindingZone,
|
||||
@@ -240,6 +240,28 @@ pub enum BindingTypeMaxCountErrorKind {
|
||||
UniformBuffers,
|
||||
}
|
||||
|
||||
impl BindingTypeMaxCountErrorKind {
|
||||
fn to_config_str(&self) -> &'static str {
|
||||
match self {
|
||||
BindingTypeMaxCountErrorKind::DynamicUniformBuffers => {
|
||||
"max_dynamic_uniform_buffers_per_pipeline_layout"
|
||||
}
|
||||
BindingTypeMaxCountErrorKind::DynamicStorageBuffers => {
|
||||
"max_dynamic_storage_buffers_per_pipeline_layout"
|
||||
}
|
||||
BindingTypeMaxCountErrorKind::SampledTextures => {
|
||||
"max_sampled_textures_per_shader_stage"
|
||||
}
|
||||
BindingTypeMaxCountErrorKind::Samplers => "max_samplers_per_shader_stage",
|
||||
BindingTypeMaxCountErrorKind::StorageBuffers => "max_storage_buffers_per_shader_stage",
|
||||
BindingTypeMaxCountErrorKind::StorageTextures => {
|
||||
"max_storage_textures_per_shader_stage"
|
||||
}
|
||||
BindingTypeMaxCountErrorKind::UniformBuffers => "max_uniform_buffers_per_shader_stage",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub(crate) struct PerStageBindingTypeCounter {
|
||||
vertex: u32,
|
||||
|
||||
Reference in New Issue
Block a user