Merge pull request #35 from gfx-rs/root-const

Setting root constants
This commit is contained in:
Markus Siglreithmaier
2021-07-27 07:46:54 +02:00
committed by GitHub
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,