Devsh-Graphics-Programming / Nabla

Vulkan, OptiX and CUDA Interoperation Modular Rendering Library and Framework for PC/Linux/Android
http://devsh.eu
Apache License 2.0
460 stars 58 forks source link

First draft of Blit GLSL to HLSL migration. #556

Closed theoreticalphysicsftw closed 10 months ago

theoreticalphysicsftw commented 1 year ago

First draft of the CComputeBlit port from GLSL to HLSL.

Description

This commit implicitly assumes both https://github.com/Devsh-Graphics-Programming/Nabla/pull/546 and https://github.com/Devsh-Graphics-Programming/Nabla/pull/519 have been finalized. Furthermore it assumes -enable-16bit-types is passed to DXC in nbl/asset/utils/CHLSLCompiler.cpp so that those PRs can compile successfully. It also has few other assumptions about how the final versions of these PRs are going to look like which are commented in the code itself.

Testing

This was tested on a working branch with both of those PRs merged + few extra edits to get some of the not yet implemented functionality. Since nbl/builtin/hlsl/workgroup/* seems to have compilation issues and the normalization stage of CComputeBlit requires inclusive_scan I need to first get this working before figuring out the issues with that code.

On the other hand the main blit shader causes DXC to ICE. I will need some more time to figure out why.

TODO list:

I have to figure out why the ICE happens, then compile/debug and make sure that the FilterTest example works when the UseGLSL template parameter of CComputeBlit is set to false.

devshgraphicsprogrammingjenkins commented 1 year ago

[CI]: Can one of the admins verify this patch?

devshgraphicsprogramming commented 1 year ago

Good first try

devshgraphicsprogramming commented 1 year ago

Furthermore it assumes -enable-16bit-types is passed to DXC in nbl/asset/utils/CHLSLCompiler.cpp so that those PRs can compile successfully.

We'll try to get microsoft/DirectXShaderCompiler#546 merged tomorrow, btw -enable-16bit-types and friends are already on master

On the other hand the main blit shader causes DXC to ICE. I will need some more time to figure out why.

if you follow this and make me a godbolt, then I can investigate myself. https://www.youtube.com/watch?v=sup-_MR686o

devshgraphicsprogramming commented 1 year ago

/execute order 0x45ull

devshgraphicsprogramming commented 1 year ago

Time to merge master to this, type_traits just landed with juicy things like decltype

theoreticalphysicsftw commented 11 months ago

The correctness issues are fixed now and all the filter tests pass like in the GLSL version.

devshgraphicsprogramming commented 11 months ago

Ok turns out that due to some error in my NV driver, some of the uint16_t usages have to be replaced by uint32_t