refactor(dx12): lower list extraction for copies between textures and buffers

This commit is contained in:
Erich Gubler 2025-05-22 12:51:51 -04:00
parent 517018e9ae
commit fd7530a011

View File

@ -612,8 +612,9 @@ impl crate::CommandEncoder for super::CommandEncoder {
) where ) where
T: Iterator<Item = crate::BufferTextureCopy>, T: Iterator<Item = crate::BufferTextureCopy>,
{ {
let list = self.list.as_ref().unwrap();
for r in regions { for r in regions {
let list = self.list.as_ref().unwrap();
let src_location = Direct3D12::D3D12_TEXTURE_COPY_LOCATION { let src_location = Direct3D12::D3D12_TEXTURE_COPY_LOCATION {
pResource: unsafe { borrow_interface_temporarily(&src.resource) }, pResource: unsafe { borrow_interface_temporarily(&src.resource) },
Type: Direct3D12::D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, Type: Direct3D12::D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT,
@ -652,8 +653,9 @@ impl crate::CommandEncoder for super::CommandEncoder {
) where ) where
T: Iterator<Item = crate::BufferTextureCopy>, T: Iterator<Item = crate::BufferTextureCopy>,
{ {
let list = self.list.as_ref().unwrap();
for r in regions { for r in regions {
let list = self.list.as_ref().unwrap();
let src_location = Direct3D12::D3D12_TEXTURE_COPY_LOCATION { let src_location = Direct3D12::D3D12_TEXTURE_COPY_LOCATION {
pResource: unsafe { borrow_interface_temporarily(&src.resource) }, pResource: unsafe { borrow_interface_temporarily(&src.resource) },
Type: Direct3D12::D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, Type: Direct3D12::D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX,