mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-24 13:40:37 +02:00
i965: Use ctx->Const.MaxLineWidth when clamping ctx->Line.Width.
Rather than hardcoding platform values in every code path, just use the maximum value we set. Currently, ctx->Const.LineWidth == 5, which is smaller than the hardware limit. But applications shouldn't be using a value larger than we support anyway. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
This commit is contained in:
parent
87927ed1f0
commit
61838fd9ad
4 changed files with 8 additions and 5 deletions
|
|
@ -213,8 +213,8 @@ static void upload_sf_unit( struct brw_context *brw )
|
|||
}
|
||||
|
||||
/* _NEW_LINE */
|
||||
/* XXX use ctx->Const.Min/MaxLineWidth here */
|
||||
sf->sf6.line_width = CLAMP(ctx->Line.Width, 1.0, 5.0) * (1<<1);
|
||||
sf->sf6.line_width =
|
||||
CLAMP(ctx->Line.Width, 1.0, ctx->Const.MaxLineWidth) * (1<<1);
|
||||
|
||||
sf->sf6.line_endcap_aa_region_width = 1;
|
||||
if (ctx->Line.SmoothFlag)
|
||||
|
|
|
|||
|
|
@ -322,7 +322,8 @@ upload_sf_state(struct brw_context *brw)
|
|||
|
||||
/* _NEW_LINE */
|
||||
{
|
||||
uint32_t line_width_u3_7 = U_FIXED(CLAMP(ctx->Line.Width, 0.0, 7.99), 7);
|
||||
uint32_t line_width_u3_7 =
|
||||
U_FIXED(CLAMP(ctx->Line.Width, 0.0, ctx->Const.MaxLineWidth), 7);
|
||||
/* TODO: line width of 0 is not allowed when MSAA enabled */
|
||||
if (line_width_u3_7 == 0)
|
||||
line_width_u3_7 = 1;
|
||||
|
|
|
|||
|
|
@ -190,7 +190,8 @@ upload_sf_state(struct brw_context *brw)
|
|||
|
||||
/* _NEW_LINE */
|
||||
{
|
||||
uint32_t line_width_u3_7 = U_FIXED(CLAMP(ctx->Line.Width, 0.0, 7.99), 7);
|
||||
uint32_t line_width_u3_7 =
|
||||
U_FIXED(CLAMP(ctx->Line.Width, 0.0, ctx->Const.MaxLineWidth), 7);
|
||||
/* TODO: line width of 0 is not allowed when MSAA enabled */
|
||||
if (line_width_u3_7 == 0)
|
||||
line_width_u3_7 = 1;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,8 @@ upload_sf(struct brw_context *brw)
|
|||
dw1 |= GEN6_SF_VIEWPORT_TRANSFORM_ENABLE;
|
||||
|
||||
/* _NEW_LINE */
|
||||
uint32_t line_width_u3_7 = U_FIXED(CLAMP(ctx->Line.Width, 0.0, 7.99), 7);
|
||||
uint32_t line_width_u3_7 =
|
||||
U_FIXED(CLAMP(ctx->Line.Width, 0.0, ctx->Const.MaxLineWidth), 7);
|
||||
if (line_width_u3_7 == 0)
|
||||
line_width_u3_7 = 1;
|
||||
if (brw->gen >= 9 || brw->is_cherryview) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue