Fix for 'used samplers was converted to static'
It seems reflection doesn't have a way to query used(live) samplers.
This commit is contained in:
parent
e00f568d73
commit
8e8161f743
@ -699,17 +699,25 @@ namespace bgfx { namespace spirv
|
|||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
for (int32_t ii = 0, num = program->getNumLiveUniformVariables(); ii < num; ++ii)
|
if (!bx::findIdentifierMatch(strLine.c_str(), "SamplerState").isEmpty())
|
||||||
{
|
{
|
||||||
// matching lines like: uniform u_name;
|
found = true;
|
||||||
// we want to replace "uniform" with "static" so that it's no longer
|
}
|
||||||
// included in the uniform blob that the application must upload
|
else
|
||||||
// we can't just remove them, because unused functions might still reference
|
{
|
||||||
// them and cause a compile error when they're gone
|
|
||||||
if (!bx::findIdentifierMatch(strLine.c_str(), program->getUniformName(ii) ).isEmpty() )
|
for (int32_t ii = 0, num = program->getNumLiveUniformVariables(); ii < num; ++ii)
|
||||||
{
|
{
|
||||||
found = true;
|
// matching lines like: uniform u_name;
|
||||||
break;
|
// we want to replace "uniform" with "static" so that it's no longer
|
||||||
|
// included in the uniform blob that the application must upload
|
||||||
|
// we can't just remove them, because unused functions might still reference
|
||||||
|
// them and cause a compile error when they're gone
|
||||||
|
if (!bx::findIdentifierMatch(strLine.c_str(), program->getUniformName(ii)).isEmpty())
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user