Setting root constants

This commit is contained in:
Dzmitry Malyshau
2021-07-27 01:28:56 -04:00
parent 9648579dcb
commit 3e88f3dc63
2 changed files with 24 additions and 1 deletions

View File

@@ -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

View File

@@ -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,