shaderc: Fixed issues with VFACE that cause X4576: Non system-generated input signature parameter... error

This commit is contained in:
Branimir Karadžić 2018-06-05 17:41:10 -07:00
parent 4521d30959
commit 76c19a7676

View File

@ -18,7 +18,7 @@ extern "C"
#define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', 0x5)
#define BGFX_SHADERC_VERSION_MAJOR 1
#define BGFX_SHADERC_VERSION_MINOR 12
#define BGFX_SHADERC_VERSION_MINOR 13
namespace bgfx
{
@ -1596,18 +1596,27 @@ namespace bgfx
);
}
if (hasFrontFacing
&& hlsl >= 3)
if (hasFrontFacing)
{
preprocessor.writef(
" \\\n\t%sfloat __vface : VFACE"
, arg++ > 0 ? ", " : " "
);
if (hlsl == 3)
{
preprocessor.writef(
" \\\n\t%sfloat __vface : VFACE"
, arg++ > 0 ? ", " : " "
);
}
else
{
preprocessor.writef(
" \\\n\t%sbool gl_FrontFacing : SV_IsFrontFace"
, arg++ > 0 ? ", " : " "
);
}
}
if (hasPrimitiveId)
{
if (d3d > 9)
if (hlsl > 3)
{
preprocessor.writef(
" \\\n\t%suint gl_PrimitiveID : SV_PrimitiveID"
@ -1627,18 +1636,12 @@ namespace bgfx
if (hasFrontFacing)
{
if (hlsl >= 3)
if (hlsl == 3)
{
preprocessor.writef(
"#define gl_FrontFacing (__vface <= 0.0)\n"
);
}
else
{
preprocessor.writef(
"#define gl_FrontFacing false\n"
);
}
}
}
else if ('v' == _options.shaderType)