Module: Mesa
Branch: main
Commit: df338fe7d1ebe3caa7a6ad2168a103835577c4c6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=df338fe7d1ebe3caa7a6ad2168a103835577c4c6

Author: Iván Briano <[email protected]>
Date:   Wed Jul 28 20:32:15 2021 -0700

anv: Don't copy the lineStipple values if lineStipple is not enabled

If the passed VkPipelineRasterizationLineStateCreateInfoEXT wasn't zero
initialized, we copy garbage values that are later on used to set the
state and may end up crashing when they are beyond the limits of the HW.

v2 (Lionel): Simplify if condition

Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12121>

---

 src/intel/vulkan/anv_pipeline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 845976f4170..d56db49ba52 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -2147,7 +2147,7 @@ copy_non_dynamic_state(struct anv_graphics_pipeline 
*pipeline,
    const VkPipelineRasterizationLineStateCreateInfoEXT *line_state =
       vk_find_struct_const(pCreateInfo->pRasterizationState->pNext,
                            PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT);
-   if (line_state) {
+   if (!raster_discard && line_state && line_state->stippledLineEnable) {
       if (states & ANV_CMD_DIRTY_DYNAMIC_LINE_STIPPLE) {
          dynamic->line_stipple.factor = line_state->lineStippleFactor;
          dynamic->line_stipple.pattern = line_state->lineStipplePattern;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to