Fixes example 41 on OpenGL (#2234)

The glsl function findMSB is overriden, causing an error on Windows and Linux
when running on AMD or Intel gpus. Nvidia, for whatever reason, seems to allow
overriding the function.
This commit is contained in:
kingscallop
2020-08-16 19:43:28 +01:00
committed by GitHub
parent cb8f6dfcec
commit e5d25a7d88
3 changed files with 4 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ void main()
}
else
{
targetLod = parentLod = findMSB(key);
targetLod = parentLod = findMSB_(key);
}
updateSubdBuffer(primID, key, targetLod, parentLod);

View File

@@ -1,4 +1,4 @@
uint findMSB(uint x)
uint findMSB_(uint x)
{
uint i;
uint mask;
@@ -36,7 +36,7 @@ bool isRootKey(in uint key)
bool isLeafKey(in uint key)
{
return findMSB(key) == 31;
return findMSB_(key) == 31;
}
bool isChildZeroKey(in uint key)

View File

@@ -64,7 +64,7 @@ void updateSubdBuffer(
)
{
// extract subdivision level associated to the key
uint keyLod = findMSB(key);
uint keyLod = findMSB_(key);
// update the key accordingly
if (/* subdivide ? */ keyLod < targetLod && !isLeafKey(key) && isVisible)