Conor McCarthy : vkd3d: Use the resource's stored format in d3d12_resource_validate_box().

Alexandre Julliard julliard at winehq.org
Wed Jan 19 15:52:10 CST 2022


Module: vkd3d
Branch: master
Commit: 04b1c977ce2d9c621a794a6da7f17abd5ee792f0
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=04b1c977ce2d9c621a794a6da7f17abd5ee792f0

Author: Conor McCarthy <cmccarthy at codeweavers.com>
Date:   Tue Jan 18 14:59:20 2022 +1000

vkd3d: Use the resource's stored format in d3d12_resource_validate_box().

Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d/resource.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index a2be9a8..b40683c 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -1080,7 +1080,6 @@ static bool d3d12_resource_validate_box(const struct d3d12_resource *resource,
         unsigned int sub_resource_idx, const D3D12_BOX *box)
 {
     unsigned int mip_level = sub_resource_idx % resource->desc.MipLevels;
-    struct d3d12_device *device = resource->device;
     const struct vkd3d_format *vkd3d_format;
     uint32_t width_mask, height_mask;
     uint64_t width, height, depth;
@@ -1089,7 +1088,7 @@ static bool d3d12_resource_validate_box(const struct d3d12_resource *resource,
     height = d3d12_resource_desc_get_height(&resource->desc, mip_level);
     depth = d3d12_resource_desc_get_depth(&resource->desc, mip_level);
 
-    vkd3d_format = vkd3d_format_from_d3d12_resource_desc(device, &resource->desc, 0);
+    vkd3d_format = resource->format;
     assert(vkd3d_format);
     width_mask = vkd3d_format->block_width - 1;
     height_mask = vkd3d_format->block_height - 1;




More information about the wine-cvs mailing list