zink: fix VK_DYNAMIC_STATE_LINE_WIDTH usage
add a special tracker here to set the state only when necessary
Fixes: 659c39fafb ("zink: rework primitive rasterization type logic")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20886>
This commit is contained in:
committed by
Marge Bot
parent
a5bff81f47
commit
06a125942b
@@ -1,6 +1,6 @@
|
||||
# Please include a comment with the log message and a testcase triggering each
|
||||
# VUID at the bottom of the file.
|
||||
khronos_validation.message_id_filter = VUID-vkCmdDrawMultiEXT-commandBuffer-02701,VUID-vkCmdDrawMultiIndexedEXT-commandBuffer-02701,VUID-vkCmdDrawMultiEXT-colorAttachmentCount-06188,VUID-VkGraphicsPipelineCreateInfo-Geometry-07725,VUID-VkShaderModuleCreateInfo-pCode-01091,VUID-vkCmdCopyImage-srcImage-07743,VUID-vkCmdDrawMultiEXT-None-06479,VUID-vkCmdDrawMultiIndexedEXT-format-07753,VUID-vkCmdDrawMultiEXT-viewType-07752,VUID-vkCmdDispatch-viewType-07752,VUID-vkCmdDrawMultiEXT-magFilter-04553,VUID-vkCmdDrawMultiIndexedEXT-magFilter-04553,VUID-RuntimeSpirv-Location-06272,VUID-vkDestroyDevice-device-00378,UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout,VUID-VkDescriptorImageInfo-imageLayout-00344,VUID-vkCmdDrawMultiEXT-None-02699
|
||||
khronos_validation.message_id_filter = VUID-vkCmdDrawMultiEXT-colorAttachmentCount-06188,VUID-VkGraphicsPipelineCreateInfo-Geometry-07725,VUID-VkShaderModuleCreateInfo-pCode-01091,VUID-vkCmdCopyImage-srcImage-07743,VUID-vkCmdDrawMultiEXT-None-06479,VUID-vkCmdDrawMultiIndexedEXT-format-07753,VUID-vkCmdDrawMultiEXT-viewType-07752,VUID-vkCmdDispatch-viewType-07752,VUID-vkCmdDrawMultiEXT-magFilter-04553,VUID-vkCmdDrawMultiIndexedEXT-magFilter-04553,VUID-RuntimeSpirv-Location-06272,VUID-vkDestroyDevice-device-00378,UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout,VUID-VkDescriptorImageInfo-imageLayout-00344,VUID-vkCmdDrawMultiEXT-None-02699
|
||||
khronos_validation.report_flags = error
|
||||
khronos_validation.debug_action = VK_DBG_LAYER_ACTION_LOG_MSG,VK_DBG_LAYER_ACTION_BREAK
|
||||
VK_LAYER_ENABLES=VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT
|
||||
@@ -24,20 +24,6 @@ khronos_validation.log_filename = stdout
|
||||
# prior to destroying device
|
||||
# (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkDestroyDevice-device-00378)
|
||||
|
||||
# caselist of:
|
||||
# dEQP-GLES3.functional.primitive_restart.end_restart_duplicate_restarts.lines.unsigned_short.draw_elements_instanced
|
||||
# dEQP-GLES3.functional.primitive_restart.end_restart_duplicate_restarts.triangles.unsigned_byte.draw_range_elements
|
||||
#
|
||||
# [ VUID-vkCmdDrawMultiIndexedEXT-commandBuffer-02701 ] Object 0: handle =
|
||||
# 0x56094dcd5a20, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xef7d036b |
|
||||
# vkCmdDrawMultiIndexedEXT: VK_DYNAMIC_STATE_VIEWPORT state not set for this
|
||||
# command buffer. The Vulkan spec states: If the VkPipeline object bound to the
|
||||
# pipeline bind point used by this command requires any dynamic state, that state
|
||||
# must have been set or inherited (if the VK_NV_inherited_viewport_scissor
|
||||
# extension is enabled) for commandBuffer, and done so after any previously bound
|
||||
# pipeline with the corresponding state not specified as dynamic
|
||||
# (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdDrawMultiIndexedEXT-commandBuffer-02701)
|
||||
|
||||
# caselist of :
|
||||
# dEQP-GLES31.functional.shaders.helper_invocation.value.triangles
|
||||
# dEQP-GLES31.functional.shaders.helper_invocation.value.wide_points_4_samples
|
||||
|
||||
@@ -734,9 +734,11 @@ zink_draw(struct pipe_context *pctx,
|
||||
}
|
||||
}
|
||||
|
||||
if ((BATCH_CHANGED || rast_state_changed || rast_prim_changed) &&
|
||||
ctx->gfx_pipeline_state.rast_prim == PIPE_PRIM_LINES) {
|
||||
if (BATCH_CHANGED ||
|
||||
/* only re-emit on non-batch change when actually drawing lines */
|
||||
((ctx->line_width_changed || rast_prim_changed) && ctx->gfx_pipeline_state.rast_prim == PIPE_PRIM_LINES)) {
|
||||
VKCTX(CmdSetLineWidth)(batch->state->cmdbuf, rast_state->line_width);
|
||||
ctx->line_width_changed = false;
|
||||
}
|
||||
|
||||
if (BATCH_CHANGED || mode_changed ||
|
||||
|
||||
@@ -635,6 +635,7 @@ zink_bind_rasterizer_state(struct pipe_context *pctx, void *cso)
|
||||
bool clip_halfz = ctx->rast_state ? ctx->rast_state->hw_state.clip_halfz : false;
|
||||
bool rasterizer_discard = ctx->rast_state ? ctx->rast_state->base.rasterizer_discard : false;
|
||||
bool half_pixel_center = ctx->rast_state ? ctx->rast_state->base.half_pixel_center : true;
|
||||
float line_width = ctx->rast_state ? ctx->rast_state->base.line_width : 1.0;
|
||||
ctx->rast_state = cso;
|
||||
|
||||
if (ctx->rast_state) {
|
||||
@@ -656,6 +657,9 @@ zink_bind_rasterizer_state(struct pipe_context *pctx, void *cso)
|
||||
ctx->vp_state_changed = true;
|
||||
}
|
||||
|
||||
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;
|
||||
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)
|
||||
|
||||
@@ -1758,6 +1758,7 @@ struct zink_context {
|
||||
bool blend_state_changed : 1;
|
||||
bool sample_mask_changed : 1;
|
||||
bool rast_state_changed : 1;
|
||||
bool line_width_changed : 1;
|
||||
bool dsa_state_changed : 1;
|
||||
bool stencil_ref_changed : 1;
|
||||
bool rasterizer_discard_changed : 1;
|
||||
|
||||
Reference in New Issue
Block a user