top | item 44333825

(no title)

arjonagelhout | 8 months ago

What is the main difference in shading languages vs. programming languages such as C++?

Metal Shading Language for example uses a subset of C++, and HLSL and GLSL are C-like languages.

In my view, it is nice to have an equivalent syntax and language for both CPU and GPU code, even though you still want to write simple code for GPU compute kernels and shaders.

discuss

order

pjmlp|8 months ago

The language extensions for GPU semantics and code distribution required in C and C++.

The difference is that shader languages have a specific set of semantics, while the former still have to worry about ISO standard semantics, coupled with the extensions and broken expectations when the code takes another execution semantics from what a regular C or C++ developer would expect.

hgs3|8 months ago

I would expect a shading language to provide specialized features for working with GPU resources and intrinsic operations.