mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1218559. Implement FindUniformBlockByMappedName. r=jgilbert
This commit is contained in:
parent
d1242d2bc6
commit
800b8139e0
@ -357,8 +357,16 @@ WebGLShader::FindUniformBlockByMappedName(const nsACString& mappedName,
|
||||
nsCString* const out_userName,
|
||||
bool* const out_isArray) const
|
||||
{
|
||||
// TODO: Extract block information from shader validator.
|
||||
return false;
|
||||
if (!mValidator)
|
||||
return false;
|
||||
|
||||
const std::string mappedNameStr(mappedName.BeginReading(), mappedName.Length());
|
||||
std::string userNameStr;
|
||||
if (!mValidator->FindUniformBlockByMappedName(mappedNameStr, &userNameStr))
|
||||
return false;
|
||||
|
||||
*out_userName = userNameStr.c_str();
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -392,6 +392,22 @@ ShaderValidator::FindUniformByMappedName(const std::string& mappedName,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
ShaderValidator::FindUniformBlockByMappedName(const std::string& mappedName,
|
||||
std::string* const out_userName) const
|
||||
{
|
||||
const std::vector<sh::InterfaceBlock>& interfaces = *ShGetInterfaceBlocks(mHandle);
|
||||
for (const auto& interface : interfaces) {
|
||||
if (mappedName == interface.mappedName) {
|
||||
*out_userName = interface.name;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,9 @@ public:
|
||||
bool FindUniformByMappedName(const std::string& mappedName,
|
||||
std::string* const out_userName,
|
||||
bool* const out_isArray) const;
|
||||
bool FindUniformBlockByMappedName(const std::string& mappedName,
|
||||
std::string* const out_userName) const;
|
||||
|
||||
};
|
||||
|
||||
} // namespace webgl
|
||||
|
Loading…
Reference in New Issue
Block a user