[Mesa-dev] [PATCH] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN7
On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832 Signed-off-by: Marius Predut marius.pre...@intel.com Signed-off-by: Marius Predut Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen7_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c b/src/mesa/drivers/dri/i965/gen7_sf_state.c index c9815b0..38b4f2f 100644 --- a/src/mesa/drivers/dri/i965/gen7_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c @@ -198,9 +198,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { + if (ctx-Line.SmoothFlag ctx-Line.Width = 1) +line_width_u3_7 = 0; + } else { + if (line_width_u3_7 == 0) + line_width_u3_7 = 1; + } + dw2 |= line_width_u3_7 GEN6_SF_LINE_WIDTH_SHIFT; } if (ctx-Line.SmoothFlag) { -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines.
-Original Message- From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia Mirkin Sent: Tuesday, March 17, 2015 6:48 PM To: Predut, Marius Cc: mesa-dev@lists.freedesktop.org Subject: Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines. Can you provide the output of git var -l marius@marius-pc:~/mesa/src$ git var -l user.email=Marius Predut marius.pre...@intel.com user.email=marius.pre...@intel.com user.name=Marius Predut color.ui=auto sendemail.smtpserver=smtp.intel.com sendemail.signedoffbycc=no sendemail.from=marius.pre...@intel.com sendemail.to=marius.pre...@intel.com sendemail.chainreplyto=false sendemail.review_mesa.email=Marius Predut marius.pre...@intel.com sendemail.review_mesa.name=Marius Predut sendemail.review_mesa.smtpserver=smtp.intel.com sendemail.review_mesa.signedoffbycc=no sendemail.review_mesa.to=mesa-dev@lists.freedesktop.org sendemail.review_mesa.chainreplyto=false core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* remote.origin.url=git://anongit.freedesktop.org/git/mesa/mesa branch.master.remote=origin branch.master.merge=refs/heads/master GIT_COMMITTER_IDENT=Marius Predut marius.pre...@intel.com 1426618655 +0200 GIT_AUTHOR_IDENT=Marius Predut marius.pre...@intel.com 1426618655 +0200 GIT_EDITOR=editor GIT_PAGER=pager And the headers of the patch file you're sending (or git show --format=raw for the commit in question if you're not using patch files as intermediates) From b84cf899ddf3b8b93b251ffcf9a082cbfe372f18 Mon Sep 17 00:00:00 2001 From: Marius Predut marius.pre...@intel.com Date: Tue, 17 Mar 2015 19:33:21 +0200 Subject: [Mesa-dev][PATCH v1] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On SNB and IVB hw, for 1 pixel line thickness or less, I suspect that GIT_AUTHOR_IDENT will differ from whatever's in the From: header of the patch being sent. I fix this trouble by using --from Marius Predut marius.pre...@intel.com And without space between name and the character (if not it will not work :-)) On Tue, Mar 17, 2015 at 12:36 PM, Predut, Marius marius.pre...@intel.com wrote: -Original Message- From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On Behalf Of Ilia Mirkin Sent: Wednesday, March 11, 2015 11:09 PM To: Predut, Marius Cc: mesa-dev@lists.freedesktop.org Subject: Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines. On Wed, Mar 11, 2015 at 5:57 PM, marius.pre...@intel.com wrote: From: Marius Predut marius.pre...@intel.com Set your email from name correctly in git and then you won't have this line in your git send-email results. I have this config : email = marius.pre...@intel.com name = Marius Predut but still the first line appear On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668 This seems like the wrong bug reference... Signed-off-by: Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index f9d8d27..1bed444 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -367,9 +367,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { +if (ctx-Line.SmoothFlag ctx-Line.Width =1) + line_width_u3_7 = 0; + } else { +if (line_width_u3_7 == 0) +line_width_u3_7 = 1; + } + dw3 |= line_width_u3_7 GEN6_SF_LINE_WIDTH_SHIFT; } if (ctx-Line.SmoothFlag) { -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http
[Mesa-dev] [PATCH] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN6
On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832 Signed-off-by: Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index f9d8d27..1bed444 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -367,9 +367,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { +if (ctx-Line.SmoothFlag ctx-Line.Width =1) + line_width_u3_7 = 0; + } else { +if (line_width_u3_7 == 0) +line_width_u3_7 = 1; + } + dw3 |= line_width_u3_7 GEN6_SF_LINE_WIDTH_SHIFT; } if (ctx-Line.SmoothFlag) { -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN6
On 03/17/2015 11:29 AM, Marius Predut wrote: On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. You'll need to re-word wrap the commit message. You'll get the commit message right one of these days. :) Also... when you send out new versions of a patch, please change the patch subject to be something like [PATCH v3] This makes it easier for people to know which is the latest version to review. You should also add notes to the commit message that explain what changed from version to version. For example, this commit message should have something like: v3: Fix = used instead of == in an if-statement. Noticed by Daniel Stone. This is helps people know that their review comments have been applied. It is also important to do this when the review changes are applied and the patch committed without re-sending to the list. Maintaining history like this in commit messages helps us understand code in the future. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832 There are a number of bugs that have been closed as duplicates of this bug. Two of these, bug #27007 and bug #60797, have test cases. Does this fix also fix those? I also have a more general question: How are you testing this? Daniel noticed a bug in an earlier version of the patch that piglit should have caught. If you're doing a full piglit run and that didn't catch the previous assignment-instead-of-comparison bug, it would be helpful if you could craft a test that would detect that bug. That may be difficult, so don't spend a huge amount of time on it. Signed-off-by: Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index f9d8d27..1bed444 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -367,9 +367,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { In Mesa there are often Enabled and _Enabled fields. The Enabled field is the setting made by the application via the OpenGL API. The _Enabled field means that feature in question is actually enabled, and this may depend on other state. In this case, the application may enable multisampling, but multisampling may not occur of there is not a multisample buffer. This means gl_multisample_attrib::Enabled would be set but gl_multisample_attrib::_Enabled would not. Instead of open-coding that check, just check gl_multisample_attrib::_Enabled directly: if (!ctx-Multisample._Enabled) { I actually think it's more clear if you leave the original comment and implement this as: /* Line width of 0 is not allowed when MSAA enabled */ if (ctx-Multisample._Enabled) { if (line_width_u3_7 == 0) line_width_u3_7 = 1; } else if (ctx-Line.SmoothFlag ctx-Line.Width = 1.0) { /* For lines less than 1 pixel thick, the general * anti-aliasing algorithm gives up, and a garbage line is * generated. Setting a Line Width of 0.0 specifies the * rasterization of the thinnest (one-pixel-wide), * non-antialiased lines. * * Lines rendered with zero Line Width are rasterized using * Grid Intersection Quantization rules as specified by * bspec section 6.3.12.1 Zero-Width (Cosmetic) Line * Rasterization. */ line_width_u3_7 = 0; } I reworded the comment a bit (from the commit message), and I changed the Line.Width comparison to compare with 1.0. One final question. Does it produce better results to use 0 or 1.0? It sounds like using 1.0 would still enable line antialiasing, and the resulting line shouldn't be appreciably thicker. +if (ctx-Line.SmoothFlag ctx-Line.Width =1) + line_width_u3_7 = 0; + } else { +if (line_width_u3_7 == 0) +line_width_u3_7 = 1; + } + dw3 |= line_width_u3_7 GEN6_SF_LINE_WIDTH_SHIFT; } if (ctx-Line.SmoothFlag) { ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org
Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines.
On Tue, Mar 17, 2015 at 2:11 PM, Predut, Marius marius.pre...@intel.com wrote: -Original Message- From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia Mirkin Sent: Tuesday, March 17, 2015 6:48 PM To: Predut, Marius Cc: mesa-dev@lists.freedesktop.org Subject: Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines. Can you provide the output of git var -l marius@marius-pc:~/mesa/src$ git var -l user.email=Marius Predut marius.pre...@intel.com user.email=marius.pre...@intel.com user.name=Marius Predut color.ui=auto sendemail.smtpserver=smtp.intel.com sendemail.signedoffbycc=no sendemail.from=marius.pre...@intel.com sendemail.to=marius.pre...@intel.com These are the problem. Remove the .from setting. It's overriding the defaults. Or set it to the correct thing, i.e. Marius Predut marius.pre...@intel.com I suspect that GIT_AUTHOR_IDENT will differ from whatever's in the From: header of the patch being sent. I fix this trouble by using --from Marius Predut marius.pre...@intel.com And without space between name and the character (if not it will not work :-)) That's not a great thing to do... just remove sendmail.from and it should all work. [And yeah, space between name and required by RFC822 as I recall... been a while since I've read over it though.] -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN6
-Original Message- From: Ian Romanick [mailto:i...@freedesktop.org] Sent: Tuesday, March 17, 2015 8:27 PM To: Predut, Marius; mesa-dev@lists.freedesktop.org Subject: Re: [Mesa-dev] [PATCH] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN6 On 03/17/2015 11:29 AM, Marius Predut wrote: On SNB and IVB hw, for 1 pixel line thickness or less, the general anti- aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. You'll need to re-word wrap the commit message. You'll get the commit message right one of these days. :) Yes right, also Brian Paul notice it. Also... when you send out new versions of a patch, please change the patch subject to be something like [PATCH v3] This makes it easier for people to know which is the latest version to review. You should also add notes to the commit message that explain what changed from version to version. For example, this commit message should have something like: v3: Fix = used instead of == in an if-statement. Noticed by Daniel Stone. This is helps people know that their review comments have been applied. It is also important to do this when the review changes are applied and the patch committed without re-sending to the list. Maintaining history like this in commit messages helps us understand code in the future. Yes indeed. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832 There are a number of bugs that have been closed as duplicates of this bug. Two of these, bug #27007 and bug #60797, have test cases. Does this fix also fix those? Yes , was fixed. Ok I try put all defects here. I also have a more general question: How are you testing this? Daniel noticed a bug in an earlier version of the patch that piglit should have caught. If you're doing a full piglit run and that didn't catch the previous assignment-instead-of-comparison bug, it would be helpful if you could craft a test that would detect that bug. That may be difficult, so don't spend a huge amount of time on it. I used the piglit test /bin/line-aa-width -auto Also I don’t observer pilgit test regressions when I run /piglit-run.py tests/quick.py. I used this https://bugs.freedesktop.org/attachment.cgi?id=33930 test case and checked visually. (an interrupted line rendered) I used this https://bugs.freedesktop.org/attachment.cgi?id=8675 test case and checked visually. ( a triangle for witch a line is missing) I don't know more about assignment-instead-of-comparison and Daniel noticed. Signed-off-by: Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index f9d8d27..1bed444 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -367,9 +367,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { In Mesa there are often Enabled and _Enabled fields. The Enabled field is the setting made by the application via the OpenGL API. The _Enabled field means that feature in question is actually enabled, and this may depend on other state. In this case, the application may enable multisampling, but multisampling may not occur of there is not a multisample buffer. This means gl_multisample_attrib::Enabled would be set but gl_multisample_attrib::_Enabled would not. Instead of open-coding that check, just check gl_multisample_attrib::_Enabled directly: if (!ctx-Multisample._Enabled) { I actually think it's more clear if you leave the original comment and implement this as: /* Line width of 0 is not allowed when MSAA enabled */ if (ctx-Multisample._Enabled) { if (line_width_u3_7 == 0) line_width_u3_7 = 1; } else if (ctx-Line.SmoothFlag ctx-Line.Width = 1.0) { /* For lines less than 1 pixel thick, the general * anti-aliasing algorithm gives up, and a garbage line is * generated. Setting a Line Width of 0.0 specifies the * rasterization of the thinnest (one-pixel-wide), * non-antialiased lines. * * Lines rendered with zero Line Width are rasterized
Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines.
-Original Message- From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On Behalf Of Matt Turner Sent: Thursday, March 12, 2015 12:02 AM To: Ilia Mirkin Cc: mesa-dev@lists.freedesktop.org Subject: Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines. On Wed, Mar 11, 2015 at 2:09 PM, Ilia Mirkin imir...@alum.mit.edu wrote: On Wed, Mar 11, 2015 at 5:57 PM, marius.pre...@intel.com wrote: From: Marius Predut marius.pre...@intel.com Set your email from name correctly in git and then you won't have this line in your git send-email results. On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668 This seems like the wrong bug reference... I'm pretty sure it should be https://bugs.freedesktop.org/show_bug.cgi?id=28832 yes it is. thanks Matt ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN7
From: Marius Predut marius.pre...@intel.com On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28832 Signed-off-by: Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen7_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c b/src/mesa/drivers/dri/i965/gen7_sf_state.c index c9815b0..fbad889 100644 --- a/src/mesa/drivers/dri/i965/gen7_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c @@ -198,9 +198,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { + if (ctx-Line.SmoothFlag ctx-Line.Width = 1 ) +line_width_u3_7 = 0; + } else { + if (line_width_u3_7 = 0) + line_width_u3_7 = 1; + } + dw2 |= line_width_u3_7 GEN6_SF_LINE_WIDTH_SHIFT; } if (ctx-Line.SmoothFlag) { -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines - GEN7
Hi, On 17 March 2015 at 16:37, marius.pre...@intel.com wrote: --- a/src/mesa/drivers/dri/i965/gen7_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c @@ -198,9 +198,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { + if (ctx-Line.SmoothFlag ctx-Line.Width = 1 ) +line_width_u3_7 = 0; + } else { + if (line_width_u3_7 = 0) + line_width_u3_7 = 1; You almost certainly meant 'if (line_width_u3 == 0)', rather than an assignment - surprised the compiler didn't throw a warning here. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines.
Can you provide the output of git var -l And the headers of the patch file you're sending (or git show --format=raw for the commit in question if you're not using patch files as intermediates) I suspect that GIT_AUTHOR_IDENT will differ from whatever's in the From: header of the patch being sent. On Tue, Mar 17, 2015 at 12:36 PM, Predut, Marius marius.pre...@intel.com wrote: -Original Message- From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On Behalf Of Ilia Mirkin Sent: Wednesday, March 11, 2015 11:09 PM To: Predut, Marius Cc: mesa-dev@lists.freedesktop.org Subject: Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines. On Wed, Mar 11, 2015 at 5:57 PM, marius.pre...@intel.com wrote: From: Marius Predut marius.pre...@intel.com Set your email from name correctly in git and then you won't have this line in your git send-email results. I have this config : email = marius.pre...@intel.com name = Marius Predut but still the first line appear On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668 This seems like the wrong bug reference... Signed-off-by: Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index f9d8d27..1bed444 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -367,9 +367,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { +if (ctx-Line.SmoothFlag ctx-Line.Width =1) + line_width_u3_7 = 0; + } else { +if (line_width_u3_7 == 0) +line_width_u3_7 = 1; + } + dw3 |= line_width_u3_7 GEN6_SF_LINE_WIDTH_SHIFT; } if (ctx-Line.SmoothFlag) { -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines.
-Original Message- From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On Behalf Of Ilia Mirkin Sent: Wednesday, March 11, 2015 11:09 PM To: Predut, Marius Cc: mesa-dev@lists.freedesktop.org Subject: Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines. On Wed, Mar 11, 2015 at 5:57 PM, marius.pre...@intel.com wrote: From: Marius Predut marius.pre...@intel.com Set your email from name correctly in git and then you won't have this line in your git send-email results. I have this config : email = marius.pre...@intel.com name = Marius Predut but still the first line appear On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668 This seems like the wrong bug reference... Signed-off-by: Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index f9d8d27..1bed444 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -367,9 +367,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { +if (ctx-Line.SmoothFlag ctx-Line.Width =1) + line_width_u3_7 = 0; + } else { +if (line_width_u3_7 == 0) +line_width_u3_7 = 1; + } + dw3 |= line_width_u3_7 GEN6_SF_LINE_WIDTH_SHIFT; } if (ctx-Line.SmoothFlag) { -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines.
On Wed, Mar 11, 2015 at 2:09 PM, Ilia Mirkin imir...@alum.mit.edu wrote: On Wed, Mar 11, 2015 at 5:57 PM, marius.pre...@intel.com wrote: From: Marius Predut marius.pre...@intel.com Set your email from name correctly in git and then you won't have this line in your git send-email results. On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668 This seems like the wrong bug reference... I'm pretty sure it should be https://bugs.freedesktop.org/show_bug.cgi?id=28832 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines.
From: Marius Predut marius.pre...@intel.com On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668 Signed-off-by: Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index f9d8d27..1bed444 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -367,9 +367,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { +if (ctx-Line.SmoothFlag ctx-Line.Width =1) + line_width_u3_7 = 0; + } else { +if (line_width_u3_7 == 0) +line_width_u3_7 = 1; + } + dw3 |= line_width_u3_7 GEN6_SF_LINE_WIDTH_SHIFT; } if (ctx-Line.SmoothFlag) { -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH ] i965/aa: fixing anti-aliasing bug for thinnest width lines.
On Wed, Mar 11, 2015 at 5:57 PM, marius.pre...@intel.com wrote: From: Marius Predut marius.pre...@intel.com Set your email from name correctly in git and then you won't have this line in your git send-email results. On SNB and IVB hw, for 1 pixel line thickness or less, the general anti-aliasing algorithm give up - garbage line is generated. Setting a Line Width of 0.0 specifies the rasterization of the “thinnest” (one-pixel-wide), non-antialiased lines. Lines rendered with zero Line Width are rasterized using Grid Intersection Quantization rules as specified by bspec section 6.3.12.1 Zero-Width (Cosmetic) Line Rasterization. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668 This seems like the wrong bug reference... Signed-off-by: Marius Predut marius.pre...@intel.com --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index f9d8d27..1bed444 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -367,9 +367,15 @@ upload_sf_state(struct brw_context *brw) float line_width = roundf(CLAMP(ctx-Line.Width, 0.0, ctx-Const.MaxLineWidth)); uint32_t line_width_u3_7 = U_FIXED(line_width, 7); - /* TODO: line width of 0 is not allowed when MSAA enabled */ - if (line_width_u3_7 == 0) - line_width_u3_7 = 1; + + if (!(multisampled_fbo ctx-Multisample.Enabled)) { +if (ctx-Line.SmoothFlag ctx-Line.Width =1) + line_width_u3_7 = 0; + } else { +if (line_width_u3_7 == 0) +line_width_u3_7 = 1; + } + dw3 |= line_width_u3_7 GEN6_SF_LINE_WIDTH_SHIFT; } if (ctx-Line.SmoothFlag) { -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev