mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 00:10:10 +01:00
zink: use polygonModePointSize instead of open-coding
VK_KHR_maintenance5 added a query for exactly this behavior, so we should query that instead of manually checking for the one driver where this is known to be a problem. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37221>
This commit is contained in:
parent
9a93f794cd
commit
8c8a7da43e
4 changed files with 11 additions and 19 deletions
|
|
@ -409,6 +409,7 @@
|
|||
"VK_EXT_provoking_vertex": 1,
|
||||
"VK_EXT_attachment_feedback_loop_layout": 1,
|
||||
"VK_EXT_attachment_feedback_loop_dynamic_state": 1,
|
||||
"VK_KHR_maintenance5": 1,
|
||||
"VK_KHR_maintenance6": 1,
|
||||
"VK_KHR_maintenance7": 1,
|
||||
"VK_KHR_maintenance8": 1
|
||||
|
|
@ -451,6 +452,9 @@
|
|||
"VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT": {
|
||||
"attachmentFeedbackLoopDynamicState": true
|
||||
},
|
||||
"VkPhysicalDeviceMaintenance5FeaturesKHR": {
|
||||
"maintenance5": true
|
||||
},
|
||||
"VkPhysicalDeviceMaintenance6FeaturesKHR": {
|
||||
"maintenance6": true
|
||||
},
|
||||
|
|
@ -464,6 +468,9 @@
|
|||
"properties": {
|
||||
"VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT": {
|
||||
"graphicsPipelineLibraryFastLinking": true
|
||||
},
|
||||
"VkPhysicalDeviceMaintenance5PropertiesKHR": {
|
||||
"polygonModePointSize": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2871,19 +2871,6 @@ init_driver_workarounds(struct zink_screen *screen)
|
|||
screen->info.feats.features.geometryShader)
|
||||
screen->driver_workarounds.no_linesmooth = true;
|
||||
|
||||
/* This is a workarround for the lack of
|
||||
* gl_PointSize + glPolygonMode(..., GL_LINE), in the imagination
|
||||
* proprietary driver.
|
||||
*/
|
||||
switch (zink_driverid(screen)) {
|
||||
case VK_DRIVER_ID_IMAGINATION_PROPRIETARY:
|
||||
screen->driver_workarounds.no_hw_gl_point = true;
|
||||
break;
|
||||
default:
|
||||
screen->driver_workarounds.no_hw_gl_point = false;
|
||||
break;
|
||||
}
|
||||
|
||||
/* these drivers don't use VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT, so it can always be set */
|
||||
switch (zink_driverid(screen)) {
|
||||
case VK_DRIVER_ID_MESA_RADV:
|
||||
|
|
@ -3089,7 +3076,7 @@ init_optimal_keys(struct zink_screen *screen)
|
|||
!screen->driconf.inline_uniforms &&
|
||||
!screen->driver_workarounds.no_linestipple &&
|
||||
!screen->driver_workarounds.no_linesmooth &&
|
||||
!screen->driver_workarounds.no_hw_gl_point &&
|
||||
screen->info.maint5_props.polygonModePointSize &&
|
||||
!screen->driver_compiler_workarounds.lower_robustImageAccess2 &&
|
||||
!screen->driconf.emulate_point_smooth &&
|
||||
!screen->driver_compiler_workarounds.needs_zs_shader_swizzle;
|
||||
|
|
@ -3111,8 +3098,7 @@ init_optimal_keys(struct zink_screen *screen)
|
|||
CHECK_OR_PRINT(have_EXT_provoking_vertex);
|
||||
if (screen->driver_workarounds.no_linesmooth)
|
||||
fprintf(stderr, "driver does not support smooth lines\n");
|
||||
if (screen->driver_workarounds.no_hw_gl_point)
|
||||
fprintf(stderr, "driver does not support hardware GL_POINT\n");
|
||||
CHECK_OR_PRINT(maint5_props.polygonModePointSize);
|
||||
CHECK_OR_PRINT(rb2_feats.robustImageAccess2);
|
||||
CHECK_OR_PRINT(feats.features.robustBufferAccess);
|
||||
CHECK_OR_PRINT(rb_image_feats.robustImageAccess);
|
||||
|
|
|
|||
|
|
@ -614,7 +614,7 @@ zink_create_rasterizer_state(struct pipe_context *pctx,
|
|||
debug_printf("BUG: vulkan doesn't support different front and back fill modes\n");
|
||||
|
||||
if (rs_state->fill_front == PIPE_POLYGON_MODE_POINT &&
|
||||
screen->driver_workarounds.no_hw_gl_point) {
|
||||
!screen->info.maint5_props.polygonModePointSize) {
|
||||
state->hw_state.polygon_mode = VK_POLYGON_MODE_FILL;
|
||||
state->cull_mode = VK_CULL_MODE_NONE;
|
||||
} else {
|
||||
|
|
@ -734,7 +734,7 @@ zink_bind_rasterizer_state(struct pipe_context *pctx, void *cso)
|
|||
if (fabs(ctx->rast_state->base.line_width - line_width) > FLT_EPSILON)
|
||||
ctx->line_width_changed = true;
|
||||
|
||||
bool lower_gl_point = screen->driver_workarounds.no_hw_gl_point;
|
||||
bool lower_gl_point = !screen->info.maint5_props.polygonModePointSize;
|
||||
lower_gl_point &= ctx->rast_state->base.fill_front == PIPE_POLYGON_MODE_POINT;
|
||||
if (zink_get_gs_key(ctx)->lower_gl_point != lower_gl_point)
|
||||
zink_set_gs_key(ctx)->lower_gl_point = lower_gl_point;
|
||||
|
|
|
|||
|
|
@ -1515,7 +1515,6 @@ struct zink_screen {
|
|||
bool track_renderpasses;
|
||||
bool no_linestipple;
|
||||
bool no_linesmooth;
|
||||
bool no_hw_gl_point;
|
||||
bool can_do_invalid_linear_modifier;
|
||||
bool inconsistent_interpolation;
|
||||
bool can_2d_view_sparse;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue