This repository contains a utility library with helper types and functions to provide similar syntax to HLSL, but inside the ISPC programming environment.
This library is used by several projects listed below:
smallpt | mandelbrot |
---|---|
flower | worley |
- Vectors: float2/3/4, int2/3/4, bool2/3/4
- Matrices: float2x2/3x3/4x4
- HLSL Intrinsics
- (Basic) Texture2D sampling & addressing modes
#include "hlsl.ispc" in your ISPC project files. You can also recompile all the projects via hlsl-to-ispc.sln.
Since HLSL & GPU programming shares similar SPMD concepts as ISPC, it makes sense that a library could provide similar behaviour.
This library is meant to provide good-enough HLSL-like functionality in ISPC. Achieving high performance with ISPC requires more than simple code conversion. This library shouldn't be seen as be-all and end-all solution, but rather as a first step. ISPC has its own specificities, and it is vital to check the programming guide to achieve performance.
More functionality to be added and overall behaviour to be improved.
- Additional work around ISPC-specifics
- Texture sampling emulation
- Unit testing of intrinsics
- Direct conversion of .HLSL files to .ISPC kernels (most likely a separate/parallel project)
- Support for GLSL intrinsics (maybe)