summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <chadversary@chromium.org>2017-03-06 08:41:54 -0800
committerChad Versace <chadversary@chromium.org>2017-03-06 10:37:15 -0800
commit941e4f2a41d761ac7f041ae10aaca6ef317a1d87 (patch)
tree6b2e2888ce3a008b1164c1e875834f9b78945bcf
parent4c872814dd97d5b7c672ea13d04dbbed5b30619b (diff)
downloadvulkan-spec-941e4f2a41d761ac7f041ae10aaca6ef317a1d87.zip
vulkan-spec-941e4f2a41d761ac7f041ae10aaca6ef317a1d87.tar.xz
RFC: VK_EXT_get_image_properties: Add extension
TODO: Reserve extension number. TODO: Need review feedback from Khronos.
-rw-r--r--doc/specs/vulkan/appendices/VK_EXT_get_image_properties.txt59
-rw-r--r--doc/specs/vulkan/appendices/extensions.txt4
-rw-r--r--doc/specs/vulkan/chapters/resources.txt26
-rw-r--r--src/spec/vk.xml20
-rw-r--r--src/vulkan/vulkan.h20
5 files changed, 129 insertions, 0 deletions
diff --git a/doc/specs/vulkan/appendices/VK_EXT_get_image_properties.txt b/doc/specs/vulkan/appendices/VK_EXT_get_image_properties.txt
new file mode 100644
index 0000000..d7dd3ff
--- /dev/null
+++ b/doc/specs/vulkan/appendices/VK_EXT_get_image_properties.txt
@@ -0,0 +1,59 @@
+[[VK_EXT_get_image_properties]]
+== VK_EXT_get_image_properties
+
+*Name String*::
+ +VK_EXT_get_image_properties+
+*Extension Type*::
+ Device extension
+*Registered Extension Number*::
+ TODO
+*Last Modified Date*::
+ 2017-03-06
+*Revision*::
+ 1.0
+*IP Status*::
+ Draft
+*Dependencies*::
+ - This extension is written against version 1.0.42 of the Vulkan API.
+*Contributors*::
+ - Chad Versace, Google <chadversary@chromium.org>
+*Contact*::
+ - Chad Versace, Google <chadversary@chromium.org>
+
+This extension provides a new entry point to query the properties of
+a tlink:VkImage.
+This extension itself, howerver, defines no queryable properties.
+Its purpose is similar to that of +VK_KHR_get_physical_device_properties2+.
+It provides a common entry point for other extensions,
+thereby eliminating a proliferation of extesnsion-specific entry points.
+
+=== New Object Types
+
+None.
+
+=== New Enum Constants
+
+ * Extending elink:VkStructureType:
+ ** ename:VK_STRUCTURE_TYPE_IMAGE_PROPERTIES_EXT
+
+=== New Enums
+
+None.
+
+=== New Structs
+
+ * slink:VkImagePropertiesEXT
+
+=== New Functions
+
+ * flink:vkGetImagePropertiesEXT
+
+=== Issues
+
+None.
+
+
+==== Version History
+
+ * Revision 1.0, 2017-03-06 (Chad Versace)
+ - First draft.
diff --git a/doc/specs/vulkan/appendices/extensions.txt b/doc/specs/vulkan/appendices/extensions.txt
index 0e269ea..1675233 100644
--- a/doc/specs/vulkan/appendices/extensions.txt
+++ b/doc/specs/vulkan/appendices/extensions.txt
@@ -212,6 +212,10 @@ ifdef::VK_EXT_display_control[]
include::VK_EXT_display_control.txt[]
endif::VK_EXT_display_control[]
+ifdef::VK_EXT_get_image_properties[]
+include::VK_EXT_get_image_properties.txt[]
+endif::VK_EXT_get_image_properties[]
+
ifdef::VK_EXT_shader_subgroup_ballot[]
include::VK_EXT_shader_subgroup_ballot.txt[]
endif::VK_EXT_shader_subgroup_ballot[]
diff --git a/doc/specs/vulkan/chapters/resources.txt b/doc/specs/vulkan/chapters/resources.txt
index bda040e..aea7397 100644
--- a/doc/specs/vulkan/chapters/resources.txt
+++ b/doc/specs/vulkan/chapters/resources.txt
@@ -1148,6 +1148,32 @@ memory allocation.
include::../validity/structs/VkSubresourceLayout.txt[]
+// refBegin vkGetImagePropertiesEXT Query the properties of an image
+
+To query other properties of an image, call:
+
+include::../api/protos/vkGetImagePropertiesEXT.txt[]
+
+ * pname:device is the logical device that owns the image.
+ * pname:image is the image being queried.
+ * pname:pProperties is a pointer to a slink:VkImagePropertiesEXT structure
+ in which the properties are returned.
+
+include::../validity/protos/vkGetImagePropertiesEXT.txt[]
+
+// refBegin VkImagePropertiesEXT Structure specifying image properties
+
+The slink:VkImagePropertiesEXT structure itself specifies no queryable
+properties. Queryable properties are instead specified by structures in its
+pname:pNext chain. The pname:VkImagePropertiesEXT structure is defined as:
+
+include::../api/structs/VkImagePropertiesEXT.txt[]
+
+ * pname:sType is the type of this structure.
+ * pname:pNext is `NULL` or a pointer to an extension-specific structure.
+
+// refEnd VkImagePropertiesEXT
+
// refBegin vkDestroyImage Destroy an image object
To destroy an image, call:
diff --git a/src/spec/vk.xml b/src/spec/vk.xml
index e4e78c2..fdb8c5d 100644
--- a/src/spec/vk.xml
+++ b/src/spec/vk.xml
@@ -2231,6 +2231,10 @@ maintained in the master branch of the Khronos Vulkan GitHub project.
<member><type>void</type>* <name>pNext</name></member> <!-- Pointer to next structure -->
<member><type>VkBool32</type> <name>perViewPositionAllComponents</name></member>
</type>
+ <type category="struct" name="VkImagePropertiesEXT">
+ <member values="VK_STRUCTURE_TYPE_IMAGE_PROPERTIES_EXT"><type>VkStructureType</type> <name>sType</name></member>
+ <member><type>void</type>* <name>pNext</name></member>
+ </type>
</types>
<!-- SECTION: Vulkan enumerant (token) definitions. -->
@@ -4773,6 +4777,12 @@ maintained in the master branch of the Khronos Vulkan GitHub project.
<param><type>uint32_t</type> <name>discardRectangleCount</name></param>
<param len="discardRectangleCount">const <type>VkRect2D</type>* <name>pDiscardRectangles</name></param>
</command>
+ <command successcodes="VK_SUCCESS">
+ <proto><type>VkResult</type> <name>vkGetImagePropertiesEXT</name></proto>
+ <param><type>VkDevice</type> <name>device</name></param>
+ <param><type>VkImage</type> <name>image</name></param>
+ <param><type>VkImagePropertiesEXT</type>* <name>pProperties</name></param>
+ </command>
</commands>
<!-- SECTION: Vulkan API interface definitions -->
@@ -6195,5 +6205,15 @@ maintained in the master branch of the Khronos Vulkan GitHub project.
<enum value="&quot;VK_MESA_extension_127&quot;" name="VK_MESA_EXTENSION_127_EXTENSION_NAME"/>
</require>
</extension>
+ <extension name="VK_EXT_get_image_properties" number="200" type="device" author="EXT" contact="Chad Versace @chadversary" supported="vulkan">
+ <!-- TODO: Replace the place-holder extension number with a reserved one. -->
+ <require>
+ <enum value="1" name="VK_EXT_GET_IMAGE_PROPERTIES_SPEC_VERSION"/>
+ <enum value="&quot;VK_EXT_get_image_properties&quot;" name="VK_EXT_GET_IMAGE_PROPERTIES_EXTENSION_NAME"/>
+ <enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_IMAGE_PROPERTIES_EXT"/>
+ <type name="VkImagePropertiesEXT"/>
+ <command name="vkGetImagePropertiesEXT"/>
+ </require>
+ </extension>
</extensions>
</registry>
diff --git a/src/vulkan/vulkan.h b/src/vulkan/vulkan.h
index 2ae84ce..4f21ee4 100644
--- a/src/vulkan/vulkan.h
+++ b/src/vulkan/vulkan.h
@@ -300,6 +300,7 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001,
VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000,
VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000,
+ VK_STRUCTURE_TYPE_IMAGE_PROPERTIES_EXT = 1000199000,
VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO,
VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO,
VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1),
@@ -5731,6 +5732,25 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK(
#define VK_MESAX_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME "VK_MESAX_external_memory_dma_buf"
+#define VK_EXT_get_image_properties 1
+#define VK_EXT_GET_IMAGE_PROPERTIES_SPEC_VERSION 1
+#define VK_EXT_GET_IMAGE_PROPERTIES_EXTENSION_NAME "VK_EXT_get_image_properties"
+
+typedef struct VkImagePropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+} VkImagePropertiesEXT;
+
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetImagePropertiesEXT)(VkDevice device, VkImage image, VkImagePropertiesEXT* pProperties);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetImagePropertiesEXT(
+ VkDevice device,
+ VkImage image,
+ VkImagePropertiesEXT* pProperties);
+#endif
+
#ifdef __cplusplus
}
#endif