From b011f0b97248ef64f1496eea2ff7cc850fe9b693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 25 Oct 2016 13:23:18 +0200 Subject: [PATCH] libs/vkd3d: Introduce resource flags. --- libs/vkd3d/resource.c | 6 +++--- libs/vkd3d/vkd3d_private.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 7c6c5cf7..7116b848 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -328,7 +328,7 @@ static void d3d12_resource_destroy(struct d3d12_resource *resource, struct d3d12 { const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs; - if (resource->external) + if (resource->flags & VKD3D_RESOURCE_EXTERNAL) return; switch (resource->desc.Dimension) @@ -670,7 +670,7 @@ static HRESULT d3d12_committed_resource_init(struct d3d12_resource *resource, st if (optimized_clear_value) FIXME("Ignoring optimized clear value.\n"); - resource->external = false; + resource->flags = 0; switch (desc->Dimension) { @@ -753,7 +753,7 @@ HRESULT vkd3d_create_image_resource(ID3D12Device *device, const D3D12_RESOURCE_D object->desc = *desc; object->u.vk_image = vk_image; object->vk_memory = VK_NULL_HANDLE; - object->external = true; + object->flags = VKD3D_RESOURCE_EXTERNAL; object->map_count = 0; object->map_data = NULL; memset(&object->heap_properties, 0, sizeof(object->heap_properties)); diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index ca92ddc4..060abb21 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -114,6 +114,8 @@ struct d3d12_fence HRESULT d3d12_fence_create(struct d3d12_device *device, UINT64 initial_value, D3D12_FENCE_FLAGS flags, struct d3d12_fence **fence) DECLSPEC_HIDDEN; +#define VKD3D_RESOURCE_EXTERNAL 0x00000001 + /* ID3D12Resource */ struct d3d12_resource { @@ -129,7 +131,7 @@ struct d3d12_resource VkImage vk_image; } u; VkDeviceMemory vk_memory; - bool external; + unsigned int flags; unsigned int map_count; void *map_data;