mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Setting root constants
This commit is contained in:
@@ -335,6 +335,17 @@ impl GraphicsCommandList {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_compute_root_constant(
|
||||
&self,
|
||||
root_index: RootIndex,
|
||||
value: u32,
|
||||
dest_offset_words: u32,
|
||||
) {
|
||||
unsafe {
|
||||
self.SetComputeRoot32BitConstant(root_index, value, dest_offset_words);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_graphics_root_descriptor_table(
|
||||
&self,
|
||||
root_index: RootIndex,
|
||||
@@ -375,6 +386,17 @@ impl GraphicsCommandList {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_graphics_root_constant(
|
||||
&self,
|
||||
root_index: RootIndex,
|
||||
value: u32,
|
||||
dest_offset_words: u32,
|
||||
) {
|
||||
unsafe {
|
||||
self.SetGraphicsRoot32BitConstant(root_index, value, dest_offset_words);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn resource_barrier(&self, barriers: &[ResourceBarrier]) {
|
||||
unsafe {
|
||||
self.ResourceBarrier(barriers.len() as _, barriers.as_ptr() as _) // matches representation
|
||||
|
||||
@@ -120,7 +120,8 @@ impl RootParameter {
|
||||
RootParameter(param)
|
||||
}
|
||||
|
||||
fn descriptor(
|
||||
//TODO: should this be unsafe?
|
||||
pub fn descriptor(
|
||||
ty: d3d12::D3D12_ROOT_PARAMETER_TYPE,
|
||||
visibility: ShaderVisibility,
|
||||
binding: Binding,
|
||||
|
||||
Reference in New Issue
Block a user