mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1427088 - Don't rely on glGetStringi just because it exists. - r=daoshengmu
MozReview-Commit-ID: Gmf6phqDOTK
This commit is contained in:
parent
87bb85b91b
commit
93dcf044db
@ -1656,28 +1656,31 @@ GLContext::InitExtensions()
|
||||
|
||||
std::vector<nsCString> driverExtensionList;
|
||||
|
||||
if (mSymbols.fGetStringi) {
|
||||
GLuint count = 0;
|
||||
GetUIntegerv(LOCAL_GL_NUM_EXTENSIONS, &count);
|
||||
for (GLuint i = 0; i < count; i++) {
|
||||
// This is UTF-8.
|
||||
const char* rawExt = (const char*)fGetStringi(LOCAL_GL_EXTENSIONS, i);
|
||||
[&]() {
|
||||
if (mSymbols.fGetStringi) {
|
||||
GLuint count = 0;
|
||||
if (GetPotentialInteger(LOCAL_GL_NUM_EXTENSIONS, (GLint*)&count)) {
|
||||
for (GLuint i = 0; i < count; i++) {
|
||||
// This is UTF-8.
|
||||
const char* rawExt = (const char*)fGetStringi(LOCAL_GL_EXTENSIONS, i);
|
||||
|
||||
// We CANNOT use nsDependentCString here, because the spec doesn't guarantee
|
||||
// that the pointers returned are different, only that their contents are.
|
||||
// On Flame, each of these index string queries returns the same address.
|
||||
driverExtensionList.push_back(nsCString(rawExt));
|
||||
// We CANNOT use nsDependentCString here, because the spec doesn't guarantee
|
||||
// that the pointers returned are different, only that their contents are.
|
||||
// On Flame, each of these index string queries returns the same address.
|
||||
driverExtensionList.push_back(nsCString(rawExt));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MOZ_ALWAYS_TRUE(!fGetError());
|
||||
const char* rawExts = (const char*)fGetString(LOCAL_GL_EXTENSIONS);
|
||||
MOZ_ALWAYS_TRUE(!fGetError());
|
||||
|
||||
const char* rawExts = (const char*)fGetString(LOCAL_GL_EXTENSIONS);
|
||||
if (rawExts) {
|
||||
nsDependentCString exts(rawExts);
|
||||
SplitByChar(exts, ' ', &driverExtensionList);
|
||||
}
|
||||
}
|
||||
}();
|
||||
const auto err = fGetError();
|
||||
MOZ_ALWAYS_TRUE(!err);
|
||||
|
||||
const bool shouldDumpExts = ShouldDumpExts();
|
||||
if (shouldDumpExts) {
|
||||
|
Loading…
Reference in New Issue
Block a user