Fixed issue when gl_PrimitiveID and gl_FrontFacing are used together. Issue #3509. (#3510)

This commit is contained in:
Branimir Karadžić
2025-12-03 18:27:44 -08:00
committed by GitHub
parent 8a60697cfd
commit 3a652bbc7a

View File

@@ -1977,6 +1977,22 @@ namespace bgfx
);
}
if (hasPrimitiveId)
{
if (profile->id >= 400)
{
preprocessor.writef(
" \\\n\t%suint gl_PrimitiveID : SV_PrimitiveID"
, arg++ > 0 ? ", " : " "
);
}
else
{
bx::write(_messageWriter, &messageErr, "gl_PrimitiveID builtin is not supported by D3D9 HLSL.\n");
return false;
}
}
if (hasFrontFacing)
{
if (profile->id < 400)
@@ -1995,22 +2011,6 @@ namespace bgfx
}
}
if (hasPrimitiveId)
{
if (profile->id >= 400)
{
preprocessor.writef(
" \\\n\t%suint gl_PrimitiveID : SV_PrimitiveID"
, arg++ > 0 ? ", " : " "
);
}
else
{
bx::write(_messageWriter, &messageErr, "gl_PrimitiveID builtin is not supported by D3D9 HLSL.\n");
return false;
}
}
preprocessor.writef(
" \\\n\t)\n"
);