summaryrefslogtreecommitdiff
path: root/appendices/VK_EXT_external_memory_host.adoc
blob: 1b7a3d0171245fa9934701e8d08f85925fc940f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Copyright 2017-2023 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

include::{generated}/meta/{refprefix}VK_EXT_external_memory_host.adoc[]

=== Other Extension Metadata

*Last Modified Date*::
    2017-11-10
*IP Status*::
    No known IP claims.
*Contributors*::
  - Jaakko Konttinen, AMD
  - David Mao, AMD
  - Daniel Rakos, AMD
  - Tobias Hector, Imagination Technologies
  - Faith Ekstrand, Intel
  - James Jones, NVIDIA

=== Description

This extension enables an application to import host allocations and host
mapped foreign device memory to Vulkan memory objects.

include::{generated}/interfaces/VK_EXT_external_memory_host.adoc[]

=== Issues

1) What memory type has to be used to import host pointers?

*RESOLVED*: Depends on the implementation.
Applications have to use the new flink:vkGetMemoryHostPointerPropertiesEXT
command to query the supported memory types for a particular host pointer.
The reported memory types may include memory types that come from a memory
heap that is otherwise not usable for regular memory object allocation and
thus such a heap's size may be zero.

2) Can the application still access the contents of the host allocation
after importing?

*RESOLVED*: Yes.
However, usual synchronization requirements apply.

3) Can the application free the host allocation?

*RESOLVED*: No, it violates valid usage conditions.
Using the memory object imported from a host allocation that is already
freed thus results in undefined: behavior.

4) Is flink:vkMapMemory expected to return the same host address which was
specified when importing it to the memory object?

*RESOLVED*: No.
Implementations are allowed to return the same address but it is not
required.
Some implementations might return a different virtual mapping of the
allocation, although the same physical pages will be used.

5) Is there any limitation on the alignment of the host pointer and/or size?

*RESOLVED*: Yes.
Both the address and the size have to be an integer multiple of
pname:minImportedHostPointerAlignment.
In addition, some platforms and foreign devices may have additional
restrictions.

6) Can the same host allocation be imported multiple times into a given
physical device?

*RESOLVED*: No, at least not guaranteed by this extension.
Some platforms do not allow locking the same physical pages for device
access multiple times, so attempting to do it may result in undefined:
behavior.

7) Does this extension support exporting the new handle type?

*RESOLVED*: No.

8) Should we include the possibility to import host mapped foreign device
memory using this API?

*RESOLVED*: Yes, through a separate handle type.
Implementations are still allowed to support only one of the handle types
introduced by this extension by not returning import support for a
particular handle type as returned in slink:VkExternalMemoryPropertiesKHR.

=== Version History

  * Revision 1, 2017-11-10 (Daniel Rakos)
  ** Internal revisions