Shader Model 6 or Extensions provided by manufacturers?

Started by
6 comments, last by SoldierOfLight 5 years, 10 months ago

Recently I read that the APIs are faking some behaviors, giving to the user false impressions.
I assume Shader Model 6 issues the wave instructions to the hardware for real, not faking them.

Is Shader Model 6, mature enough? Can I expect the same level of optimization form Model 6 as from Model 5? Should I expect more bugs from 6 than 5?
Would the extensions of the manufacturer provide better overall code than the Model 6, because, let say, they know their own hardware better?

What would you prefer to use for your project- Shader Model 6 or GCN Shader Extensions for DirectX?

Which of them is easier to set up and use in Visual Studio(practically)?

Advertisement

What exactly do you mean by "faking" behaviors?

SM6.0 is tied to DXIL and the new shader compiler (DXC), so the ecosystem isn't nearly as mature as it was for DBC and FXC. But it's been worked on steadily for the past few years, and I've gotten both my home and work codebase running on it. However I've definitely hit some bugs that only on the DXIL path, so it's very possible that you will as well. Fortunately with the new compiler it's very easy to open an issue on GitHub if you need help with something.

As for the wave-level operations in Shader Model 6.0, they're totally optional. The driver has to report that it supports the operations and also for the wave width in D3D12_FEATURE_DATA_D3D12_OPTIONS1, so there's no reason for the driver to say that it supports them if it can't actually do a wave-level operation. Either way Intel, AMD, and Nvidia hardware all work with SIMD units at a low-level, and they certainly support cross-lane operations on those SIMD units.

I have no reason to think that the vendor extensions would work any better than the wave-level intrinsics in SM6.0. Vendor extensions can expose things that are unique to that hardware, but in the case of the wave-level ops the HLSL intrinsics are pretty much identical to the what's in AMD and Nvidia's extensions. Going forward DXIL and SM6.0 are going to be the official path used by games and apps, so there's no reason to think that the IHV's won't put the bulk of their effort into making sure that path is optimal.

Either way the shader "extensions" provided by Nvidia and AMD are a giant PITA to use, since they require binding a dummy UAV and performing operations on it. If you accidentally do that on hardware that doesn't support those "extensions" you could get weird results, and it's also going to mess up the debug validation layer and debugging tools like PIX and RenderDoc. We don't use them in our codebase for these reasons, and I don't plan on starting.

2 hours ago, MJP said:

What exactly do you mean by "faking" behaviors?

Like the append buffers that suggest some special privileges, but only for DX11. Anyway I don't want to get back there. This is from my previous topic.

Those sentences, somehow triggered my doubts:

From https://github.com/GPUOpen-LibrariesAndSDKs/RadeonProRender-Baikal
"Baikal maintains high level of performance across all vendors, but it is specifically optimized for AMD® GPUs and APUs."

From https://github.com/GPUOpen-LibrariesAndSDKs/Barycentrics12/
"While the shader extension sample will run on non-AMD hardware, it will be of limited usefulness, since the purpose of the sample is to demonstrate AMD-specific shader extensions."

I am going to try to run that demo now, and see how they use the dummy UAV.

2 hours ago, NikiTo said:

Like the append buffers that suggest some special privileges, but only for DX11.

Everything in D3D/GL is a high level abstraction, that each GPU vendor can map to HW in their own way. AMD has special HW for append buffer counters in D3D11 and D3D12, while NV uses general purpose HW to implement them. NV uses special HW to accelerate the Input Layout / Input Assembler, while AMD uses general purpose HW to implement it. Neither of those features are "fake". 

2 hours ago, NikiTo said:

Baikal maintains high level of performance across all vendors, but it is specifically optimized for AMD® GPUs and APUs."

This could mean two things

- they use a normal set of shaders plus another set based on AMD extensions. 

- they did all their shader optimisation work while using AMD GPUs and AMD's profiling tools. 

2 hours ago, NikiTo said:

While the shader extension sample will run on non-AMD hardware, it will be of limited usefulness, since the purpose of the sample is to demonstrate AMD-specific shader extensions."

This means that the whole point of this demo is to show off an AMD-specific extension. The demo will run, but tell you that the extension is not available (and thus not 'work'). 

I see Shader Model 6 may need Experimental Mode. What does it mean? Will it execute my shaders in some kind of restricted mode?

Also, forgot to address the actual question in my last post... :)

SM5 plus vendor extensions is the only way to use these new features in D3D11. 

In D3D12, you have the choice of the ugly/complex vendor extensions (and up to 4 versions of shaders that use them - 1 for each vendor plus one for the case where no extensions are supported!) or using SM6 (and hopefully more like 2 versions of your complex shaders - using wave optimisations and not). 

SM6 is still new. I haven't used it yet because I haven't had time to experiment, but I assume it is the future of D3D shader programming, so anything not shipping today should probably look into it. 

13 minutes ago, NikiTo said:

I see Shader Model 6 may need Experimental Mode. What does it mean? Will it execute my shaders in some kind of restricted mode?

Some drivers are mature enough to claim support for SM6 for all applications, but other drivers are only mature enough for developers to test SM6 on them. For these less mature drivers, the app needs to explicitly opt in to experimental mode, and must be running on a machine with Developer Mode enabled. If you query for SM6 support, the answer you get may change based on whether or not you've enabled experimental SM6 support.

This topic is closed to new replies.

Advertisement