Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
KUserFeedback
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Telemetry
KUserFeedback
Commits
68c0b7b4
Commit
68c0b7b4
authored
Jul 06, 2018
by
Volker Krause
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve normalization of OpenGL renderer strings for AMD GPUs
parent
751db983
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
autotests/openglinfosourcetest.cpp
autotests/openglinfosourcetest.cpp
+2
-0
src/provider/core/openglinfosource_p.h
src/provider/core/openglinfosource_p.h
+6
-4
No files found.
autotests/openglinfosourcetest.cpp
View file @
68c0b7b4
...
...
@@ -192,6 +192,8 @@ private slots:
QTest
::
newRow
(
"nvidia macos"
)
<<
QStringLiteral
(
"NVIDIA GeForce GT 750M OpenGL Engine"
)
<<
QStringLiteral
(
"GeForce GT 750M"
);
QTest
::
newRow
(
"angle"
)
<<
QStringLiteral
(
"ANGLE (VirtualBox Graphics Adapter for Windows 8+ Direct3D9Ex vs_3_0 ps_3_0)"
)
<<
QStringLiteral
(
"ANGLE"
);
QTest
::
newRow
(
"gallium"
)
<<
QStringLiteral
(
"Gallium 0.4 on AMD BARTS (DRM 2.49.0 / 4.11.1-1-default, LLVM 4.0.0)"
)
<<
QStringLiteral
(
"Gallium 0.4 on AMD BARTS"
);
QTest
::
newRow
(
"AMD 1"
)
<<
QStringLiteral
(
"AMD BARTS (DRM 2.50.0 / 4.17.2-1-default, LLVM 6.0.0)"
)
<<
QStringLiteral
(
"AMD BARTS"
);
QTest
::
newRow
(
"AMD 2"
)
<<
QStringLiteral
(
"AMD Radeon (TM) RX 480 Graphics (POLARIS10 / DRM 3.19.0 / 4.14.50-gentoo, LLVM 6.0.0)"
)
<<
QStringLiteral
(
"AMD Radeon RX 480 Graphics"
);
}
void
testNormalizeRenderer
()
...
...
src/provider/core/openglinfosource_p.h
View file @
68c0b7b4
...
...
@@ -111,25 +111,27 @@ public:
static
inline
QString
normalizeRenderer
(
const
char
*
renderer
)
{
auto
r
=
QString
::
fromLocal8Bit
(
renderer
);
// remove trademark indicators
r
.
remove
(
QLatin1String
(
"(R)"
),
Qt
::
CaseInsensitive
);
r
.
remove
(
QLatin1String
(
"(TM)"
),
Qt
::
CaseInsensitive
);
// remove vendor prefixes, we already have that in the vendor field
if
(
r
.
startsWith
(
QLatin1String
(
"Mesa DRI "
)))
r
=
r
.
mid
(
9
);
if
(
r
.
startsWith
(
QLatin1String
(
"Intel(R) "
)))
r
=
r
.
mid
(
9
);
if
(
r
.
startsWith
(
QLatin1String
(
"Intel "
)))
r
=
r
.
mid
(
6
);
if
(
r
.
startsWith
(
QLatin1String
(
"NVIDIA "
)))
r
=
r
.
mid
(
7
);
// remove excessive details that could enable fingerprinting
if
(
r
.
startsWith
(
QLatin1String
(
"ANGLE "
))
||
r
.
startsWith
(
QLatin1String
(
"Gallium "
)))
if
(
r
.
startsWith
(
QLatin1String
(
"ANGLE "
))
||
r
.
startsWith
(
QLatin1String
(
"Gallium "
))
||
r
.
startsWith
(
QLatin1String
(
"AMD "
))
)
r
=
stripDetails
(
r
);
// strip macOS adding " OpenGL Engine" at the end
if
(
r
.
endsWith
(
QLatin1String
(
" OpenGL Engine"
)))
r
=
r
.
left
(
r
.
size
()
-
14
);
return
r
;
return
r
.
simplified
()
;
}
private:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment