SPV: Add auto location mapping of non-opaque non-block uniform variables.

Fix #1019.
This commit is contained in:
John Kessenich 2017-08-26 15:47:25 -06:00
parent 8268a35504
commit 82e95a3aa5
9 changed files with 93 additions and 12 deletions

View file

@ -2493,8 +2493,8 @@ void TParseContext::transparentOpaqueCheck(const TSourceLoc& loc, const TType& t
// Vulkan doesn't allow transparent uniforms outside of blocks
if (spvVersion.vulkan > 0)
vulkanRemoved(loc, "non-opaque uniforms outside a block");
// OpenGL wants locations on these
if (spvVersion.openGl > 0 && !type.getQualifier().hasLocation())
// OpenGL wants locations on these (unless they are getting automapped)
if (spvVersion.openGl > 0 && !type.getQualifier().hasLocation() && !intermediate.getAutoMapLocations())
error(loc, "non-opaque uniform variables need a layout(location=L)", identifier.c_str(), "");
}
}