Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
No texture swizzling on DX11 #2312
If you're not familiar with swizzling, it's a way to re-order the elements of a vector (and in Vulkan replace elements with constants). DirectX 11 doesn't support swizzling like DX12 and Vulkan do, so a workaround is needed.
A really wild thought would be to intercept bind calls, and if a bound image view is defined to be swizzled, we patch the shader in the right places with the swizzling pattern hardcoded! I don't see much reason as to why this wouldn't work, but this could lead to exponential shader permutations with regard to the amount of image views the shader uses (in the worst case).