2

From what I've been able to get, both vertex and pixel shader operations boil down to passing data and doing a lot of the same with it for every available unit. Surely, vertex and pixel shaders are in different parts of the classical graphical pipeline, but wouldn't it be better to have more abstraction and just be able to create arbitrary order of arbitrary data and parallel operations with it? I guess such an abstraction can also be applied to emulate OpenCL, compute shaders and whatever general or specialized compute API.

tshepang
  • 12,111
  • 21
  • 91
  • 136

2 Answers2

0

Specialization helps drivers perform optimally and simplifies application code. Pixel-shaders occur after rasterization. It's great to not have to worry about rasterizing. You could use CUDA or OpenCL to do anything you like in a completely graphics agnostic way. Alt. Yes. It's coming.

axon
  • 1,190
  • 6
  • 16
0

Historically the distinction was necessary because vertex and pixel shaders were physically implemented in different hardware units with different capabilities. Nowadays pretty much all PC GPUs and even many mobile GPUs have unified shader architectures where vertex and pixel shaders execute on the same hardware compute units so the distinction is less necessary. It is still useful in the context of a graphics pipeline however since the inputs and outputs and their meanings are determined by the logical position of the vertex and pixel shaders in the rendering pipeline.

For GPGPU type problems where the traditional graphics pipeline is not meaningful / relevant you have compute shaders that expose the full capabilities of the underlying hardware outside of the traditional vertex / pixel shader model. Compute shaders in a sense are the abstraction you're talking about so it doesn't really make sense to talk about 'emulating' them with such an abstraction. Compute shaders are just a way to expose the physical hardware compute units used by vertex and pixel shaders for use outside of the traditional graphics pipeline.

mattnewport
  • 13,728
  • 2
  • 35
  • 39
  • The emulation is intended to provide "compute"-like shaders on top of vertex/fragment shaders, since most of the GPUs in circulation actually don't support compute shaders. –  Oct 19 '13 at 22:07
  • Depending on your target market that may or may not be true. According to the latest Steam hardware survey http://store.steampowered.com/hwsurvey/ for example 63% of systems have DX11 cards / Windows 7. If you're targeting mobile the story is obviously rather different. – mattnewport Oct 19 '13 at 22:15
  • It's also worth noting that GPGPU originated with people (ab)using vertex and pixel shaders to perform non-graphics computations. You can still do that with hardware that doesn't support compute shaders. Compute shaders provide additional functionality beyond what the older hardware was capable of however. Hardware that doesn't support compute shaders generally doesn't support them because it is missing required functionality so you can't emulate that missing functionality through vertex or pixel shaders without sacrificing significant performance. – mattnewport Oct 19 '13 at 22:18