Skip to content

Commit 56a5b60

Browse files
WIP: feat(core)!: validate Limits::workgroup_storage_size_limit_exceeded
1 parent c580922 commit 56a5b60

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

wgpu-core/src/validation.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ pub enum StageError {
397397
InvalidWorkgroupSize(#[from] InvalidWorkgroupSizeError),
398398
#[error("Unable to find entry point '{0}'")]
399399
MissingEntryPoint(String),
400+
#[error(
401+
"Workgroup storage size limit exceeded: attempted to use {used} bytes, limit is {limit}"
402+
)]
403+
WorkgroupStorageSizeLimitExceeded { used: u32, limit: u32 },
400404
#[error("Shader global {0:?} is not available in the pipeline layout")]
401405
Binding(naga::ResourceBinding, #[source] BindingError),
402406
#[error("Unable to filter the texture ({texture:?}) by the sampler ({sampler:?})")]
@@ -1344,6 +1348,15 @@ impl Interface {
13441348
};
13451349
let (_, entry_point_name) = pair;
13461350

1351+
let workgroup_storage_used: u32 = todo!();
1352+
1353+
if workgroup_storage_used > self.limits.max_compute_workgroup_storage_size {
1354+
return Err(StageError::WorkgroupStorageSizeLimitExceeded {
1355+
used: workgroup_storage_used,
1356+
limit: self.limits.max_compute_workgroup_storage_size,
1357+
});
1358+
}
1359+
13471360
let stage_bit = shader_stage.to_wgt_bit();
13481361

13491362
// check resources visibility

0 commit comments

Comments
 (0)