The IMG patch Eric was referring to was to dEQP. I submitted bug reports
to both Google and Khronos:
https://issuetracker.google.com/issues/64059452
https://gitlab.khronos.org/Tracker/vk-gl-cts/issues/594
I've attached the patch to this email. The problem is that the dEQP
*resize.surface_size* tests check the native window dimensions after
creating the window, without having called eglSwapBuffers, and hence get
back a native window width and height of zero.
Here is the patch description:
"The Wayland version of deqp-egl calls wl_egl_window_get_attached_size
to get window dimensions. On Mesa at least, this initially returns a
width and height of zero for a new window. The surface resize tests
check the initial surface size, and fail as a result.
Add a new native window capability, CAPABILITY_INITIAL_SURFACE_SIZE_QUERY,
which is only set if the initial window size can be queried after
creation. If native windows don't have the capability, return the
required size from getNativeSurfaceSize, rather than the size obtained
from the window system.
A parameter has been added to getNativeSurfaceSize, to indicate if
the initial size of a surface is being queried".
Brendan.
On 01/06/18 09:36, Juan A. Suarez Romero wrote:
On Thu, 2018-05-31 at 17:24 +0100, Daniel Stone wrote:
Hi Eric,
On 31 May 2018 at 17:13, Eric Engestrom <eric.engest...@intel.com> wrote:
On Thursday, 2018-05-31 16:57:17 +0100, Daniel Stone wrote:
Not initialising attached_{width,height} should not cause any problems
with these checks. By definition there cannot have been any buffers
allocated or attached between creation and the first draw call, so
there are no old buffers to release.
So with that initialisation removed, this is (assuming dEQP still passes):
IMG has a similar patch locally (Cc'ed Frank), because (IIRC) dEQP
creates a window, and before attaching any surface to it, it reads back
the size and asserts out of most tests because it's 0 or -1 or something
like that, and I think this attached_width/height hack was needed
because of that.
That's odd. As I understand it, eglQuerySurface(EGL_{WIDTH,HEIGHT})
should be returning the base surface values. attached_{width,height}
should only be returned to the user when calling
wl_egl_window_get_attached_size(). I'm happy to fix the former for
consistency with other platforms, but anyone calling the latter
without ever having attached anything deserves whatever they get, to
be honest.
What dEQP-EGL.functional.resize.surface_size.* is doing:
- Initialize:
- Create a wayland window with specific size (128x128)
- Create the surface with eglQuerySurface()
- Perform the proper test
- Check if current surface size is the same as window size
- Resize the window
- Swap buffers
- Check again if the current surface size is the same as the window size
The first check is the one that it is failing.
I'm not sure if the test should swap buffers before the first check, as I didn't
find any specification or documentation stating it. But without such call,
seems to work in other platforms.
J.A.
Cheers,
Daniel
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>From 0e82ac55c7bba15b2f17eda74e492c0d6040e7e0 Mon Sep 17 00:00:00 2001
From: Brendan King <brendan.k...@imgtec.com>
Date: Tue, 25 Jul 2017 16:01:22 +0100
Subject: [PATCH] Fix the deqp-egl *resize.surface_size* for Wayland
The Wayland version of deqp-egl calls wl_egl_window_get_attached_size
to get window dimensions. On Mesa at least, this initially returns a
width and height of zero for a new window. The surface resize tests
check the initial surface size, and fail as a result.
Add a new native window capability, CAPABILITY_INITIAL_SURFACE_SIZE_QUERY,
which is only set if the initial window size can be queried after
creation. If native windows don't have the capability, return the
required size from getNativeSurfaceSize, rather than the size obtained
from the window system.
A parameter has been added to getNativeSurfaceSize, to indicate if
the initial size of a surface is being queried.
---
framework/egl/egluNativeWindow.hpp | 3 ++-
framework/platform/X11/tcuX11EglPlatform.cpp | 3 ++-
framework/platform/win32/tcuWin32EGLNativeDisplayFactory.cpp | 3 ++-
modules/egl/teglResizeTests.cpp | 9 ++++++---
4 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/framework/egl/egluNativeWindow.hpp b/framework/egl/egluNativeWindow.hpp
index e468a23..1a4054d 100644
--- a/framework/egl/egluNativeWindow.hpp
+++ b/framework/egl/egluNativeWindow.hpp
@@ -81,7 +81,8 @@ public:
CAPABILITY_SET_SURFACE_SIZE = (1<<3),
CAPABILITY_GET_SCREEN_SIZE = (1<<4),
CAPABILITY_READ_SCREEN_PIXELS = (1<<5),
- CAPABILITY_CHANGE_VISIBILITY = (1<<6)
+ CAPABILITY_CHANGE_VISIBILITY = (1<<6),
+ CAPABILITY_INITIAL_SURFACE_SIZE_QUERY = (1<<7)
};
virtual ~NativeWindow (void) {}
diff --git a/framework/platform/X11/tcuX11EglPlatform.cpp b/framework/platform/X11/tcuX11EglPlatform.cpp
index ca90bc3..d0bbef3 100644
--- a/framework/platform/X11/tcuX11EglPlatform.cpp
+++ b/framework/platform/X11/tcuX11EglPlatform.cpp
@@ -127,7 +127,8 @@ public:
CAPABILITY_CREATE_SURFACE_PLATFORM |
CAPABILITY_GET_SURFACE_SIZE |
CAPABILITY_SET_SURFACE_SIZE |
- CAPABILITY_GET_SCREEN_SIZE);
+ CAPABILITY_GET_SCREEN_SIZE |
+ CAPABILITY_INITIAL_SURFACE_SIZE_QUERY);
Window (Display& display,
const WindowParams& params,
diff --git a/framework/platform/win32/tcuWin32EGLNativeDisplayFactory.cpp b/framework/platform/win32/tcuWin32EGLNativeDisplayFactory.cpp
index 9c55196..2678a50 100644
--- a/framework/platform/win32/tcuWin32EGLNativeDisplayFactory.cpp
+++ b/framework/platform/win32/tcuWin32EGLNativeDisplayFactory.cpp
@@ -62,7 +62,8 @@ static const eglu::NativeWindow::Capability WINDOW_CAPABILITIES = (eglu::Nativ
eglu::NativeWindow::CAPABILITY_GET_SCREEN_SIZE |
eglu::NativeWindow::CAPABILITY_READ_SCREEN_PIXELS |
eglu::NativeWindow::CAPABILITY_SET_SURFACE_SIZE |
- eglu::NativeWindow::CAPABILITY_CHANGE_VISIBILITY);
+ eglu::NativeWindow::CAPABILITY_CHANGE_VISIBILITY |
+ eglu::NativeWindow::CAPABILITY_INITIAL_SURFACE_SIZE_QUERY);
class NativeDisplay : public eglu::NativeDisplay
{
diff --git a/modules/egl/teglResizeTests.cpp b/modules/egl/teglResizeTests.cpp
index 60cc66d..4b41b8e 100644
--- a/modules/egl/teglResizeTests.cpp
+++ b/modules/egl/teglResizeTests.cpp
@@ -318,9 +318,10 @@ inline bool hasBits (T bitSet, T requiredBits)
}
IVec2 getNativeSurfaceSize (const NativeWindow& nativeWindow,
+ bool getInitialSize,
IVec2 reqSize)
{
- if (hasBits(nativeWindow.getCapabilities(), NativeWindow::CAPABILITY_GET_SURFACE_SIZE))
+ if (hasBits(nativeWindow.getCapabilities(), getInitialSize ? NativeWindow::CAPABILITY_INITIAL_SURFACE_SIZE_QUERY : NativeWindow::CAPABILITY_GET_SURFACE_SIZE))
return nativeWindow.getSurfaceSize();
return reqSize; // assume we got the requested size
}
@@ -329,10 +330,11 @@ IVec2 checkSurfaceSize (const Library& egl,
EGLDisplay eglDisplay,
EGLSurface eglSurface,
const NativeWindow& nativeWindow,
+ bool getInitialSize,
IVec2 reqSize,
ResultCollector& status)
{
- const IVec2 nativeSize = getNativeSurfaceSize(nativeWindow, reqSize);
+ const IVec2 nativeSize = getNativeSurfaceSize(nativeWindow, getInitialSize, reqSize);
IVec2 eglSize = eglu::getSurfaceSize(egl, eglDisplay, eglSurface);
ostringstream oss;
@@ -351,6 +353,7 @@ IterateResult ChangeSurfaceSizeCase::iterate (void)
m_display,
**m_surface,
*m_nativeWindow,
+ true,
m_oldSize,
m_status);
@@ -360,7 +363,7 @@ IterateResult ChangeSurfaceSizeCase::iterate (void)
egl.swapBuffers(m_display, **m_surface);
EGLU_CHECK_MSG(egl, "eglSwapBuffers()");
- checkSurfaceSize(egl, m_display, **m_surface, *m_nativeWindow, m_newSize, m_status);
+ checkSurfaceSize(egl, m_display, **m_surface, *m_nativeWindow, false, m_newSize, m_status);
m_status.setTestContextResult(m_testCtx);
return STOP;
--
2.7.4
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev