Mesa (main): venus: add VK_EXT_{conditional_rendering,index_type_uint8} extensions
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Apr 5 05:16:41 UTC 2022
Module: Mesa
Branch: main
Commit: cc8e2718137bbf5dea8f44f5f5438e252673f99a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc8e2718137bbf5dea8f44f5f5438e252673f99a
Author: Igor Torrente <igor.torrente at collabora.com>
Date: Tue Mar 29 11:59:49 2022 -0300
venus: add VK_EXT_{conditional_rendering,index_type_uint8} extensions
Implements all the necessary code in the device initialization
and extensions functions.
Signed-off-by: Igor Torrente <igor.torrente at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15652>
---
src/virtio/vulkan/vn_command_buffer.c | 15 +++++++++++++++
src/virtio/vulkan/vn_physical_device.c | 15 +++++++++++++++
src/virtio/vulkan/vn_physical_device.h | 2 ++
3 files changed, 32 insertions(+)
diff --git a/src/virtio/vulkan/vn_command_buffer.c b/src/virtio/vulkan/vn_command_buffer.c
index 155d23f5e18..b70fbb1cc18 100644
--- a/src/virtio/vulkan/vn_command_buffer.c
+++ b/src/virtio/vulkan/vn_command_buffer.c
@@ -1564,3 +1564,18 @@ vn_CmdSetRasterizerDiscardEnable(VkCommandBuffer commandBuffer,
VN_CMD_ENQUEUE(vkCmdSetRasterizerDiscardEnable, commandBuffer,
rasterizerDiscardEnable);
}
+
+void
+vn_CmdBeginConditionalRenderingEXT(
+ VkCommandBuffer commandBuffer,
+ const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin)
+{
+ VN_CMD_ENQUEUE(vkCmdBeginConditionalRenderingEXT, commandBuffer,
+ pConditionalRenderingBegin);
+}
+
+void
+vn_CmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer)
+{
+ VN_CMD_ENQUEUE(vkCmdEndConditionalRenderingEXT, commandBuffer);
+}
diff --git a/src/virtio/vulkan/vn_physical_device.c b/src/virtio/vulkan/vn_physical_device.c
index eced424fcff..88d12ca0882 100644
--- a/src/virtio/vulkan/vn_physical_device.c
+++ b/src/virtio/vulkan/vn_physical_device.c
@@ -135,11 +135,16 @@ vn_physical_device_init_features(struct vn_physical_device *physical_dev)
features2);
/* EXT */
+ VN_ADD_EXT_TO_PNEXT(exts->EXT_conditional_rendering,
+ feats->conditional_rendering,
+ CONDITIONAL_RENDERING_FEATURES_EXT, features2);
VN_ADD_EXT_TO_PNEXT(exts->EXT_custom_border_color,
feats->custom_border_color,
CUSTOM_BORDER_COLOR_FEATURES_EXT, features2);
VN_ADD_EXT_TO_PNEXT(exts->EXT_depth_clip_enable, feats->depth_clip_enable,
DEPTH_CLIP_ENABLE_FEATURES_EXT, features2);
+ VN_ADD_EXT_TO_PNEXT(exts->EXT_index_type_uint8, feats->index_type_uint8,
+ INDEX_TYPE_UINT8_FEATURES_EXT, features2);
VN_ADD_EXT_TO_PNEXT(exts->EXT_line_rasterization,
feats->line_rasterization,
LINE_RASTERIZATION_FEATURES_EXT, features2);
@@ -948,12 +953,14 @@ vn_physical_device_get_passthrough_extensions(
/* EXT */
.EXT_calibrated_timestamps = true,
+ .EXT_conditional_rendering = true,
.EXT_conservative_rasterization = true,
.EXT_custom_border_color = true,
.EXT_depth_clip_enable = true,
#ifndef ANDROID
.EXT_image_drm_format_modifier = true,
#endif
+ .EXT_index_type_uint8 = true,
.EXT_line_rasterization = true,
.EXT_provoking_vertex = true,
.EXT_queue_family_foreign = true,
@@ -1581,8 +1588,10 @@ vn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
*shader_demote_to_helper_invocation;
/* EXT */
+ VkPhysicalDeviceConditionalRenderingFeaturesEXT *conditional_rendering;
VkPhysicalDeviceCustomBorderColorFeaturesEXT *custom_border_color;
VkPhysicalDeviceDepthClipEnableFeaturesEXT *depth_clip_enable;
+ VkPhysicalDeviceIndexTypeUint8FeaturesEXT *index_type_uint8;
VkPhysicalDeviceLineRasterizationFeaturesEXT *line_rasterization;
VkPhysicalDeviceProvokingVertexFeaturesEXT *provoking_vertex;
VkPhysicalDeviceRobustness2FeaturesEXT *robustness_2;
@@ -1768,12 +1777,18 @@ vn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
break;
/* EXT */
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT:
+ *u.conditional_rendering = feats->conditional_rendering;
+ break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT:
*u.custom_border_color = feats->custom_border_color;
break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT:
*u.depth_clip_enable = feats->depth_clip_enable;
break;
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT:
+ *u.index_type_uint8 = feats->index_type_uint8;
+ break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT:
*u.line_rasterization = feats->line_rasterization;
break;
diff --git a/src/virtio/vulkan/vn_physical_device.h b/src/virtio/vulkan/vn_physical_device.h
index 1c151c8e770..166440e86bd 100644
--- a/src/virtio/vulkan/vn_physical_device.h
+++ b/src/virtio/vulkan/vn_physical_device.h
@@ -31,8 +31,10 @@ struct vn_physical_device_features {
shader_demote_to_helper_invocation;
/* EXT */
+ VkPhysicalDeviceConditionalRenderingFeaturesEXT conditional_rendering;
VkPhysicalDeviceCustomBorderColorFeaturesEXT custom_border_color;
VkPhysicalDeviceDepthClipEnableFeaturesEXT depth_clip_enable;
+ VkPhysicalDeviceIndexTypeUint8FeaturesEXT index_type_uint8;
VkPhysicalDeviceLineRasterizationFeaturesEXT line_rasterization;
VkPhysicalDeviceProvokingVertexFeaturesEXT provoking_vertex;
VkPhysicalDeviceRobustness2FeaturesEXT robustness_2;
More information about the mesa-commit
mailing list