summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Nevala <samuel.nevala@intopalo.com>2015-10-22 14:02:28 +0300
committerAndrew Knight <andrew.knight@intopalo.com>2015-10-24 09:41:03 +0000
commita8455ac5fa250cf651cf9f6c66b82b51a5557f19 (patch)
treeb9fae38e24d025ef75a879f5b86aa5f88c41eba9 /src
parent7df107f0266892276c85d259afba335c2a77ba07 (diff)
ANGLE: Fix winrt backing store to support feature level 9_3 devices.
Partially revert c7abf81786f4a0c. Instead of using the ES3 entry point, use ES2 for framebuffer blitting. This means that a small change is required to ANGLE for the blit behave the same as ES3 (applied only for Windows Store apps). Task-Id: QTBUG-48266 Change-Id: Idc51f00a659c91f740876be071eb71bff69e0e38 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp4
-rw-r--r--src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch38
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.cpp11
3 files changed, 47 insertions, 6 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp b/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
index 8be6ae7d2f..d41c5a4da5 100644
--- a/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
@@ -659,7 +659,11 @@ void GL_APIENTRY BlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLi
{
if (!ValidateBlitFramebufferParameters(context, srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1, mask, filter,
+#ifndef ANGLE_ENABLE_WINDOWS_STORE
true))
+#else
+ false))
+#endif
{
return;
}
diff --git a/src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch b/src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch
new file mode 100644
index 0000000000..8f66b0c1d8
--- /dev/null
+++ b/src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch
@@ -0,0 +1,38 @@
+From 54461670e035ffcb41268a02e9b0c441cc008ddb Mon Sep 17 00:00:00 2001
+From: Samuel Nevala <samuel.nevala@intopalo.com>
+Date: Thu, 22 Oct 2015 14:02:28 +0300
+Subject: [PATCH] ANGLE: Fix winrt backing store to support feature level 9_3
+ devices.
+
+Partially revert c7abf81786f4a0c. Instead of using ES3 entry point
+use ES2 for blitting. Small change is also required to ANGLE that
+makes ES2 entry to behave same as ES3.
+
+Task-Id: QTBUG-48266
+Change-Id: Idc51f00a659c91f740876be071eb71bff69e0e38
+---
+ .../src/libGLESv2/entry_points_gles_2_0_ext.cpp | 4 +++
+ ...inrt-backing-store-to-support-feature-lev.patch | 33 ++++++++++++++++++++++
+ src/plugins/platforms/winrt/qwinrtbackingstore.cpp | 11 ++++----
+ 3 files changed, 42 insertions(+), 6 deletions(-)
+ create mode 100644 src/angle/patches/0009-ANGLE-Fix-winrt-backing-store-to-support-feature-lev.patch
+
+diff --git a/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp b/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
+index 8be6ae7..d41c5a4 100644
+--- a/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
++++ b/src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
+@@ -659,7 +659,11 @@ void GL_APIENTRY BlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLi
+ {
+ if (!ValidateBlitFramebufferParameters(context, srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1, mask, filter,
++#ifndef ANGLE_ENABLE_WINDOWS_STORE
+ true))
++#else
++ false))
++#endif
+ {
+ return;
+ }
+--
+1.9.5.msysgit.1
+
diff --git a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
index dcf8239538..ee54bf795c 100644
--- a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
+++ b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
@@ -42,8 +42,8 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFramebufferObject>
-#include <GLES3/gl3.h>
-#include <GLES3/gl3ext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
QT_BEGIN_NAMESPACE
@@ -78,7 +78,6 @@ bool QWinRTBackingStore::initialize()
d->context.reset(new QOpenGLContext);
QSurfaceFormat format = window()->requestedFormat();
- format.setVersion(3, 0); // Required for ES3 framebuffer blit
d->context->setFormat(format);
d->context->setScreen(window()->screen());
if (!d->context->create())
@@ -121,13 +120,13 @@ void QWinRTBackingStore::flush(QWindow *window, const QRegion &region, const QPo
GL_RGBA, GL_UNSIGNED_BYTE, d->paintDevice.constScanLine(bounds.y()));
glBindTexture(GL_TEXTURE_2D, 0);
- glBindFramebuffer(GL_READ_FRAMEBUFFER, d->fbo->handle());
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER_ANGLE, d->fbo->handle());
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER_ANGLE, 0);
const int y1 = bounds.y();
const int y2 = y1 + bounds.height();
const int x1 = bounds.x();
const int x2 = x1 + bounds.width();
- glBlitFramebuffer(x1, y1, x2, y2,
+ glBlitFramebufferANGLE(x1, y1, x2, y2,
x1, d->size.height() - y1, x2, d->size.height() - y2,
GL_COLOR_BUFFER_BIT, GL_NEAREST);