{
VK_FROM_HANDLE(dzn_buffer, src_buffer, info->srcBuffer);
VK_FROM_HANDLE(dzn_image, dst_image, info->dstImage);
+ struct dzn_physical_device *pdev =
+ container_of(cmdbuf->vk.base.device->physical, struct dzn_physical_device, vk);
ID3D12GraphicsCommandList1 *cmdlist = cmdbuf->cmdlist;
D3D12_TEXTURE_COPY_LOCATION src_buf_loc =
dzn_buffer_get_copy_loc(src_buffer, dst_image->vk.format, ®ion, aspect, l);
- if (dzn_buffer_supports_region_copy(&src_buf_loc)) {
+ if (dzn_buffer_supports_region_copy(pdev, &src_buf_loc)) {
/* RowPitch and Offset are properly aligned, we can copy
* the whole thing in one call.
*/
{
VK_FROM_HANDLE(dzn_image, src_image, info->srcImage);
VK_FROM_HANDLE(dzn_buffer, dst_buffer, info->dstBuffer);
+ struct dzn_physical_device *pdev =
+ container_of(cmdbuf->vk.base.device->physical, struct dzn_physical_device, vk);
ID3D12GraphicsCommandList1 *cmdlist = cmdbuf->cmdlist;
D3D12_TEXTURE_COPY_LOCATION dst_buf_loc =
dzn_buffer_get_copy_loc(dst_buffer, src_image->vk.format, ®ion, aspect, l);
- if (dzn_buffer_supports_region_copy(&dst_buf_loc)) {
+ if (dzn_buffer_supports_region_copy(pdev, &dst_buf_loc)) {
/* RowPitch and Offset are properly aligned on 256 bytes, we can copy
* the whole thing in one call.
*/
}
bool
-dzn_buffer_supports_region_copy(const D3D12_TEXTURE_COPY_LOCATION *loc)
+dzn_buffer_supports_region_copy(struct dzn_physical_device *pdev,
+ const D3D12_TEXTURE_COPY_LOCATION *loc)
{
+ if (pdev->options13.UnrestrictedBufferTextureCopyPitchSupported)
+ return true;
return !(loc->PlacedFootprint.Offset & (D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT - 1)) &&
!(loc->PlacedFootprint.Footprint.RowPitch & (D3D12_TEXTURE_DATA_PITCH_ALIGNMENT - 1));
}
uint32_t y, uint32_t z, uint32_t *start_x);
bool
-dzn_buffer_supports_region_copy(const D3D12_TEXTURE_COPY_LOCATION *loc);
+dzn_buffer_supports_region_copy(struct dzn_physical_device *pdev,
+ const D3D12_TEXTURE_COPY_LOCATION *loc);
struct dzn_buffer_view {
struct vk_object_base base;