These were written against the shaders at revision
|
||
|---|---|---|
| .. | ||
| base | ||
| bloom | ||
| computecloth | ||
| computecullandlod | ||
| computeheadless | ||
| computenbody | ||
| computeparticles | ||
| computeraytracing | ||
| computeshader | ||
| conditionalrender | ||
| conservativeraster | ||
| debugmarker | ||
| deferred | ||
| deferredmultisampling | ||
| deferredshadows | ||
| descriptorsets | ||
| displacement | ||
| distancefieldfonts | ||
| dynamicuniformbuffer | ||
| gears | ||
| geometryshader | ||
| hdr | ||
| imgui | ||
| indirectdraw | ||
| inlineuniformblocks | ||
| inputattachments | ||
| instancing | ||
| mesh | ||
| multithreading | ||
| multiview | ||
| negativeviewportheight | ||
| nv_ray_tracing_basic | ||
| nv_ray_tracing_reflections | ||
| nv_ray_tracing_shadows | ||
| occlusionquery | ||
| offscreen | ||
| parallaxmapping | ||
| particlefire | ||
| pbrbasic | ||
| pbribl | ||
| pbrtexture | ||
| pipelines | ||
| pipelinestatistics | ||
| pushconstants | ||
| pushdescriptors | ||
| radialblur | ||
| renderheadless | ||
| scenerendering | ||
| screenshot | ||
| shadowmapomni | ||
| shadowmapping | ||
| shadowmappingcascade | ||
| skeletalanimation | ||
| specializationconstants | ||
| sphericalenvmapping | ||
| ssao | ||
| stencilbuffer | ||
| subpasses | ||
| terraintessellation | ||
| tessellation | ||
| textoverlay | ||
| texture | ||
| texture3d | ||
| texturearray | ||
| texturecubemap | ||
| texturemipmapgen | ||
| texturesparseresidency | ||
| triangle | ||
| viewportarray | ||
| vulkanscene | ||
| compile.py | ||
| README.md | ||
HLSL Shaders
This directory contains a fork of the shaders found in data/shaders, re-written in HLSL.
These can be compiled with DXC using the compile.py script.
Status
Tested on Ubuntu 18.04 + GeForce RTX 2080 Ti
Shaders written to mirror the GLSL versions at eddd724. There have been changes made to the GLSL shaders since then, which will need to be updated.
| Name | GLSL @eddd724e7 |
HLSL @eddd724e7 |
GLSL @10a1ecaf7 |
HLSL @eddd724e7 |
|---|---|---|---|---|
| bloom | ☑ | ☑ | ☑ | ☑ |
| computecloth | ☑ | ☑ | ☑ | ☑ |
| computecullandlod | ☑ | ☑ | ☑ | ☑ |
| computeheadless | ☑ | ☑ | ☑ | ☑ |
| computenbody | ☑ | ☑ | ☑ | ☑ |
| computeparticles | ☑ | ❌ | ☑ | ❌ |
| computeraytracing | ☑ | ☑ | ☑ | ☑ |
| computeshader | ☑ | ☑ | ☑ | ☑ |
| conditionalrender | ☑ | ☑ | ☑ | ☑ |
| conservativeraster | ☑ | ☑ | ☑ | ☑ |
| debugmarker | ☑ | ☑ | ☑ | ☑ |
| deferred | ☑ | ☑ | ☑ | ☑ |
| deferredmultisampling | ☑ | ☑ | ☑ | ☑ |
| deferredshadows | ☑ | ☑ | ☑ | ☑ |
| descriptorsets | ☑ | ☑ | ☑ | ☑ |
| displacement | ☑ | ☑ | ☑ | ☑ |
| distancefieldfonts | ☑ | ☑ | ☑ | ☑ |
| dynamicuniformbuffer | ☑ | ☑ | ☑ | ☑ |
| gears | ☑ | ☑ | ☑ | ☑ |
| geometryshader | ☑ | ☑ | ☑ | ☑ |
| gltfscene | - | - | ☑ | ❌ |
| hdr | ☑ | ❌ | ☑ | ❌ |
| imgui | ☑ | ☑ | ☑ | ☑ |
| indirectdraw | ☑ | ☑ | ☑ | ☑ |
| inlineuniformblocks | ☑ | ☑ | ☑ | ☑ |
| inputattachments | ☑ | ☑ | ☑ | ☑ |
| instancing | ☑ | ☑ | ☑ | ☑ |
| mesh | ☑ | ☑ | ❌ | ☑ |
| multisampling | ☑ | ☑ | ☑ | ❌ |
| multithreading | ☑ | ☑ | ☑ | ☑ |
| multiview | ☑ | ☑ | ☑ | ☑ |
| negativeviewportheight | ☑ | ☑ | ☑ | ☑ |
| nv_ray_tracing_basic | ☑ | ☑ | ☑ | ☑ |
| nv_ray_tracing_reflections | ☑ | ☑ | ☑ | ☑ |
| nv_ray_tracing_shadows | ☑ | ☑ | ☑ | ☑ |
| occlusionquery | ☑ | ☑ | ☑ | ☑ |
| offscreen | ☑ | ☑ | ☑ | ❌ |
| parallaxmapping | ☑ | ☑ | ☑ | ☑ |
| particlefire | ☑ | ☑ | ☑ | ☑ |
| pbrbasic | ☑ | ☑ | ☑ | ☑ |
| pbribl | ☑ | ☑ | ☑ | ☑ |
| pbrtexture | ☑ | ☑ | ☑ | ☑ |
| pipelines | ☑ | ☑ | ☑ | ☑ |
| pipelinestatistics | ☑ | ☑ | ☑ | ☑ |
| pushconstants | ☑ | ☑ | ☑ | ☑ |
| pushdescriptors | ☑ | ☑ | ☑ | ☑ |
| radialblur | ☑ | ☑ | ☑ | ☑ |
| renderheadless | ☑ | ☑ | ☑ | ☑ |
| scenerendering | ☑ | ☑ | ☑ | ☑ |
| screenshot | ☑ | ☑ | ☑ | ☑ |
| shadowmapping | ☑ | ☑ | ☑ | ☑ |
| shadowmappingcascade | ☑ | ☑ | ☑ | ☑ |
| shadowmappingomni | ☑ | ☑ | ☑ | ☑ |
| skeletalanimation | ☑ | ☑ | ☑ | ❌ |
| specializationconstants | ☑ | ☑ | ☑ | ☑ |
| sphericalenvmapping | ☑ | ☑ | ☑ | ☑ |
| ssao | ☑ | ☑ | ☑ | ☑ |
| stencilbuffer | ☑ | ☑ | ☑ | ☑ |
| subpasses | ☑ | ☑ | ☑ | ☑ |
| terraintessellation | ☑ | ☑ | ☑ | ☑ |
| tessellation | ☑ | ☑ | ☑ | ☑ |
| textoverlay | ☑ | ☑ | ☑ | ☑ |
| texture | ☑ | ☑ | ☑ | ☑ |
| texture3d | ☑ | ☑ | ☑ | ☑ |
| texturearray | ☑ | ☑ | ☑ | ☑ |
| texturecubemap | ☑ | ❌ | ☑ | ❌ |
| texturemipmapgen | ☑ | ☑ | ☑ | ☑ |
| texturesparseresidency | ☑ | ☑ | ☑ | ☑ |
| triangle | ☑ | ☑ | ☑ | ☑ |
| viewportarray | ☑ | ☑ | ☑ | ☑ |
| vulkanscene | ☑ | ☑ | ☑ | ☑ |
Known issues
- specialization constants can't be used to specify array size.
gl_PointCoordnot supported. HLSL has no equivalent. We changed the shaders to calulate the PointCoord manually in the shader. (computenbody,computeparticles,particlefireexamples).- HLSL doesn't have inverse operation (
deferred,hdr,instancing,skeletalanimation&texturecubemapexamples). modfcauses compilation to fail without errors or warnings. (modfnot used by any examples, easily confused with fmod)- In
specializationconstantsexample, shader compilation fails with error:
When multiple constant ids are defined and have different types. We work around this problem by making all constant ids the same type, then use--- Error msg: fatal error: failed to optimize SPIR-V: Id 10 is defined more than onceasfloat,asintorasuintto get the original value in the shader. gl_RayTmaxNVnot supported. (nv_ray_tracing_*examples)- HLSL interface for sparse residency textures is different from GLSL interface. After translating from HLSL to GLSL the shaders behave slightly different. Most important parts do behave identically though.