veldrid / veldrid

A low-level, portable graphics library for .NET.
https://veldrid.dev/
MIT License
2.44k stars 266 forks source link

Openvr Sample app fails #207

Open gleblebedev opened 4 years ago

gleblebedev commented 4 years ago

When running a vr demo with Vive headset the demo fails on creation of a colour target with invalid argument error code.

mellinoe commented 4 years ago

Can you give some more information?

gleblebedev commented 4 years ago

What graphics backend - DX11. I'll try to collect the rest tomorrow.

gleblebedev commented 4 years ago

So the problem is in https://github.com/mellinoe/veldrid/blob/master/src/Veldrid/D3D11/D3D11Util.cs line 53 srvDesc.Dimension = SharpDX.Direct3D.ShaderResourceViewDimension.Texture2D;

This should check for tex.SampleCount and if it's not a TextureSampleCount.Count1 it should use SharpDX.Direct3D.ShaderResourceViewDimension.Texture2DMultisampled