|
DWARF Standard
|
210514.1 |
Stuart Brady |
Add GPU shading and kernel languages |
Enhancement |
Incomplete |
Michael Eager |
Section 7.12, pg 231
Please add the following GPU shading and kernel language names:
DW_LANG_GLSL | OpenGL Shading Language
DW_LANG_GLSL_ES | OpenGL ES Shading Language
DW_LANG_HLSL | High-Level Shading Language
DW_LANG_OpenCL_CPP | OpenCL C++
DW_LANG_CPP_for_OpenCL | C++ for OpenCL
DW_LANG_SYCL | SYCL
Minor side-request
------------------
DW_LANG_OpenCL is unfortunately a misnomer. The correct name would have
been DW_LANG_OpenCL_C, as OpenCL refers to the host API and C-based kernel
language collectively, rather than the kernel language alone, which would
be more properly referred to as "OpenCL C".
It would be incorrect to use DW_LANG_OpenCL to refer to C++ for OpenCL
code, regardless of whether the OpenCL host API is used. Also, OpenCL C
can be used with other host APIs, e.g. a subset of the language can be
used with the Vulkan API.
If possible, it would therefore be desirable to rename DW_LANG_OpenCL to
DW_LANG_OpenCL_C, and to add DW_LANG_OpenCL as a (possibly deprecated)
alias for compatibility purposes, to avoid potential confusion.
Exposition and rationale
------------------------
Note that "C++ for OpenCL" and "OpenCL C++" are distinct languages.
Although the latter is deprecated in OpenCL 3.0, its language ID within
the SPIR-V specification can still occur in the SPIR-V representation of
DWARF information provided by SPIR-V's "NonSemantic.Shader.DebugInfo.100"
and "OpenCL.DebugInfo.100" specifications, and so requires a corresponding
DWARF language ID.
GLSL ES is often known as ESSL (and is referred to as ESSL within the
SPIR-V specification). However, the name "GLSL ES" may be more meaningful
to those not deeply familiar with these languages.
GLSL ES could be considered to be its own set of GLSL language versions,
but it seems beneficial to treat GLSL and GLSL ES as separate languages,
given that they have separate version histories.
This request does not list specific versions of each of the shading and
kernel languages, partly on the basis that 210419.1 (or a refinement of
that proposal) may be accepted. There are a great many versions of GLSL,
in particular, and so adding separate language IDs for each language
version does not seem practical. However, it would be desirable if a
source language could be specified as being one of the shading or kernel
languages without implicitly specifying a specific default version.