diff --git a/include/vkd3d.h b/include/vkd3d.h index 79c04230..a3bb8e0d 100644 --- a/include/vkd3d.h +++ b/include/vkd3d.h @@ -182,7 +182,7 @@ struct vkd3d_image_resource_create_info const void *next; VkImage vk_image; - D3D12_RESOURCE_DESC1 desc; + D3D12_RESOURCE_DESC desc; unsigned int flags; D3D12_RESOURCE_STATES present_state; }; diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 0f45b68f..17c7ccb3 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -3733,14 +3733,6 @@ static void STDMETHODCALLTYPE d3d12_device_CopyDescriptorsSimple(ID3D12Device7 * 1, &src_descriptor_range_offset, &descriptor_count, descriptor_heap_type); } -static void d3d12_resource_desc1_from_desc(D3D12_RESOURCE_DESC1 *desc1, const D3D12_RESOURCE_DESC *desc) -{ - memcpy(desc1, desc, sizeof(*desc)); - desc1->SamplerFeedbackMipRegion.Width = 0; - desc1->SamplerFeedbackMipRegion.Height = 0; - desc1->SamplerFeedbackMipRegion.Depth = 0; -} - static void d3d12_resource_allocation_info1_from_vkd3d(D3D12_RESOURCE_ALLOCATION_INFO1 *result, const struct vkd3d_resource_allocation_info *info) { diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index fc05fce1..89764d09 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -2277,8 +2277,8 @@ HRESULT vkd3d_create_image_resource(ID3D12Device *device, object->ID3D12Resource2_iface.lpVtbl = &d3d12_resource_vtbl; object->refcount = 1; object->internal_refcount = 1; - object->desc = create_info->desc; - object->format = vkd3d_format_from_d3d12_resource_desc(d3d12_device, &create_info->desc, 0); + d3d12_resource_desc1_from_desc(&object->desc, &create_info->desc); + object->format = vkd3d_format_from_d3d12_resource_desc(d3d12_device, &object->desc, 0); object->u.vk_image = create_info->vk_image; object->flags = VKD3D_RESOURCE_EXTERNAL; object->flags |= create_info->flags & VKD3D_RESOURCE_PUBLIC_FLAGS; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 6101c3fe..20317ace 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -769,6 +769,14 @@ HRESULT d3d12_reserved_resource_create(struct d3d12_device *device, const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource); struct d3d12_resource *unsafe_impl_from_ID3D12Resource(ID3D12Resource *iface); +static inline void d3d12_resource_desc1_from_desc(D3D12_RESOURCE_DESC1 *desc1, const D3D12_RESOURCE_DESC *desc) +{ + memcpy(desc1, desc, sizeof(*desc)); + desc1->SamplerFeedbackMipRegion.Width = 0; + desc1->SamplerFeedbackMipRegion.Height = 0; + desc1->SamplerFeedbackMipRegion.Depth = 0; +} + HRESULT vkd3d_allocate_buffer_memory(struct d3d12_device *device, VkBuffer vk_buffer, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, VkDeviceMemory *vk_memory, uint32_t *vk_memory_type, VkDeviceSize *vk_memory_size);