LukasBanana / XShaderCompiler

Shader cross compiler to translate HLSL (Shader Model 4 and 5) to GLSL
BSD 3-Clause "New" or "Revised" License
352 stars 48 forks source link

"countbits" issue #64

Closed ghost closed 7 years ago

ghost commented 7 years ago

I also found issue with latest GLSL. I found issue with a counting of bits. This function just skipping. Also need means, that uint64 does not support directly bitCount in GLSL, but can be calculated by unpacking and count bits from vector components.

https://msdn.microsoft.com/en-us/library/windows/desktop/ff471355(v=vs.85).aspx --> https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/bitCount.xhtml

LukasBanana commented 7 years ago

It seems that neither countbits in HLSL nor bitCount in GLSL support uint64, so what exactly is the issue? I mean, the functions look pretty much identical for me.

ghost commented 7 years ago

Problem that countbits is missing in compiler.

LukasBanana commented 7 years ago

Thanks for the hint, the mapping for countbits was indeed empty in the GLSL backend. Fixed it with 5f7bea6.