Skip to content

Commit c2dfffe

Browse files
committed
location assignment: document UniformConstant locations
1 parent 50d28ce commit c2dfffe

File tree

1 file changed

+6
-0
lines changed
  • crates/rustc_codegen_spirv/src/codegen_cx

1 file changed

+6
-0
lines changed

crates/rustc_codegen_spirv/src/codegen_cx/entry.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,12 @@ impl<'tcx> CodegenCx<'tcx> {
711711
}
712712

713713
// location assignment
714+
// Note(@firestar99): UniformConstant are things like `SampledImage`, `StorageImage`, `Sampler` and
715+
// `Acceleration structure`. Almost always they are assigned a `descriptor_set` and binding, thus never end up
716+
// here being assigned locations. I think this is one of those occasions where spirv allows us to assign
717+
// locations, but the "client API" Vulkan doesn't describe any use-case for them, or at least none I'm aware of.
718+
// A quick scour through the spec revealed that `VK_KHR_dynamic_rendering_local_read` may need this, and while
719+
// we don't support it yet (I assume), I'll just keep it here in case it becomes useful in the future.
714720
let has_location = matches!(
715721
storage_class,
716722
Ok(StorageClass::Input | StorageClass::Output | StorageClass::UniformConstant)

0 commit comments

Comments
 (0)