Files
Jeremy Ong d928bccf5a Add preliminary HLSL support (#3932)
* Add preliminary HLSL support

- Adds a new language mode to monaco, extending the base C++ layer with
  HLSL intrinsics and types
- Adds a new `HLSLCompiler` class
- Adds a sample pixel shader

The compiler used to test this locally is the [DirectX Shader
Compiler](https://github.com/microsoft/DirectXShaderCompiler) (aka DXC),
which needs to also be added to the
[infra](https://github.com/compiler-explorer/infra) project.

Some guidance is needed before this PR can be merged:

1. While DXC can run on Linux, there are no binaries available so this
   compiler must be built. Are there examples that show how we should do
   this as part of the infra CI/CD? Should we build and host it
   separately instead? The build process for DXC on Linux is relatively
   straightforward and documented
   [here](https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DxcOnUnix.rst).
2. The example code doesn't compile unless the user also supplies
   additional compiler flags `-T ps_6_6 -E PSMain`. Is there a way to
   load these flags conditionally only if the sample is loaded?
3. Technically, DXC emits DXIL IR (based on LLVM IR) and I am wondering
   if it's possible to extend an existing LLVM backend. In addition, the
   `-spirv` compiler flag could be emitted to target the SPIR-V backend
   instead, so I'm curious if there is a good way to express the target
   backend.

Signed-off-by: Jeremy Ong <jeremycong@gmail.com>

* Fix copyright dates, remove unnecessary strict usage, and remove
placeholder logo

Signed-off-by: Jeremy Ong <jeremycong@gmail.com>

* Rebase and remove unneeded HLSL logo

Signed-off-by: Jeremy Ong <jeremycong@gmail.com>

* Fix lint errors

Signed-off-by: Jeremy Ong <jeremycong@gmail.com>

* Simply HLSL sample and remove default config

Signed-off-by: Jeremy Ong <jeremycong@gmail.com>
2022-08-09 07:32:19 -05:00
..