diff --git a/src/gallium/frontends/d3d10umd/Rasterizer.cpp b/src/gallium/frontends/d3d10umd/Rasterizer.cpp index 9402f383b31..df127c793c5 100644 --- a/src/gallium/frontends/d3d10umd/Rasterizer.cpp +++ b/src/gallium/frontends/d3d10umd/Rasterizer.cpp @@ -232,6 +232,7 @@ CreateRasterizerState( state.point_tri_clip = 1; state.line_width = 1.0f; + state.line_rectangular = 0; pRasterizerState->handle = pipe->create_rasterizer_state(pipe, &state); } diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index 044934ef04b..dc403b8a6c9 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -510,6 +510,7 @@ static void handle_graphics_pipeline(struct lvp_cmd_buffer_entry *cmd, state->rs_state.half_pixel_center = true; state->rs_state.scissor = true; state->rs_state.no_ms_sample_mask_out = true; + state->rs_state.line_rectangular = pipeline->line_rectangular; if (!dynamic_states[VK_DYNAMIC_STATE_LINE_WIDTH]) state->rs_state.line_width = rsc->lineWidth; diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c index 6ab4bbac9ac..a2a54bd99c9 100644 --- a/src/gallium/frontends/lavapipe/lvp_pipeline.c +++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c @@ -815,11 +815,14 @@ lvp_graphics_pipeline_init(struct lvp_pipeline *pipeline, pipeline->line_smooth = line_state->lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT; pipeline->disable_multisample = line_state->lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT || line_state->lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT; + pipeline->line_rectangular = line_state->lineRasterizationMode != VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT && + line_state->lineRasterizationMode != VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT; if (!dynamic_state_contains(pipeline->graphics_create_info.pDynamicState, VK_DYNAMIC_STATE_LINE_STIPPLE_EXT)) { pipeline->line_stipple_factor = line_state->lineStippleFactor - 1; pipeline->line_stipple_pattern = line_state->lineStipplePattern; } - } + } else + pipeline->line_rectangular = false; for (uint32_t i = 0; i < pCreateInfo->stageCount; i++) { diff --git a/src/gallium/frontends/lavapipe/lvp_private.h b/src/gallium/frontends/lavapipe/lvp_private.h index 830b2e78b06..6def9d3d36d 100644 --- a/src/gallium/frontends/lavapipe/lvp_private.h +++ b/src/gallium/frontends/lavapipe/lvp_private.h @@ -484,6 +484,7 @@ struct lvp_pipeline { bool line_stipple_enable; bool line_smooth; bool disable_multisample; + bool line_rectangular; bool gs_output_lines; bool provoking_vertex_last; }; diff --git a/src/gallium/frontends/nine/nine_pipe.c b/src/gallium/frontends/nine/nine_pipe.c index 4792e784a65..84644567ee7 100644 --- a/src/gallium/frontends/nine/nine_pipe.c +++ b/src/gallium/frontends/nine/nine_pipe.c @@ -116,6 +116,7 @@ nine_convert_rasterizer_state(struct NineDevice9 *device, /* rast.line_stipple_pattern = 0; */ rast.sprite_coord_enable = rs[D3DRS_POINTSPRITEENABLE] ? 0xff : 0x00; rast.line_width = 1.0f; + rast.line_rectangular = 0; if (rs[NINED3DRS_VSPOINTSIZE]) { rast.point_size = 1.0f; } else { diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index f9027908b39..9c44e22b5af 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -117,6 +117,7 @@ struct pipe_rasterizer_state unsigned line_smooth:1; unsigned line_stipple_enable:1; unsigned line_last_pixel:1; + unsigned line_rectangular:1; /** lines rasterized as rectangles or parallelograms */ unsigned conservative_raster_mode:2; /**< PIPE_CONSERVATIVE_RASTER_x */ /** diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index dec747b9ea7..3f8dd67da32 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -246,6 +246,8 @@ st_update_rasterizer(struct st_context *st) ctx->Const.MaxLineWidth); } + raster->line_rectangular = multisample || ctx->Line.SmoothFlag; + /* When the pattern is all 1's, it means line stippling is disabled */ raster->line_stipple_enable = ctx->Line.StippleFlag && ctx->Line.StipplePattern != 0xffff; raster->line_stipple_pattern = ctx->Line.StipplePattern;