Add eglQueryDisplayAttribANGLE to query workarounds count.

Add eglQueryDisplayAttribANGLE based on eglQueryDisplayAttribEXT to add
behavior for quering the count of all workarounds available. Used
externally to build a list of workarounds.

Bug: angleproject:1621

Change-Id: I793acedc76111fd018600169d58bf5d8cf4a63ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1637817
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This commit is contained in:
Jonah Ryan-Davis 2019-05-30 16:40:13 -04:00 коммит произвёл Commit Bot
Родитель 20d380fa5b
Коммит 2dd40a44d1
20 изменённых файлов: 193 добавлений и 50 удалений

Просмотреть файл

@ -35,11 +35,15 @@ Dependencies
This extension is written against the wording of the EGL 1.4 This extension is written against the wording of the EGL 1.4
Specification. Specification.
EGL_EXT_device_query affects the definition of this extension.
Overview Overview
This extension defines a method to query a string describing This extension adds two methods to query arrays holding
properties of the EGL client or of an EGL display connection information about the available workarounds for a given device.
which are looked up via the property name and index. One method is used to query the total count of available
workarounds. Another method is used to query a string property
of an individual workaround given the workaround index.
IP Status IP Status
@ -56,6 +60,11 @@ New Procedures and Functions
EGLint name, EGLint name,
EGLint index); EGLint index);
EGLBoolean eglQueryDisplayAttribANGLE(
EGLDisplay dpy,
EGLint attribute,
EGLAttrib *value);
New Tokens New Tokens
Accepted as a queried <name> in eglQueryStringiANGLE: Accepted as a queried <name> in eglQueryStringiANGLE:
@ -66,9 +75,11 @@ New Tokens
EGL_WORKAROUND_BUG_ANGLE 0x3463 EGL_WORKAROUND_BUG_ANGLE 0x3463
EGL_WORKAROUND_ENABLED_ANGLE 0x3464 EGL_WORKAROUND_ENABLED_ANGLE 0x3464
Additions to the EGL 1.5 Specification Accepted as a queried <attribute> in eglQueryDisplayAttribANGLE
Add the following to the end of section 3.3 "EGL Queries": EGL_WORKAROUND_COUNT_ANGLE 0x3465
Add the following to the end of section 3.3 "EGL Queries":
const char *eglQueryStringiANGLE(EGLDisplay dpy, const char *eglQueryStringiANGLE(EGLDisplay dpy,
EGLint name, EGLint index); EGLint name, EGLint index);
@ -107,6 +118,24 @@ Additions to the EGL 1.5 Specification
An EGL_BAD_PARAMETER error is generated if index is not within An EGL_BAD_PARAMETER error is generated if index is not within
the valid range of indices for the array. the valid range of indices for the array.
Add a section "3.4 Display Attributes" after "3.3 EGL Versioning"
To query attributes of an initialized display, use:
EGLBoolean eglQueryDisplayAttribANGLE(EGLDisplay dpy,
EGLint attribute,
EGLAttrib *value);
On success, EGL_TRUE is returned.
If <attribute> is EGL_WORKAROUND_COUNT_ANGLE, the total count of
available workarounds is returned in <value>.
On failure, EGL_FALSE is returned.
An EGL_BAD_DISPLAY error is generated if dpy is not a valid
display.
An EGL_BAD_ATTRIBUTE error is generated if <attribute> is not a
valid value.
Issues Issues
None None

Просмотреть файл

@ -216,9 +216,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
#define EGL_WORKAROUND_DESCRIPTION_ANGLE 0x3462 #define EGL_WORKAROUND_DESCRIPTION_ANGLE 0x3462
#define EGL_WORKAROUND_BUG_ANGLE 0x3463 #define EGL_WORKAROUND_BUG_ANGLE 0x3463
#define EGL_WORKAROUND_ENABLED_ANGLE 0x3464 #define EGL_WORKAROUND_ENABLED_ANGLE 0x3464
#define EGL_WORKAROUND_COUNT_ANGLE 0x3465
typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGIANGLEPROC) (EGLDisplay dpy, EGLint name, EGLint index); typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGIANGLEPROC) (EGLDisplay dpy, EGLint name, EGLint index);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBANGLEPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
#ifdef EGL_EGLEXT_PROTOTYPES #ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI const char *EGLAPIENTRY eglQueryStringiANGLE(EGLDisplay dpy, EGLint name, EGLint index); EGLAPI const char *EGLAPIENTRY eglQueryStringiANGLE(EGLDisplay dpy, EGLint name, EGLint index);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribANGLE(EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
#endif #endif
#endif /* EGL_ANGLE_workaround_control */ #endif /* EGL_ANGLE_workaround_control */

Просмотреть файл

@ -75,6 +75,12 @@
<param><ptype>EGLint</ptype> <name>name</name></param> <param><ptype>EGLint</ptype> <name>name</name></param>
<param><ptype>EGLint</ptype> <name>index</name></param> <param><ptype>EGLint</ptype> <name>index</name></param>
</command> </command>
<command>
<proto><ptype>EGLBoolean</ptype> <name>eglDisplayAttribANGLE</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param><ptype>EGLint</ptype> <name>attribute</name></param>
<param><ptype>EGLAttrib *</ptype> <name>value</name></param>
</command>
</commands> </commands>
<!-- SECTION: ANGLE extension interface definitions --> <!-- SECTION: ANGLE extension interface definitions -->
<extensions> <extensions>
@ -106,6 +112,7 @@
<extension name="EGL_ANGLE_workaround_control" supported="egl"> <extension name="EGL_ANGLE_workaround_control" supported="egl">
<require> <require>
<command name="eglQueryStringiANGLE"/> <command name="eglQueryStringiANGLE"/>
<command name="eglQueryDisplayAttribANGLE"/>
</require> </require>
</extension> </extension>
</extensions> </extensions>

Просмотреть файл

@ -90,7 +90,7 @@
"GL/EGL entry points:scripts/egl.xml": "GL/EGL entry points:scripts/egl.xml":
"842e24514c4cfe09fba703c17a0fd292", "842e24514c4cfe09fba703c17a0fd292",
"GL/EGL entry points:scripts/egl_angle_ext.xml": "GL/EGL entry points:scripts/egl_angle_ext.xml":
"cc91aa6b14979dc7b3a0b7fee024e59e", "5a960e91d1b0837828638e19db1b685a",
"GL/EGL entry points:scripts/entry_point_packed_gl_enums.json": "GL/EGL entry points:scripts/entry_point_packed_gl_enums.json":
"28238b0f52826c3794eaa1aa940238bf", "28238b0f52826c3794eaa1aa940238bf",
"GL/EGL entry points:scripts/generate_entry_points.py": "GL/EGL entry points:scripts/generate_entry_points.py":
@ -138,11 +138,11 @@
"GL/EGL entry points:src/libGLESv2/libGLESv2_autogen.cpp": "GL/EGL entry points:src/libGLESv2/libGLESv2_autogen.cpp":
"c99457bcd86a5b94c61185c1bcddfdcb", "c99457bcd86a5b94c61185c1bcddfdcb",
"GL/EGL entry points:src/libGLESv2/libGLESv2_autogen.def": "GL/EGL entry points:src/libGLESv2/libGLESv2_autogen.def":
"7bf137682e60dc977445d4ef989b3dcf", "054028c2a9caa4b303fc65e18e0320bc",
"GL/EGL/WGL loader:scripts/egl.xml": "GL/EGL/WGL loader:scripts/egl.xml":
"842e24514c4cfe09fba703c17a0fd292", "842e24514c4cfe09fba703c17a0fd292",
"GL/EGL/WGL loader:scripts/egl_angle_ext.xml": "GL/EGL/WGL loader:scripts/egl_angle_ext.xml":
"cc91aa6b14979dc7b3a0b7fee024e59e", "5a960e91d1b0837828638e19db1b685a",
"GL/EGL/WGL loader:scripts/generate_loader.py": "GL/EGL/WGL loader:scripts/generate_loader.py":
"5a7cd014230fe04664d9613e65399d42", "5a7cd014230fe04664d9613e65399d42",
"GL/EGL/WGL loader:scripts/registry_xml.py": "GL/EGL/WGL loader:scripts/registry_xml.py":
@ -150,13 +150,13 @@
"GL/EGL/WGL loader:scripts/wgl.xml": "GL/EGL/WGL loader:scripts/wgl.xml":
"aa96419c582af2f6673430e2847693f4", "aa96419c582af2f6673430e2847693f4",
"GL/EGL/WGL loader:src/libEGL/egl_loader_autogen.cpp": "GL/EGL/WGL loader:src/libEGL/egl_loader_autogen.cpp":
"494b0076622c9d7f70b74eeb00fd348c", "aa736e910cee09355f7ac646dd5e8576",
"GL/EGL/WGL loader:src/libEGL/egl_loader_autogen.h": "GL/EGL/WGL loader:src/libEGL/egl_loader_autogen.h":
"8fd78216d48373e776f2f579a58f84c8", "bdd2e54a7b23b9616efa14e0b4cc7169",
"GL/EGL/WGL loader:util/egl_loader_autogen.cpp": "GL/EGL/WGL loader:util/egl_loader_autogen.cpp":
"310b388513c03d205c33e84454851ed7", "c7ee1ebf9d35e29d3ae907f3b71c3b74",
"GL/EGL/WGL loader:util/egl_loader_autogen.h": "GL/EGL/WGL loader:util/egl_loader_autogen.h":
"093393b593b7e1af814c1e9da3e7b053", "25c81800fe7efbc656570355824bf71b",
"GL/EGL/WGL loader:util/gles_loader_autogen.cpp": "GL/EGL/WGL loader:util/gles_loader_autogen.cpp":
"34056ce8d9c18d3cdcd23e16b94508c4", "34056ce8d9c18d3cdcd23e16b94508c4",
"GL/EGL/WGL loader:util/gles_loader_autogen.h": "GL/EGL/WGL loader:util/gles_loader_autogen.h":
@ -416,9 +416,9 @@
"proc table:src/libGLESv2/gen_proc_table.py": "proc table:src/libGLESv2/gen_proc_table.py":
"3be3e8ed7fad58e8cc6fcf348da7b17d", "3be3e8ed7fad58e8cc6fcf348da7b17d",
"proc table:src/libGLESv2/proc_table_autogen.cpp": "proc table:src/libGLESv2/proc_table_autogen.cpp":
"fd3852952eecf7a81758edeb3b5465c3", "7cf8dbd79fddffd89d2348d1210ba4ca",
"proc table:src/libGLESv2/proc_table_data.json": "proc table:src/libGLESv2/proc_table_data.json":
"e04e3c3c46ba7ed4994ce64aedbff390", "d92a9202be39597e148545b6c0a7abb3",
"uniform type:src/common/gen_uniform_type_table.py": "uniform type:src/common/gen_uniform_type_table.py":
"9dd389f2b5793ba635169d61cef2dde9", "9dd389f2b5793ba635169d61cef2dde9",
"uniform type:src/common/uniform_type_info_autogen.cpp": "uniform type:src/common/uniform_type_info_autogen.cpp":

Просмотреть файл

@ -1477,4 +1477,23 @@ const char *Display::queryStringi(const EGLint name, const EGLint index)
return result; return result;
} }
EGLAttrib Display::queryAttrib(const EGLint attribute)
{
EGLAttrib value = 0;
switch (attribute)
{
case EGL_DEVICE_EXT:
value = reinterpret_cast<EGLAttrib>(mDevice);
break;
case EGL_WORKAROUND_COUNT_ANGLE:
value = mFeatures.size();
break;
default:
UNREACHABLE();
}
return value;
}
} // namespace egl } // namespace egl

Просмотреть файл

@ -195,6 +195,8 @@ class Display final : public LabeledObject, angle::NonCopyable
const char *queryStringi(const EGLint name, const EGLint index); const char *queryStringi(const EGLint name, const EGLint index);
EGLAttrib queryAttrib(const EGLint attribute);
private: private:
Display(EGLenum platform, EGLNativeDisplayType displayId, Device *eglDevice); Display(EGLenum platform, EGLNativeDisplayType displayId, Device *eglDevice);

Просмотреть файл

@ -3762,4 +3762,46 @@ Error ValidateQueryStringiANGLE(const Display *display, EGLint name, EGLint inde
return NoError(); return NoError();
} }
Error ValidateQueryDisplayAttribBase(const Display *display, const EGLint attribute)
{
ANGLE_TRY(ValidateDisplay(display));
switch (attribute)
{
case EGL_DEVICE_EXT:
if (!display->getExtensions().deviceQuery)
{
return EglBadDisplay() << "EGL_EXT_device_query extension is not available.";
}
break;
case EGL_WORKAROUND_COUNT_ANGLE:
if (!display->getExtensions().workaroundControlANGLE)
{
return EglBadDisplay()
<< "EGL_ANGLE_workaround_control extension is not available.";
}
break;
default:
return EglBadAttribute() << "attribute is not valid.";
}
return NoError();
}
Error ValidateQueryDisplayAttribEXT(const Display *display, const EGLint attribute)
{
ANGLE_TRY(ValidateQueryDisplayAttribBase(display, attribute));
return NoError();
}
Error ValidateQueryDisplayAttribANGLE(const Display *display, const EGLint attribute)
{
ANGLE_TRY(ValidateQueryDisplayAttribBase(display, attribute));
return NoError();
}
} // namespace egl } // namespace egl

Просмотреть файл

@ -317,6 +317,9 @@ Error ValidateGetFrameTimestampsANDROID(const Display *display,
Error ValidateQueryStringiANGLE(const Display *display, EGLint name, EGLint index); Error ValidateQueryStringiANGLE(const Display *display, EGLint name, EGLint index);
Error ValidateQueryDisplayAttribEXT(const Display *display, const EGLint attribute);
Error ValidateQueryDisplayAttribANGLE(const Display *display, const EGLint attribute);
} // namespace egl } // namespace egl
#define ANGLE_EGL_TRY(THREAD, EXPR, FUNCNAME, LABELOBJECT) \ #define ANGLE_EGL_TRY(THREAD, EXPR, FUNCNAME, LABELOBJECT) \

Просмотреть файл

@ -70,6 +70,7 @@ PFNEGLPROGRAMCACHERESIZEANGLEPROC EGL_ProgramCacheResizeANGLE;
PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointerANGLE; PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointerANGLE;
PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC EGL_CreateStreamProducerD3DTextureANGLE; PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC EGL_CreateStreamProducerD3DTextureANGLE;
PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE; PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE;
PFNEGLQUERYDISPLAYATTRIBANGLEPROC EGL_QueryDisplayAttribANGLE;
PFNEGLQUERYSTRINGIANGLEPROC EGL_QueryStringiANGLE; PFNEGLQUERYSTRINGIANGLEPROC EGL_QueryStringiANGLE;
PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM; PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM;
PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT; PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT;
@ -195,6 +196,8 @@ void LoadEGL_EGL(LoadProc loadProc)
loadProc("EGL_CreateStreamProducerD3DTextureANGLE")); loadProc("EGL_CreateStreamProducerD3DTextureANGLE"));
EGL_StreamPostD3DTextureANGLE = reinterpret_cast<PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC>( EGL_StreamPostD3DTextureANGLE = reinterpret_cast<PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC>(
loadProc("EGL_StreamPostD3DTextureANGLE")); loadProc("EGL_StreamPostD3DTextureANGLE"));
EGL_QueryDisplayAttribANGLE = reinterpret_cast<PFNEGLQUERYDISPLAYATTRIBANGLEPROC>(
loadProc("EGL_QueryDisplayAttribANGLE"));
EGL_QueryStringiANGLE = EGL_QueryStringiANGLE =
reinterpret_cast<PFNEGLQUERYSTRINGIANGLEPROC>(loadProc("EGL_QueryStringiANGLE")); reinterpret_cast<PFNEGLQUERYSTRINGIANGLEPROC>(loadProc("EGL_QueryStringiANGLE"));
EGL_GetSyncValuesCHROMIUM = EGL_GetSyncValuesCHROMIUM =

Просмотреть файл

@ -74,6 +74,7 @@ extern PFNEGLPROGRAMCACHERESIZEANGLEPROC EGL_ProgramCacheResizeANGLE;
extern PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointerANGLE; extern PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointerANGLE;
extern PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC EGL_CreateStreamProducerD3DTextureANGLE; extern PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC EGL_CreateStreamProducerD3DTextureANGLE;
extern PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE; extern PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE;
extern PFNEGLQUERYDISPLAYATTRIBANGLEPROC EGL_QueryDisplayAttribANGLE;
extern PFNEGLQUERYSTRINGIANGLEPROC EGL_QueryStringiANGLE; extern PFNEGLQUERYSTRINGIANGLEPROC EGL_QueryStringiANGLE;
extern PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM; extern PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM;
extern PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT; extern PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT;

Просмотреть файл

@ -415,6 +415,14 @@ EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribute
return EGL_QueryDisplayAttribEXT(dpy, attribute, value); return EGL_QueryDisplayAttribEXT(dpy, attribute, value);
} }
EGLBoolean EGLAPIENTRY eglQueryDisplayAttribANGLE(EGLDisplay dpy,
EGLint attribute,
EGLAttrib *value)
{
EnsureEGLLoaded();
return EGL_QueryDisplayAttribANGLE(dpy, attribute, value);
}
EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT(EGLDeviceEXT device, EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT(EGLDeviceEXT device,
EGLint attribute, EGLint attribute,
EGLAttrib *value) EGLAttrib *value)

Просмотреть файл

@ -355,37 +355,35 @@ EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribEXT(EGLDisplay dpy, EGLint attribut
EVENT("(EGLDisplay dpy = 0x%016" PRIxPTR EVENT("(EGLDisplay dpy = 0x%016" PRIxPTR
", EGLint attribute = %d, EGLAttrib *value = 0x%016" PRIxPTR ")", ", EGLint attribute = %d, EGLAttrib *value = 0x%016" PRIxPTR ")",
(uintptr_t)dpy, attribute, (uintptr_t)value); (uintptr_t)dpy, attribute, (uintptr_t)value);
Thread *thread = egl::GetCurrentThread();
egl::Display *display = static_cast<egl::Display *>(dpy); egl::Display *display = static_cast<egl::Display *>(dpy);
Thread *thread = egl::GetCurrentThread();
Error error = ValidateDisplay(display); ANGLE_EGL_TRY_RETURN(thread, ValidateQueryDisplayAttribEXT(display, attribute),
if (error.isError()) "eglQueryDisplayAttribEXT", GetDisplayIfValid(display), EGL_FALSE);
{
thread->setError(error, GetDebug(), "eglQueryDisplayAttribEXT", GetDisplayIfValid(display));
return EGL_FALSE;
}
if (!display->getExtensions().deviceQuery) *value = display->queryAttrib(attribute);
{ thread->setSuccess();
thread->setError(EglBadAccess(), GetDebug(), "eglQueryDisplayAttribEXT", return EGL_TRUE;
GetDisplayIfValid(display)); }
return EGL_FALSE;
}
// validate the attribute parameter // EGL_ANGLE_workaround_control
switch (attribute) EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribANGLE(EGLDisplay dpy,
{ EGLint attribute,
case EGL_DEVICE_EXT: EGLAttrib *value)
*value = reinterpret_cast<EGLAttrib>(display->getDevice()); {
break; ANGLE_SCOPED_GLOBAL_LOCK();
EVENT("(EGLDisplay dpy = 0x%016" PRIxPTR
", EGLint attribute = %d, EGLAttrib *value = 0x%016" PRIxPTR ")",
(uintptr_t)dpy, attribute, (uintptr_t)value);
default: egl::Display *display = static_cast<egl::Display *>(dpy);
thread->setError(EglBadAttribute(), GetDebug(), "eglQueryDisplayAttribEXT", Thread *thread = egl::GetCurrentThread();
GetDisplayIfValid(display));
return EGL_FALSE;
}
ANGLE_EGL_TRY_RETURN(thread, ValidateQueryDisplayAttribANGLE(display, attribute),
"eglQueryDisplayAttribANGLE", GetDisplayIfValid(display), EGL_FALSE);
*value = display->queryAttrib(attribute);
thread->setSuccess(); thread->setSuccess();
return EGL_TRUE; return EGL_TRUE;
} }

Просмотреть файл

@ -46,6 +46,13 @@ ANGLE_EXPORT EGLSurface EGLAPIENTRY EGL_CreatePlatformPixmapSurfaceEXT(EGLDispla
ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribEXT(EGLDisplay dpy, ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribEXT(EGLDisplay dpy,
EGLint attribute, EGLint attribute,
EGLAttrib *value); EGLAttrib *value);
// EGL_ANGLE_workaround_control
ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_QueryDisplayAttribANGLE(EGLDisplay dpy,
EGLint attribute,
EGLAttrib *value);
// EGL_EXT_device_query
ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_QueryDeviceAttribEXT(EGLDeviceEXT device, ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_QueryDeviceAttribEXT(EGLDeviceEXT device,
EGLint attribute, EGLint attribute,
EGLAttrib *value); EGLAttrib *value);
@ -198,6 +205,7 @@ ANGLE_EXPORT EGLBoolean EGLAPIENTRY EGL_GetFrameTimestampsANDROID(EGLDisplay dpy
const EGLint *timestamps, const EGLint *timestamps,
EGLnsecsANDROID *values); EGLnsecsANDROID *values);
// EGL_ANGLE_workaround_control
ANGLE_EXPORT const char *EGLAPIENTRY EGL_QueryStringiANGLE(EGLDisplay dpy, ANGLE_EXPORT const char *EGLAPIENTRY EGL_QueryStringiANGLE(EGLDisplay dpy,
EGLint name, EGLint name,
EGLint index); EGLint index);

Просмотреть файл

@ -1490,6 +1490,7 @@ EXPORTS
EGL_StreamPostD3DTextureANGLE EGL_StreamPostD3DTextureANGLE
; EGL_ANGLE_workaround_control ; EGL_ANGLE_workaround_control
EGL_QueryDisplayAttribANGLE
EGL_QueryStringiANGLE EGL_QueryStringiANGLE
; EGL_CHROMIUM_get_sync_values ; EGL_CHROMIUM_get_sync_values

Просмотреть файл

@ -89,6 +89,7 @@ ProcEntry g_procTable[] = {
{"eglQueryDebugKHR", P(EGL_QueryDebugKHR)}, {"eglQueryDebugKHR", P(EGL_QueryDebugKHR)},
{"eglQueryDeviceAttribEXT", P(EGL_QueryDeviceAttribEXT)}, {"eglQueryDeviceAttribEXT", P(EGL_QueryDeviceAttribEXT)},
{"eglQueryDeviceStringEXT", P(EGL_QueryDeviceStringEXT)}, {"eglQueryDeviceStringEXT", P(EGL_QueryDeviceStringEXT)},
{"eglQueryDisplayAttribANGLE", P(EGL_QueryDisplayAttribANGLE)},
{"eglQueryDisplayAttribEXT", P(EGL_QueryDisplayAttribEXT)}, {"eglQueryDisplayAttribEXT", P(EGL_QueryDisplayAttribEXT)},
{"eglQueryStreamKHR", P(EGL_QueryStreamKHR)}, {"eglQueryStreamKHR", P(EGL_QueryStreamKHR)},
{"eglQueryStreamu64KHR", P(EGL_QueryStreamu64KHR)}, {"eglQueryStreamu64KHR", P(EGL_QueryStreamu64KHR)},
@ -1419,5 +1420,5 @@ ProcEntry g_procTable[] = {
{"glWeightPointerOES", P(gl::WeightPointerOES)}, {"glWeightPointerOES", P(gl::WeightPointerOES)},
{"glWeightPointerOESContextANGLE", P(gl::WeightPointerOESContextANGLE)}}; {"glWeightPointerOESContextANGLE", P(gl::WeightPointerOESContextANGLE)}};
size_t g_numProcs = 1333; size_t g_numProcs = 1334;
} // namespace egl } // namespace egl

Просмотреть файл

@ -1002,6 +1002,7 @@
"glLoseContextCHROMIUM" "glLoseContextCHROMIUM"
], ],
"EGL_ANGLE_workaround_control": [ "EGL_ANGLE_workaround_control": [
"eglQueryStringiANGLE" "eglQueryStringiANGLE",
"eglQueryDisplayAttribANGLE"
] ]
} }

Просмотреть файл

@ -3,7 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
angle_white_box_tests_sources = [ angle_white_box_tests_sources = [
"egl_tests/EGLQueryStringIndexedTest.cpp", "egl_tests/EGLWorkaroundControlTest.cpp",
"util_tests/PrintSystemInfoTest.cpp", "util_tests/PrintSystemInfoTest.cpp",
"test_utils/angle_test_configs.cpp", "test_utils/angle_test_configs.cpp",
"test_utils/angle_test_configs.h", "test_utils/angle_test_configs.h",

Просмотреть файл

@ -3,8 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
// Tests the eglQueryStringiANGLE function exposed by the extension // Tests the eglQueryStringiANGLE and eglQueryDisplayAttribANGLE functions exposed by the
// EGL_ANGLE_workaround_control. // extension EGL_ANGLE_workaround_control.
#include <gtest/gtest.h> #include <gtest/gtest.h>
@ -13,7 +13,7 @@
using namespace angle; using namespace angle;
class EGLQueryStringIndexedTest : public ANGLETest class EGLWorkaroundControlTest : public ANGLETest
{ {
public: public:
void testSetUp() override void testSetUp() override
@ -26,14 +26,14 @@ class EGLQueryStringIndexedTest : public ANGLETest
}; };
// Ensure eglQueryStringiANGLE generates EGL_BAD_DISPLAY if the display passed in is invalid. // Ensure eglQueryStringiANGLE generates EGL_BAD_DISPLAY if the display passed in is invalid.
TEST_P(EGLQueryStringIndexedTest, InvalidDisplay) TEST_P(EGLWorkaroundControlTest, InvalidDisplay)
{ {
EXPECT_EQ(nullptr, eglQueryStringiANGLE(EGL_NO_DISPLAY, EGL_WORKAROUND_NAME_ANGLE, 0)); EXPECT_EQ(nullptr, eglQueryStringiANGLE(EGL_NO_DISPLAY, EGL_WORKAROUND_NAME_ANGLE, 0));
EXPECT_EGL_ERROR(EGL_BAD_DISPLAY); EXPECT_EGL_ERROR(EGL_BAD_DISPLAY);
} }
// Ensure eglQueryStringiANGLE generates EGL_BAD_PARAMETER if the index is negative. // Ensure eglQueryStringiANGLE generates EGL_BAD_PARAMETER if the index is negative.
TEST_P(EGLQueryStringIndexedTest, NegativeIndex) TEST_P(EGLWorkaroundControlTest, NegativeIndex)
{ {
EXPECT_EQ(nullptr, EXPECT_EQ(nullptr,
eglQueryStringiANGLE(getEGLWindow()->getDisplay(), EGL_WORKAROUND_NAME_ANGLE, -1)); eglQueryStringiANGLE(getEGLWindow()->getDisplay(), EGL_WORKAROUND_NAME_ANGLE, -1));
@ -41,7 +41,7 @@ TEST_P(EGLQueryStringIndexedTest, NegativeIndex)
} }
// Ensure eglQueryStringiANGLE generates EGL_BAD_PARAMETER if the index is out of bounds. // Ensure eglQueryStringiANGLE generates EGL_BAD_PARAMETER if the index is out of bounds.
TEST_P(EGLQueryStringIndexedTest, IndexOutOfBounds) TEST_P(EGLWorkaroundControlTest, IndexOutOfBounds)
{ {
EGLDisplay dpy = getEGLWindow()->getDisplay(); EGLDisplay dpy = getEGLWindow()->getDisplay();
egl::Display *display = static_cast<egl::Display *>(dpy); egl::Display *display = static_cast<egl::Display *>(dpy);
@ -52,7 +52,7 @@ TEST_P(EGLQueryStringIndexedTest, IndexOutOfBounds)
// Ensure eglQueryStringiANGLE generates EGL_BAD_PARAMETER if the name is not one of the valid // Ensure eglQueryStringiANGLE generates EGL_BAD_PARAMETER if the name is not one of the valid
// options specified in the workaround. // options specified in the workaround.
TEST_P(EGLQueryStringIndexedTest, InvalidName) TEST_P(EGLWorkaroundControlTest, InvalidName)
{ {
EXPECT_EQ(nullptr, eglQueryStringiANGLE(getEGLWindow()->getDisplay(), 100, 0)); EXPECT_EQ(nullptr, eglQueryStringiANGLE(getEGLWindow()->getDisplay(), 100, 0));
EXPECT_EGL_ERROR(EGL_BAD_PARAMETER); EXPECT_EGL_ERROR(EGL_BAD_PARAMETER);
@ -61,7 +61,7 @@ TEST_P(EGLQueryStringIndexedTest, InvalidName)
// For each valid name and index in the workaround description arrays, query the values and ensure // For each valid name and index in the workaround description arrays, query the values and ensure
// that no error is generated, and that the values match the correct values frim ANGLE's display's // that no error is generated, and that the values match the correct values frim ANGLE's display's
// FeatureList. // FeatureList.
TEST_P(EGLQueryStringIndexedTest, QueryAll) TEST_P(EGLWorkaroundControlTest, QueryAll)
{ {
EGLDisplay dpy = getEGLWindow()->getDisplay(); EGLDisplay dpy = getEGLWindow()->getDisplay();
egl::Display *display = static_cast<egl::Display *>(dpy); egl::Display *display = static_cast<egl::Display *>(dpy);
@ -86,7 +86,20 @@ TEST_P(EGLQueryStringIndexedTest, QueryAll)
} }
} }
ANGLE_INSTANTIATE_TEST(EGLQueryStringIndexedTest, // Ensure eglQueryDisplayAttribANGLE returns the correct number of workarounds when queried with
// attribute EGL_WORKAROUND_COUNT_ANGLE
TEST_P(EGLWorkaroundControlTest, WorkaroundCount)
{
EGLDisplay dpy = getEGLWindow()->getDisplay();
egl::Display *display = static_cast<egl::Display *>(dpy);
EGLAttrib value = -1;
EXPECT_EQ(static_cast<EGLBoolean>(EGL_TRUE),
eglQueryDisplayAttribANGLE(dpy, EGL_WORKAROUND_COUNT_ANGLE, &value));
EXPECT_EQ(display->getFeatures().size(), static_cast<size_t>(value));
ASSERT_EGL_SUCCESS();
}
ANGLE_INSTANTIATE_TEST(EGLWorkaroundControlTest,
ES2_D3D9(), ES2_D3D9(),
ES2_D3D11(), ES2_D3D11(),
ES2_OPENGL(), ES2_OPENGL(),

Просмотреть файл

@ -72,6 +72,7 @@ ANGLE_UTIL_EXPORT PFNEGLQUERYSURFACEPOINTERANGLEPROC eglQuerySurfacePointerANGLE
ANGLE_UTIL_EXPORT PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC ANGLE_UTIL_EXPORT PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC
eglCreateStreamProducerD3DTextureANGLE; eglCreateStreamProducerD3DTextureANGLE;
ANGLE_UTIL_EXPORT PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC eglStreamPostD3DTextureANGLE; ANGLE_UTIL_EXPORT PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC eglStreamPostD3DTextureANGLE;
ANGLE_UTIL_EXPORT PFNEGLQUERYDISPLAYATTRIBANGLEPROC eglQueryDisplayAttribANGLE;
ANGLE_UTIL_EXPORT PFNEGLQUERYSTRINGIANGLEPROC eglQueryStringiANGLE; ANGLE_UTIL_EXPORT PFNEGLQUERYSTRINGIANGLEPROC eglQueryStringiANGLE;
ANGLE_UTIL_EXPORT PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM; ANGLE_UTIL_EXPORT PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM;
ANGLE_UTIL_EXPORT PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT; ANGLE_UTIL_EXPORT PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT;
@ -199,6 +200,8 @@ void LoadEGL(LoadProc loadProc)
loadProc("eglCreateStreamProducerD3DTextureANGLE")); loadProc("eglCreateStreamProducerD3DTextureANGLE"));
eglStreamPostD3DTextureANGLE = reinterpret_cast<PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC>( eglStreamPostD3DTextureANGLE = reinterpret_cast<PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC>(
loadProc("eglStreamPostD3DTextureANGLE")); loadProc("eglStreamPostD3DTextureANGLE"));
eglQueryDisplayAttribANGLE =
reinterpret_cast<PFNEGLQUERYDISPLAYATTRIBANGLEPROC>(loadProc("eglQueryDisplayAttribANGLE"));
eglQueryStringiANGLE = eglQueryStringiANGLE =
reinterpret_cast<PFNEGLQUERYSTRINGIANGLEPROC>(loadProc("eglQueryStringiANGLE")); reinterpret_cast<PFNEGLQUERYSTRINGIANGLEPROC>(loadProc("eglQueryStringiANGLE"));
eglGetSyncValuesCHROMIUM = eglGetSyncValuesCHROMIUM =

Просмотреть файл

@ -79,6 +79,7 @@ ANGLE_UTIL_EXPORT extern PFNEGLQUERYSURFACEPOINTERANGLEPROC eglQuerySurfacePoint
ANGLE_UTIL_EXPORT extern PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC ANGLE_UTIL_EXPORT extern PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC
eglCreateStreamProducerD3DTextureANGLE; eglCreateStreamProducerD3DTextureANGLE;
ANGLE_UTIL_EXPORT extern PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC eglStreamPostD3DTextureANGLE; ANGLE_UTIL_EXPORT extern PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC eglStreamPostD3DTextureANGLE;
ANGLE_UTIL_EXPORT extern PFNEGLQUERYDISPLAYATTRIBANGLEPROC eglQueryDisplayAttribANGLE;
ANGLE_UTIL_EXPORT extern PFNEGLQUERYSTRINGIANGLEPROC eglQueryStringiANGLE; ANGLE_UTIL_EXPORT extern PFNEGLQUERYSTRINGIANGLEPROC eglQueryStringiANGLE;
ANGLE_UTIL_EXPORT extern PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM; ANGLE_UTIL_EXPORT extern PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM;
ANGLE_UTIL_EXPORT extern PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT; ANGLE_UTIL_EXPORT extern PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT;