zink: do not set lineWidth to invalid value
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 23 Sep 2019 20:13:50 +0000 (22:13 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:48 +0000 (08:51 +0000)
Some implementations don't support the lineWidth-feature, so let's
avoid setting invalid state to them. But since we don't have a fallback
for this, inform the user.

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_pipeline.c

index 25806bbbfcb7af37be5538ee0e071e25d0254042..b479673bf8725f5bd3d3a0a1527c0173e435b60f 100644 (file)
@@ -85,7 +85,12 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
    rast_state.depthBiasConstantFactor = 0.0;
    rast_state.depthBiasClamp = 0.0;
    rast_state.depthBiasSlopeFactor = 0.0;
-   rast_state.lineWidth = state->line_width;
+   if (screen->feats.wideLines)
+      rast_state.lineWidth = state->line_width;
+   else {
+      debug_printf("BUG: wide lines not supported, needs fallback!");
+      rast_state.lineWidth = 1.0f;
+   }
 
    VkPipelineDepthStencilStateCreateInfo depth_stencil_state = {};
    depth_stencil_state.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;