Check shader compiling/linking in detection.
This commit is contained in:
parent
d922c3085a
commit
0ad1d2c965
1 changed files with 17 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
||||||
//
|
//
|
||||||
#include "ui/gl/gl_detection.h"
|
#include "ui/gl/gl_detection.h"
|
||||||
|
|
||||||
|
#include "ui/gl/gl_shader.h"
|
||||||
#include "ui/integration.h"
|
#include "ui/integration.h"
|
||||||
#include "base/debug_log.h"
|
#include "base/debug_log.h"
|
||||||
|
|
||||||
|
|
@ -87,6 +88,22 @@ Capabilities CheckCapabilities(QWidget *widget) {
|
||||||
LOG_ONCE(("OpenGL: Shaders not supported."));
|
LOG_ONCE(("OpenGL: Shaders not supported."));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
auto program = QOpenGLShaderProgram();
|
||||||
|
LinkProgram(
|
||||||
|
&program,
|
||||||
|
VertexShader({
|
||||||
|
VertexViewportTransform(),
|
||||||
|
VertexPassTextureCoord(),
|
||||||
|
}),
|
||||||
|
FragmentShader({
|
||||||
|
FragmentSampleARGB32Texture(),
|
||||||
|
}));
|
||||||
|
if (!program.isLinked()) {
|
||||||
|
LOG_ONCE(("OpenGL: Could not link simple shader."));
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
const auto supported = context->format();
|
const auto supported = context->format();
|
||||||
switch (supported.profile()) {
|
switch (supported.profile()) {
|
||||||
case QSurfaceFormat::NoProfile: {
|
case QSurfaceFormat::NoProfile: {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue