Module: vkd3d Branch: master Commit: de87352f779943a2378bcea141cbac478f6fa141 URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=de87352f779943a2378bcea1...
Author: Conor McCarthy cmccarthy@codeweavers.com Date: Tue Jan 18 15:07:59 2022 +1000
vkd3d: Use the resource's stored format in init_default_texture_view_desc().
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
libs/vkd3d/resource.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 14e08b0..9905015 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -2439,7 +2439,11 @@ static bool init_default_texture_view_desc(struct vkd3d_texture_view_desc *desc, { const struct d3d12_device *device = resource->device;
- if (!(desc->format = vkd3d_format_from_d3d12_resource_desc(device, &resource->desc, view_format))) + if (view_format == resource->desc.Format) + { + desc->format = resource->format; + } + else if (!(desc->format = vkd3d_format_from_d3d12_resource_desc(device, &resource->desc, view_format))) { FIXME("Failed to find format (resource format %#x, view format %#x).\n", resource->desc.Format, view_format);