KhronosGroup / KhronosGroup/glslang

Complete HLSL -> SPIR-V translator

Open
#362 49 comments 3 reactions 0 assignees View on GitHub
HLSL Missing Functionality
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

Requested HLSL features. If it's checked, it's been implemented and working for some workload. If a checked feature is not working correctly, there should be an issue reporting the incorrect behavior. A missing feature should be requested here.

- [x] geometry, domain, and hull shaders
- [x] member methods inside a structure, see issue #535
- [x] full pass through of attributes on loops/if/switch, e.g., [unroll], [flatten], etc., see issue #836
- [x] Map`half` to `float`. See issue #492.
- [x] namespace (about half done)
- conversions
- [x] structure cast of scalar: `PS_OUTPUT __output__ = (PS_OUTPUT)(scalar)`
- [ ] inout arguments needing bidirectional conversion
- [x] smearing implicit-conversion
- [x] vector truncation conversion
- [x] vector of size 1 vs. scalar
- [x] Basic RWBuffer support
- [x] deference of textures
- [x] arbitrary (structure) texture return-type, see issue #569.
- [x] sub-vec4 return types from sampling
- compute shaders
- [x] numthreads
- [x] SV_DispatchThreadID -> gl_GlobalInvocationID
- [x] groupshared -> shared
- HLSL-specific preprocessing
- [ ] trailing () parens are required/prohibited with an empty argument list in #defines
- [x] #include support
- [x] -D and -U for macros on command line
- [x] **class** keyword, member functions, variables, static and non static
- [ ] **class** inheritance from **interface** see https://msdn.microsoft.com/en-us/library/windows/desktop/ff471421(v=vs.85).aspx
- [x] Multi-dimensional arrays, ala float myfloat[4][5];
- [x] minN types, ala https://msdn.microsoft.com/en-us/library/windows/desktop/bb509646(v=vs.85).aspx.
- [x] vertical path hookup through to SPIR-V generation
- [x] generic preprocessor (same as GLSL)
- [x] scanner (keywords, identifiers, etc.)
- [x] basic types: all int/uint/float/double scalar/vector/matrix
- [x] basic recursive-decent language grammar: declarations, expressions, statements, loops, if-else, functions
- [x] parsing of semantics, annotations, registers, etc. on declarations
- [x] parsing of attributes on loops/if/switch, e.g., [unroll], [flatten], etc.
- [x] basic symbol-table scoping
- [x] switch statements, { } initializers, typedef
- [x] templatized vector/matrix/etc. declaration grammar
- [x] base set of all intrinsics mappable to existing operators
- [x] HLSL-specific intrinsics, mapped to new operators
- [x] vec1/mat1xN/matNx1-based, etc.
- [x] DX10 style sampler declarations
- [ ] immediate (literal) samplers
- [ ] DX9 style sampler declarations
- [x] 2DMS and Buffer texture support
- [x] method-based image/texture lookup
- [x] cbuffer/tbuffer
- [x] register and packoffset for buffers
- [x] in/out/inout qualifiers, e.g, void MyFunc(out float x)
- [x] default parameters, e.g, void MyFunc(float x=3)
- [x] overloaded function signature selection under implicit type conversion
- DX12 and beyond
- [x] syntax: ConstantBuffer
- [x] Wave Query,Wave Vote,Wave Broadcast,Wave Reduction,Wave Scan and Prefix,Quad-wide Shuffle operations,etc..
- [x] 64-bit types.
- [x] printf

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the unchecked HLSL features in this issue, especially bidirectional conversion, trailing parentheses in #defines, interface inheritance, immediate samplers, and DX9-style sampler declarations. Follow the referenced issues and documentation where provided, then identify the relevant translator area and existing workload coverage. Done means implementing one selected feature and demonstrating that the corresponding HLSL workload translates correctly to SPIR-V.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.