venus: add VK_EXT_line_rasterization support

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15205>
This commit is contained in:
Yiwei Zhang 2022-03-01 18:40:31 +00:00 committed by Marge Bot
parent 58182eb096
commit 33ba61b059
3 changed files with 35 additions and 0 deletions

View file

@ -1802,6 +1802,24 @@ vn_CmdDispatchBase(VkCommandBuffer commandBuffer,
groupCountY, groupCountZ);
}
void
vn_CmdSetLineStippleEXT(VkCommandBuffer commandBuffer,
uint32_t lineStippleFactor,
uint16_t lineStipplePattern)
{
struct vn_command_buffer *cmd =
vn_command_buffer_from_handle(commandBuffer);
size_t cmd_size;
cmd_size = vn_sizeof_vkCmdSetLineStippleEXT(
commandBuffer, lineStippleFactor, lineStipplePattern);
if (!vn_cs_encoder_reserve(&cmd->cs, cmd_size))
return;
vn_encode_vkCmdSetLineStippleEXT(&cmd->cs, 0, commandBuffer,
lineStippleFactor, lineStipplePattern);
}
void
vn_CmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer,
VkQueryPool queryPool,

View file

@ -130,6 +130,9 @@ vn_physical_device_init_features(struct vn_physical_device *physical_dev)
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_line_rasterization,
feats->line_rasterization,
LINE_RASTERIZATION_FEATURES_EXT, features2);
VN_ADD_EXT_TO_PNEXT(exts->EXT_transform_feedback,
feats->transform_feedback,
TRANSFORM_FEEDBACK_FEATURES_EXT, features2);
@ -419,6 +422,9 @@ vn_physical_device_init_properties(struct vn_physical_device *physical_dev)
VN_ADD_EXT_TO_PNEXT(exts->EXT_custom_border_color,
props->custom_border_color,
CUSTOM_BORDER_COLOR_PROPERTIES_EXT, properties2);
VN_ADD_EXT_TO_PNEXT(exts->EXT_line_rasterization,
props->line_rasterization,
LINE_RASTERIZATION_PROPERTIES_EXT, properties2);
VN_ADD_EXT_TO_PNEXT(exts->EXT_transform_feedback,
props->transform_feedback,
TRANSFORM_FEEDBACK_PROPERTIES_EXT, properties2);
@ -915,6 +921,7 @@ vn_physical_device_get_passthrough_extensions(
#ifndef ANDROID
.EXT_image_drm_format_modifier = true,
#endif
.EXT_line_rasterization = true,
.EXT_queue_family_foreign = true,
.EXT_transform_feedback = true,
};
@ -1633,6 +1640,7 @@ vn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
/* EXT */
VkPhysicalDeviceCustomBorderColorFeaturesEXT *custom_border_color;
VkPhysicalDeviceLineRasterizationFeaturesEXT *line_rasterization;
VkPhysicalDeviceTransformFeedbackFeaturesEXT *transform_feedback;
} u;
@ -1806,6 +1814,9 @@ vn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
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_LINE_RASTERIZATION_FEATURES_EXT:
*u.line_rasterization = feats->line_rasterization;
break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT:
*u.transform_feedback = feats->transform_feedback;
break;
@ -1855,6 +1866,7 @@ vn_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
/* EXT */
VkPhysicalDeviceCustomBorderColorPropertiesEXT *custom_border_color;
VkPhysicalDeviceLineRasterizationPropertiesEXT *line_rasterization;
VkPhysicalDevicePCIBusInfoPropertiesEXT *pci_bus_info;
VkPhysicalDevicePresentationPropertiesANDROID *presentation_properties;
VkPhysicalDeviceTransformFeedbackPropertiesEXT *transform_feedback;
@ -2044,6 +2056,9 @@ vn_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT:
*u.custom_border_color = props->custom_border_color;
break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT:
*u.line_rasterization = props->line_rasterization;
break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT:
/* this is used by WSI */
if (physical_dev->instance->renderer->info.pci.has_bus_info) {

View file

@ -28,6 +28,7 @@ struct vn_physical_device_features {
/* EXT */
VkPhysicalDeviceCustomBorderColorFeaturesEXT custom_border_color;
VkPhysicalDeviceLineRasterizationFeaturesEXT line_rasterization;
VkPhysicalDeviceTransformFeedbackFeaturesEXT transform_feedback;
};
@ -38,6 +39,7 @@ struct vn_physical_device_properties {
/* EXT */
VkPhysicalDeviceCustomBorderColorPropertiesEXT custom_border_color;
VkPhysicalDeviceLineRasterizationPropertiesEXT line_rasterization;
VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback;
};