Hi guys,
me again. I remember vaguely seeing some #define stuff in some HLSL files, but I can’t seem to find good results on Google. How can I determine what Shader Model the user’s computer supports? (Specifically - does he support SM5)?
Tom
April 23, 2016, 8:14pm
2
You can kinda go off the GraphicsDevice.GraphicsProfile
which returns HiDef
for anything that supports SM 4.0 and above. There isn’t however anything specific for SM5 testing.
We’ve had a long standing issue to resolve this, but no work has been done:
opened 01:31AM - 15 Aug 13 UTC
OpenGL
DirectX
Design
We need to decide how to expand the existing `GraphicsProfile` system beyond the… old Reach/HiDef options from XNA 4.
We have a few options:
- Go back to cap bits.
- Expand `GraphicsProfile` with more profiles.
- Add a new `FeatureLevel` enum similar to DirectX feature levels.
Cap bits enable "full flexibility" but it puts the burden all on the end user to figure out what combinations of bits are common. I don't think anyone wants to go to cap bits... even if they say they do. This is what sucked about DX9 and what IMO still sucks about OpenGL.
I could see expanding the existing `GraphicsProfile` to support more profiles:
```
public enum GraphicsProfile
{
XboxOne,
PlayStation4,
HiDef,
MidDef,
LowDef,
Reach,
Limited
}
```
Some special platform specific profiles could be nice, but maybe sticking to more generic profiles is better?
The final option here is just mimicking the feature level concept from DirectX. This is sort of what `GraphicsProfile` does albeit with only two levels. Having it as a new separate enum just gives us some flexibility to break with the old system.
With either feature levels or profiles we will still need to look at all the different platforms MonoGame targets and all the hardware variations and make some calls as to how to decide how to categorize any particular hardware device. We then need to clearly document these rules for developers.
1 Like
Alkher
April 24, 2016, 9:40am
3
You could also use some c++ to query directx and returns the graphics card’s specs. And call this dll from c#. (exactly what i currently do)
Well, if the program crashes, I can tell you that the graphics card doesn’t support shader model 1-2… X_x