mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Bug 1295001 - Check interface blocks during validation. - r=kvark
MozReview-Commit-ID: 6nyTZPLmbdC
This commit is contained in:
parent
85a5a84ad0
commit
d61a07cd85
@ -271,7 +271,7 @@ ShaderValidator::CanLinkTo(const ShaderValidator* prev, nsCString* const out_log
|
||||
continue;
|
||||
|
||||
if (!itrVert->isSameUniformAtLinkTime(*itrFrag)) {
|
||||
nsPrintfCString error("Uniform `%s`is not linkable between"
|
||||
nsPrintfCString error("Uniform `%s` is not linkable between"
|
||||
" attached shaders.",
|
||||
itrFrag->name.c_str());
|
||||
*out_log = error;
|
||||
@ -282,6 +282,32 @@ ShaderValidator::CanLinkTo(const ShaderValidator* prev, nsCString* const out_log
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
const auto vertVars = sh::GetInterfaceBlocks(prev->mHandle);
|
||||
const auto fragVars = sh::GetInterfaceBlocks(mHandle);
|
||||
if (!vertVars || !fragVars) {
|
||||
nsPrintfCString error("Could not create uniform block list.");
|
||||
*out_log = error;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const auto& fragVar : *fragVars) {
|
||||
for (const auto& vertVar : *vertVars) {
|
||||
if (vertVar.name != fragVar.name)
|
||||
continue;
|
||||
|
||||
if (!vertVar.isSameInterfaceBlockAtLinkTime(fragVar)) {
|
||||
nsPrintfCString error("Interface block `%s` is not linkable between"
|
||||
" attached shaders.",
|
||||
fragVar.name.c_str());
|
||||
*out_log = error;
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto& vertVaryings = ShGetVaryings(prev->mHandle);
|
||||
const auto& fragVaryings = ShGetVaryings(mHandle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user