=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: tests: Map readback buffers with correct read range.
Alexandre Julliard
julliard at winehq.org
Mon Mar 18 15:45:10 CDT 2019
Module: vkd3d
Branch: master
Commit: 25b5bf86a1e510226605c7cd1085ea37d36cfe20
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=25b5bf86a1e510226605c7cd1085ea37d36cfe20
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Mon Mar 18 10:03:04 2019 +0100
tests: Map readback buffers with correct read range.
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tests/d3d12_test_utils.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/d3d12_test_utils.h b/tests/d3d12_test_utils.h
index 319d52f..a771c16 100644
--- a/tests/d3d12_test_utils.h
+++ b/tests/d3d12_test_utils.h
@@ -288,6 +288,7 @@ static void get_texture_readback_with_command_list(ID3D12Resource *texture, unsi
D3D12_RANGE read_range;
unsigned int miplevel;
ID3D12Device *device;
+ uint64_t buffer_size;
HRESULT hr;
hr = ID3D12Resource_GetDevice(texture, &IID_ID3D12Device, (void **)&device);
@@ -331,7 +332,8 @@ static void get_texture_readback_with_command_list(ID3D12Resource *texture, unsi
src_resource = texture;
}
- rb->resource = create_readback_buffer(device, rb->row_pitch * rb->height * rb->depth);
+ buffer_size = rb->row_pitch * rb->height * rb->depth;
+ rb->resource = create_readback_buffer(device, buffer_size);
dst_location.pResource = rb->resource;
dst_location.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
@@ -358,7 +360,7 @@ static void get_texture_readback_with_command_list(ID3D12Resource *texture, unsi
ID3D12Resource_Release(src_resource);
read_range.Begin = 0;
- read_range.End = resource_desc.Width;
+ read_range.End = buffer_size;
hr = ID3D12Resource_Map(rb->resource, 0, &read_range, &rb->data);
assert_that(hr == S_OK, "Failed to map readback buffer, hr %#x.\n", hr);
}
More information about the wine-cvs
mailing list