Skip to content

Commit

Permalink
refactor(d3d12): removed unused resource arg in `CreateRenderTarget…
Browse files Browse the repository at this point in the history
…View`
  • Loading branch information
ErichDonGubler committed Sep 25, 2023
1 parent 8e841b9 commit e8ff8ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 4 additions & 3 deletions d3d12/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,15 @@ impl Device {
(signature, hr)
}

pub fn create_render_target_view(
pub fn create_render_target_view_from_desc(
&self,
resource: Resource,
desc: &RenderTargetViewDesc,
descriptor: CpuDescriptor,
) {
// A null pResource is used to initialize a null descriptor,
// which guarantees D3D11-like null binding behavior (reading 0s, writes are discarded)
unsafe {
self.CreateRenderTargetView(resource.as_mut_ptr(), &desc.0 as *const _, descriptor);
self.CreateRenderTargetView(std::ptr::null_mut(), &desc.0 as *const _, descriptor);
}
}

Expand Down
5 changes: 1 addition & 4 deletions wgpu-hal/src/dx12/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ impl super::Device {

let mut rtv_pool = descriptor::CpuPool::new(raw.clone(), d3d12::DescriptorHeapType::Rtv);
let null_rtv_handle = rtv_pool.alloc_handle();
// A null pResource is used to initialize a null descriptor,
// which guarantees D3D11-like null binding behavior (reading 0s, writes are discarded)
raw.create_render_target_view(
d3d12::ComPtr::null(),
raw.create_render_target_view_from_desc(
&d3d12::RenderTargetViewDesc::texture_2d(
winapi::shared::dxgiformat::DXGI_FORMAT_R8G8B8A8_UNORM,
0,
Expand Down

0 comments on commit e8ff8ee

Please sign in to comment.