Added a new capability to check for PrimitiveID support (#3154)

This commit is contained in:
Jamil Halabi
2023-08-04 17:42:33 +03:00
committed by GitHub
parent 3101a0d93f
commit f059531885
12 changed files with 53 additions and 14 deletions

View File

@@ -1853,7 +1853,12 @@ namespace bgfx
const bool hasFragCoord = !bx::strFind(input, "gl_FragCoord").isEmpty() || profile->id >= 400;
const bool hasFragDepth = !bx::strFind(input, "gl_FragDepth").isEmpty();
const bool hasFrontFacing = !bx::strFind(input, "gl_FrontFacing").isEmpty();
const bool hasPrimitiveId = !bx::strFind(input, "gl_PrimitiveID").isEmpty();
const bool hasPrimitiveId = !bx::strFind(input, "gl_PrimitiveID").isEmpty() && BGFX_CAPS_PRIMITIVE_ID;
if (!hasPrimitiveId)
{
preprocessor.writef("#define gl_PrimitiveID 0\n");
}
bool hasFragData[8] = {};
uint32_t numFragData = 0;