Skip to content

zigguratvertigo/hlsl-to-ispc

Repository files navigation

HLSL-to-ISPC Utility Library

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

Supported

  • Vectors: float2/3/4, int2/3/4, bool2/3/4
  • Matrices: float2x2/3x3/4x4
  • HLSL Intrinsics
  • (Basic) Texture2D sampling & addressing modes

Usage

#include "hlsl.ispc" in your ISPC project files. You can also recompile all the projects via hlsl-to-ispc.sln.

HLSL vs ISPC?

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.

Upcoming Features

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)

About

HLSL-to-ISPC Utility Library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published