ValhallaTeam / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Single pixel lines become wide with DX11 renderer #433

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the sample that is attachment 1 in issue #432 on a DX11-capable system 
using an ANGLE libGLESv2.dll compiled from the dx11proto branch with 
ANGLE_ENABLE_D3D11 set to 1.

What is the expected output? What do you see instead?
I expect to see a grid in the XZ plane with single pixel wide lines.

Instead the lines at z=5 and z=-5 appear to be double width. See the attached 
image.

The plane is the Y=0 plane. All the x-axis lines run from -10 to +10. The z 
coordinates of the lines are 10, 5 -5, -10.

What version of the product are you using? On what operating system?
dx11proto and Renderer11.cpp.

Original issue reported on code.google.com by callow.m...@artspark.co.jp on 7 Jun 2013 at 7:10

Attachments:

GoogleCodeExporter commented 9 years ago
A colleague just ran this sample on an NVIDIA GTX 550T (I'm running on an AMD 
Radeon HD6750M) and he is seeing the problem of the missing front-most line 
that I described in issue #432 rather than this problem. That is strange 
because DX11 does not need and ANGLE does not do the half-pixel adjustment that 
seemed to be the problem with D3D9.

When he uses D3D9, i.e. libGLESv2.dll compiled with ANGLE_ENABLE_D3D11 0, and 
including the fix I gave in issue #432, he sees the correct result.

Original comment by callow.m...@artspark.co.jp on 7 Jun 2013 at 8:08

GoogleCodeExporter commented 9 years ago
The fat lines are exactly 2 pixels wide. The application does not call 
glLineWidth.

Original comment by callow.m...@artspark.co.jp on 7 Jun 2013 at 8:38

GoogleCodeExporter commented 9 years ago
I can't reproduce the wide horizontal lines, but I do see that the diagonal 
lines have multiple pixels per row, which shouldn't be allowed. This only 
occurs with DX11 so it does seem to be a bug worth investigating. Thanks for 
reporting this and providing a test case!

Original comment by nico...@transgaming.com on 12 Jun 2013 at 3:43

GoogleCodeExporter commented 9 years ago
Did you try with an AMD/ATI GPU?

It happens every time with my Radeon HD6750M and only with DX11.

Original comment by callow.m...@artspark.co.jp on 13 Jun 2013 at 1:58

GoogleCodeExporter commented 9 years ago
If I perturb the z coordinate of the fat lines a z=+/-5 by around 0.06, they 
become one pixel wide. The fat lines therefore look to be an artefact of 
multi-sampling, though why any multi-sampling is happening, I have no idea.

You are right. The diagonal lines look awful.

Original comment by callow.m...@artspark.co.jp on 13 Jun 2013 at 6:59

GoogleCodeExporter commented 9 years ago
On reflection, this may have nothing to do with multisampling. Instead it may 
be a bug in the AMD D3D11 driver that is causing it to violate rule 3 of the 
line rasterization rules when the line position is near a fragment edge.

Original comment by callow.m...@artspark.co.jp on 13 Jun 2013 at 8:27

GoogleCodeExporter commented 9 years ago
I've found the culprit for the issue with the diagonal lines. We're currently 
always setting the MultisampleEnable rasterizer state to TRUE for DX11. This 
causes lines to be rendered as a 1-pixel wide rectangle, which will sometimes 
cover multiple pixel centers in a row, for y-major lines.

It doesn't explain why you're seeing two pixel wide horizontal lines though. 
I'm using an NVIDIA GeForce GTX 560 at the moment so it might indeed be an AMD 
driver bug.

Original comment by nico...@transgaming.com on 13 Jun 2013 at 3:00

GoogleCodeExporter commented 9 years ago
Fixed the diagonal line issue back in June. Please file a new bug if you're 
still having issues that can't be attributed to a difference in rounding 
performed by the GPU, or a driver bug.

Original comment by c...@chromium.org on 2 Dec 2013 at 6:54