Geometry Shader in Dx11 does not behave as expected.

Hi,

I’m hoping that some of you might be able to help out test a small project that does not behave correctly in Dx11. I’ve reported it as a bug to Unity, but they have been unable to reproduce. I’ve since updated my drivers and still the issue persists.

The project is very simple, it renders a unity cube with a geometry shader. The geometry shader takes triangles as input and outputs the edges as lines, essentially then the desired appearance would be that of a wireframe. Though this is just a stripped down version of a more complex shader to illustrate the issue, I’m not looking for a solution to display a wireframe.

Unfortunately in all the versions of Unity i’ve tested ( 5.2.2.f1, 5.3.2f1 and 5.4.0b14) the cube usually renders as solid white. However whilst viewing the scene in the scene window it tends to oscillate between a solid cube and a wireframe, this can sometime happen in the game view too, but its usually easier to see in the scene view, especially if you move the camera around. Indeed almost every time I start up the project and load the test scene I see the cube as a wireframe in the game window, but as soon as I press play it reverts back to solid or oscillating between the two states.

Stranger still is if you switch to using openGLCore the cube renders correctly as a wireframe constantly, so its only an issue running in dx11.

I’ve attached the project to this post. If anyone has 5 minutes to grab, test and reply here it i’d be very grateful. When replying please state your gpu, driver version and whether you can see the issue.

For reference my system is using an nvidia GTX970 and i’ve tried with both 361.43 and 364.72 drivers.

The project was last built in Unity 5.4.0b14, however it can be opened in Unity 5.2.2f1 with no issues, so I don’t think you need a beta version to test with. Of course being a Dx11 issue it goes without saying its only worth testing on Window systems.

Thanks.

2613020–183263–Bug - Dx11 Geometry Shader (u5.4.0b14).zip (99.8 KB)

Unity 5.3.4p5

------------------
System Information
------------------
         Operating System: Windows 10 Home 64-bit (10.0, Build 10586) (10586.th2_release_sec.160328-1908)
          DirectX Version: 12
Microsoft Graphics Hybrid: Not Supported
           DxDiag Version: 10.00.10586.0000 64bit Unicode


---------------
Display Devices
---------------
          Card name: NVIDIA GeForce GTX 650 Ti
       Manufacturer: NVIDIA
          Chip type: GeForce GTX 650 Ti
           DAC type: Integrated RAMDAC
     Display Memory: 6085 MB
   Dedicated Memory: 1989 MB
      Shared Memory: 4095 MB
       Current Mode: 1920 x 1080 (32 bit) (60Hz)
        Driver Name: nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um,nvwgf2um
Driver File Version: 10.18.0013.6472 (English)
     Driver Version: 10.18.13.6472
        DDI Version: 12
     Feature Levels: 11.0,10.1,10.0,9.3,9.2,9.1
       Driver Model: WDDM 2.0

2613309--183291--screenshot.png

Here is the log that is printed to the Console window:

graphicsDeviceVersion: Direct3D 11.0 [level 11.0]
graphicsDeviceID: 4550
graphicsDeviceName: NVIDIA GeForce GTX 650 Ti
graphicsDeviceType: Direct3D11
graphicsDeviceVendor: NVIDIA
graphicsDeviceVendorID: 4318
graphicsDeviceVersion: Direct3D 11.0 [level 11.0]
graphicsMemorySize: 1989
graphicsMultiThreaded: True
graphicsShaderLevel: 50

operatingSystem: Windows 10  (10.0.0) 64bit
supportsComputeShaders: True
supportsImageEffects: True
supportsInstancing: True
deviceModel: P5K/EPU (System manufacturer)
1 Like

Thanks Peter for taking the time to test this.
I assume by your lack of comments and the supplied picture that the cube remained as a wireframe for you constantly?

Yes it did remain as a wireframe constantly, no flicker or anything spotted.

On initial opening in Unity 5.3.4p3 it shows a wireframe, when playing it quickly switches to a solid cube.
Sometimes when stopping, it turns into a wireframe again, but usually it stays solid.

graphicsDeviceVersion: Direct3D 11.0 [level 11.0]
graphicsDeviceID: 5080
graphicsDeviceName: NVIDIA GeForce GTX 970M
graphicsDeviceType: Direct3D11
graphicsDeviceVendor: NVIDIA
graphicsDeviceVendorID: 4318
graphicsDeviceVersion: Direct3D 11.0 [level 11.0]
graphicsMemorySize: 6050
graphicsMultiThreaded: True
graphicsShaderLevel: 50

operatingSystem: Windows 10 (10.0.0) 64bit
supportsComputeShaders: True
supportsImageEffects: True
supportsInstancing: True
deviceModel: Intel(R) Core™ i7-6700HQ CPU @ 2.60GHz (16205 MB)

1 Like

Oeps, I actually meant 5.3.4p3