This CL adds two new extensions:

 * EGL_ANGLE_ggp_stream_descriptor:
    Introduces a new attribute to CreateWindowSurface. Allows the app
    to pass in a stream descriptor to VkCreateSurfaceKHR.
    Mirrors VK_GGP_stream_descriptor_surface.

 * EGL_ANGLE_swap_with_frame_token:
    Introduces a new function 'eglSwapBuffersWithFrameTokenANGLE'. This
    allows the app to pass a GGP frame token down to vkQueuePresentKHR.
    Mirrors VK_GGP_frame_token.

Bug: angleproject:4078
Change-Id: I4313ac4c264e68999905049f661bc64b44f72fab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897315
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
This commit is contained in:
Jamie Madill 2019-11-04 15:20:18 -05:00 коммит произвёл Commit Bot
Родитель 71b0f0b588
Коммит c898ec1a5e
43 изменённых файлов: 560 добавлений и 26 удалений

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

@ -0,0 +1,73 @@
Name
ANGLE_ggp_stream_descriptor
Name Strings
EGL_ANGLE_ggp_stream_descriptor
Contributors
Jamie Madill
Contacts
Jamie Madill, Google Inc. (jmadill 'at' google.com)
Status
Draft
Version
Version 1, November 3, 2019
Number
EGL Extension #??
Dependencies
This extension is written against the wording of the EGL 1.5
Specification.
Overview
This extension allows initializing an EGL Window surface backed by a
VkSurfaceKHR with a Google Games Platform GgpStreamDescriptor.
It is based on the Vulkan extension VK_GGP_stream_descriptor_surface.
New Types
None
New Procedures and Functions
None
New Tokens
Accepted as an attribute name in the <attrib_list> argument to
eglCreateSurfaceKHR:
EGL_GGP_STREAM_DESCRIPTOR_ANGLE 0x348B
Additions to the EGL 1.5 Specification
Add the following to section 3.5.1 "Creating On-Screen Rendering Surfaces":
EGL_GGP_STREAM_DESCRIPTOR_ANGLE indicates a GgpStreamDescriptor referring
to the GGP stream descriptor to associate with the surface. If
EGL_GGP_STREAM_DESCRIPTOR_ANGLE is not specified a default stream
descriptor will be used.
Issues
None yet.
Revision History
Rev. Date Author Changes
---- ------------- --------- ----------------------------------------
1 Nov 3, 2019 jmadill Initial version

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

@ -0,0 +1,83 @@
Name
ANGLE_swap_with_frame_token
Name Strings
EGL_ANGLE_swap_with_frame_token
Contributors
Jamie Madill
Contacts
Jamie Madill, Google Inc. (jmadill 'at' google.com)
Status
Draft
Version
Version 1, November 3, 2019
Number
EGL Extension #??
Dependencies
This extension is written against the wording of the EGL 1.5
Specification.
Overview
This extension allows an application that uses a Google Games
Platform surface to associate a Google Games Platform frame token
with an eglSwapBuffers operation.
It is based on the Vulkan extension VK_GGP_frame_token.
New Types
This is a 64-bit unsigned type that represents a GGP frame token.
typedef khronos_uint64_t EGLFrameTokenANGLE;
New Procedures and Functions
EGLBoolean eglSwapBuffersWithFrameTokenANGLE(
EGLDisplay dpy,
EGLSurface surface,
EGLFrameTokenANGLE frametoken);
New Tokens
None
Additions to the EGL 1.5 Specification
Add the following to section 3.10.1 "Posting to a Window":
A Google Games Platform frame token can be specified when posting a color
buffer to a window by calling
EGLBoolean eglSwapBuffersWithFrameTokenANGLE(
EGLDisplay dpy,
EGLSurface surface,
EGLFrameTokenANGLE frametoken);
The behaviour of eglSwapBuffersWithFrameTokenANGLE is identical to that
of eglSwapBuffers except that the behaviour is undefined when <frametoken>
is not a valid GgpFrameToken.
Issues
None yet.
Revision History
Rev. Date Author Changes
---- ------------- --------- ----------------------------------------
1 Nov 3, 2019 jmadill Initial version

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

@ -4,6 +4,10 @@
import("//build_overrides/angle.gni") import("//build_overrides/angle.gni")
declare_args() {
is_ggp = false
}
if (angle_has_build) { if (angle_has_build) {
import("//build/config/dcheck_always_on.gni") import("//build/config/dcheck_always_on.gni")
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")

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

@ -259,6 +259,20 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribANGLE(EGLDisplay dpy, EGLint
#define EGL_CGL_PIXEL_FORMAT_ANGLE 0x3486 #define EGL_CGL_PIXEL_FORMAT_ANGLE 0x3486
#endif #endif
#ifndef EGL_ANGLE_ggp_stream_descriptor
#define EGL_ANGLE_ggp_stream_descriptor 1
#define EGL_GGP_STREAM_DESCRIPTOR_ANGLE 0x348B
#endif /* EGL_ANGLE_ggp_stream_descriptor */
#ifndef EGL_ANGLE_swap_with_frame_token
#define EGL_ANGLE_swap_with_frame_token 1
typedef khronos_uint64_t EGLFrameTokenANGLE;
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHFRAMETOKENANGLEPROC)(EGLDisplay dpy, EGLSurface surface, EGLFrameTokenANGLE frametoken);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLBoolean EGLAPIENTRY eglSwapBuffersWithFrameTokenANGLE(EGLDisplay dpy, EGLSurface surface, EGLFrameTokenANGLE frametoken);
#endif
#endif /* EGL_ANGLE_swap_with_frame_token */
// clang-format on // clang-format on
#endif // INCLUDE_EGL_EGLEXT_ANGLE_ #endif // INCLUDE_EGL_EGLEXT_ANGLE_

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

@ -116,6 +116,12 @@ typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativePixmapType; typedef intptr_t EGLNativePixmapType;
typedef intptr_t EGLNativeWindowType; typedef intptr_t EGLNativeWindowType;
#elif defined(__ggp__)
typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativePixmapType;
typedef intptr_t EGLNativeWindowType;
#elif defined(__unix__) || defined(USE_X11) #elif defined(__unix__) || defined(USE_X11)
/* X11 (tentative) */ /* X11 (tentative) */

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

@ -2,21 +2,21 @@
"scripts/egl.xml": "scripts/egl.xml":
"842e24514c4cfe09fba703c17a0fd292", "842e24514c4cfe09fba703c17a0fd292",
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
"fc2e249239fb1365f6d145cdf1a3cfcf", "24d4348e6c064b6837f46c955cc219a8",
"scripts/generate_loader.py": "scripts/generate_loader.py":
"48c60c668bec42a80378179aae2acc61", "48c60c668bec42a80378179aae2acc61",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"fad2f8068a585ee2e6a66dd604fe93e1", "f5fe888247ca4da9df81266a0123f7de",
"scripts/wgl.xml": "scripts/wgl.xml":
"aa96419c582af2f6673430e2847693f4", "aa96419c582af2f6673430e2847693f4",
"src/libEGL/egl_loader_autogen.cpp": "src/libEGL/egl_loader_autogen.cpp":
"01d20878ff5644bb9ee9e22ec95c3587", "83b3307f377e3ead495cdb9eb53460ab",
"src/libEGL/egl_loader_autogen.h": "src/libEGL/egl_loader_autogen.h":
"a9d4b21e3a74565a6710c76c4f3bcbdc", "5504e375372f2f116fc8c192753a923f",
"util/egl_loader_autogen.cpp": "util/egl_loader_autogen.cpp":
"b9a444da4142a12a9fe6b7a9d33a4ea8", "22c6cdfa133c449e3b046075254841c5",
"util/egl_loader_autogen.h": "util/egl_loader_autogen.h":
"bc2c62ff42604977ac2240591ee8ba6a", "6349dd7847bd72466919816befb6841d",
"util/gles_loader_autogen.cpp": "util/gles_loader_autogen.cpp":
"8f5e1cd93093e54d3287609680cae33c", "8f5e1cd93093e54d3287609680cae33c",
"util/gles_loader_autogen.h": "util/gles_loader_autogen.h":

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

@ -2,7 +2,7 @@
"scripts/egl.xml": "scripts/egl.xml":
"842e24514c4cfe09fba703c17a0fd292", "842e24514c4cfe09fba703c17a0fd292",
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
"fc2e249239fb1365f6d145cdf1a3cfcf", "24d4348e6c064b6837f46c955cc219a8",
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"3b72a1d43df45cf53784b2a0002b93e5", "3b72a1d43df45cf53784b2a0002b93e5",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
@ -12,7 +12,7 @@
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"d6907cd84d95ac0b32a164194eadcf53", "d6907cd84d95ac0b32a164194eadcf53",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"fad2f8068a585ee2e6a66dd604fe93e1", "f5fe888247ca4da9df81266a0123f7de",
"scripts/wgl.xml": "scripts/wgl.xml":
"aa96419c582af2f6673430e2847693f4", "aa96419c582af2f6673430e2847693f4",
"src/libANGLE/Context_gl_1_0_autogen.h": "src/libANGLE/Context_gl_1_0_autogen.h":
@ -256,9 +256,9 @@
"src/libGLESv2/libGLESv2_autogen.cpp": "src/libGLESv2/libGLESv2_autogen.cpp":
"7b0682a27fa050660b54ae73063f3b2d", "7b0682a27fa050660b54ae73063f3b2d",
"src/libGLESv2/libGLESv2_autogen.def": "src/libGLESv2/libGLESv2_autogen.def":
"567d8736cd2b27581fffe17fa9e3a60f", "cfa8370ea276c98b9bb3752bf75cb5d8",
"src/libGLESv2/libGLESv2_no_capture_autogen.def": "src/libGLESv2/libGLESv2_no_capture_autogen.def":
"436bb9ba6826889ce7b61daf4c3faa03", "a932f323fa7cfc13b4099f1741b5dc65",
"src/libGLESv2/libGLESv2_with_capture_autogen.def": "src/libGLESv2/libGLESv2_with_capture_autogen.def":
"6d440d92cb9aedb3fee6b18610d86742" "bd52aea6901faff81f0b0cb5f706528b"
} }

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

@ -6,7 +6,7 @@
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"d6907cd84d95ac0b32a164194eadcf53", "d6907cd84d95ac0b32a164194eadcf53",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"fad2f8068a585ee2e6a66dd604fe93e1", "f5fe888247ca4da9df81266a0123f7de",
"src/libANGLE/gl_enum_utils_autogen.cpp": "src/libANGLE/gl_enum_utils_autogen.cpp":
"3178466fb9ef26a3349fe59a76295dc3", "3178466fb9ef26a3349fe59a76295dc3",
"src/libANGLE/gl_enum_utils_autogen.h": "src/libANGLE/gl_enum_utils_autogen.h":

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

@ -2,7 +2,7 @@
"scripts/egl.xml": "scripts/egl.xml":
"842e24514c4cfe09fba703c17a0fd292", "842e24514c4cfe09fba703c17a0fd292",
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
"fc2e249239fb1365f6d145cdf1a3cfcf", "24d4348e6c064b6837f46c955cc219a8",
"scripts/gen_proc_table.py": "scripts/gen_proc_table.py":
"24dbcc78fd3f000f58ca98237ccc0da4", "24dbcc78fd3f000f58ca98237ccc0da4",
"scripts/gl.xml": "scripts/gl.xml":
@ -10,11 +10,11 @@
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"d6907cd84d95ac0b32a164194eadcf53", "d6907cd84d95ac0b32a164194eadcf53",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"fad2f8068a585ee2e6a66dd604fe93e1", "f5fe888247ca4da9df81266a0123f7de",
"scripts/wgl.xml": "scripts/wgl.xml":
"aa96419c582af2f6673430e2847693f4", "aa96419c582af2f6673430e2847693f4",
"src/libGL/proc_table_wgl_autogen.cpp": "src/libGL/proc_table_wgl_autogen.cpp":
"6844abf06aa6fb7a26878acb0d69df07", "6844abf06aa6fb7a26878acb0d69df07",
"src/libGLESv2/proc_table_egl_autogen.cpp": "src/libGLESv2/proc_table_egl_autogen.cpp":
"e03b5d92d618b83b37036c5af16fc0cd" "24f519e153ade8e0fdc3bff3ae05954d"
} }

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

@ -81,6 +81,12 @@
<param><ptype>EGLint</ptype> <name>attribute</name></param> <param><ptype>EGLint</ptype> <name>attribute</name></param>
<param><ptype>EGLAttrib *</ptype> <name>value</name></param> <param><ptype>EGLAttrib *</ptype> <name>value</name></param>
</command> </command>
<command>
<proto><pytpe>EGLBoolean</pytpe> <name>eglSwapBuffersWithFrameTokenANGLE</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param><ptype>EGLSurface</ptype> <name>surface</name></param>
<param><ptype>EGLFrameTokenANGLE</ptype> <name>frametoken</name></param>
</command>
</commands> </commands>
<!-- SECTION: ANGLE extension interface definitions --> <!-- SECTION: ANGLE extension interface definitions -->
<extensions> <extensions>
@ -115,5 +121,10 @@
<command name="eglProgramCacheResizeANGLE"/> <command name="eglProgramCacheResizeANGLE"/>
</require> </require>
</extension> </extension>
<extension name="EGL_ANGLE_swap_with_frame_token" supported="egl">
<require>
<command name="eglSwapBuffersWithFrameTokenANGLE"/>
</require>
</extension>
</extensions> </extensions>
</registry> </registry>

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

@ -190,6 +190,7 @@ IGNORED_INCLUDES = {
b'libANGLE/renderer/null/DisplayNULL.h', b'libANGLE/renderer/null/DisplayNULL.h',
b'libANGLE/renderer/vulkan/android/DisplayVkAndroid.h', b'libANGLE/renderer/vulkan/android/DisplayVkAndroid.h',
b'libANGLE/renderer/vulkan/fuchsia/DisplayVkFuchsia.h', b'libANGLE/renderer/vulkan/fuchsia/DisplayVkFuchsia.h',
b'libANGLE/renderer/vulkan/ggp/DisplayVkGGP.h',
b'libANGLE/renderer/vulkan/win32/DisplayVkWin32.h', b'libANGLE/renderer/vulkan/win32/DisplayVkWin32.h',
b'libANGLE/renderer/vulkan/xcb/DisplayVkXcb.h', b'libANGLE/renderer/vulkan/xcb/DisplayVkXcb.h',
b'kernel/image.h', b'kernel/image.h',

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

@ -102,10 +102,12 @@ supported_egl_extensions = [
"EGL_ANGLE_device_creation", "EGL_ANGLE_device_creation",
"EGL_ANGLE_device_d3d", "EGL_ANGLE_device_d3d",
"EGL_ANGLE_feature_control", "EGL_ANGLE_feature_control",
"EGL_ANGLE_ggp_stream_descriptor",
"EGL_ANGLE_program_cache_control", "EGL_ANGLE_program_cache_control",
"EGL_ANGLE_query_surface_pointer", "EGL_ANGLE_query_surface_pointer",
"EGL_ANGLE_stream_producer_d3d_texture", "EGL_ANGLE_stream_producer_d3d_texture",
"EGL_ANGLE_surface_d3d_texture_2d_share_handle", "EGL_ANGLE_surface_d3d_texture_2d_share_handle",
"EGL_ANGLE_swap_with_frame_token",
"EGL_ANGLE_window_fixed_size", "EGL_ANGLE_window_fixed_size",
"EGL_CHROMIUM_get_sync_values", "EGL_CHROMIUM_get_sync_values",
"EGL_EXT_create_context_robustness", "EGL_EXT_create_context_robustness",

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

@ -20,6 +20,9 @@
#elif defined(ANDROID) #elif defined(ANDROID)
# define ANGLE_PLATFORM_ANDROID 1 # define ANGLE_PLATFORM_ANDROID 1
# define ANGLE_PLATFORM_POSIX 1 # define ANGLE_PLATFORM_POSIX 1
#elif defined(__ggp__)
# define ANGLE_PLATFORM_GGP 1
# define ANGLE_PLATFORM_POSIX 1
#elif defined(__linux__) || defined(EMSCRIPTEN) #elif defined(__linux__) || defined(EMSCRIPTEN)
# define ANGLE_PLATFORM_LINUX 1 # define ANGLE_PLATFORM_LINUX 1
# define ANGLE_PLATFORM_POSIX 1 # define ANGLE_PLATFORM_POSIX 1

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

@ -944,6 +944,12 @@ struct DisplayExtensions
// EGL_KHR_no_config_context // EGL_KHR_no_config_context
bool noConfigContext = false; bool noConfigContext = false;
// EGL_ANGLE_ggp_stream_descriptor
bool ggpStreamDescriptor = false;
// EGL_ANGLE_swap_with_frame_token
bool swapWithFrameToken = false;
}; };
struct DeviceExtensions struct DeviceExtensions

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

@ -76,6 +76,8 @@
# include "libANGLE/renderer/vulkan/android/DisplayVkAndroid.h" # include "libANGLE/renderer/vulkan/android/DisplayVkAndroid.h"
# elif defined(ANGLE_PLATFORM_FUCHSIA) # elif defined(ANGLE_PLATFORM_FUCHSIA)
# include "libANGLE/renderer/vulkan/fuchsia/DisplayVkFuchsia.h" # include "libANGLE/renderer/vulkan/fuchsia/DisplayVkFuchsia.h"
# elif defined(ANGLE_PLATFORM_GGP)
# include "libANGLE/renderer/vulkan/ggp/DisplayVkGGP.h"
# else # else
# error Unsupported Vulkan platform. # error Unsupported Vulkan platform.
# endif # endif
@ -294,6 +296,8 @@ rx::DisplayImpl *CreateDisplayFromAttribs(const AttributeMap &attribMap, const D
impl = new rx::DisplayVkAndroid(state); impl = new rx::DisplayVkAndroid(state);
# elif defined(ANGLE_PLATFORM_FUCHSIA) # elif defined(ANGLE_PLATFORM_FUCHSIA)
impl = new rx::DisplayVkFuchsia(state); impl = new rx::DisplayVkFuchsia(state);
# elif defined(ANGLE_PLATFORM_GGP)
impl = new rx::DisplayVkGGP(state);
# else # else
# error Unsupported Vulkan platform. # error Unsupported Vulkan platform.
# endif # endif

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

@ -251,6 +251,15 @@ Error Surface::swapWithDamage(const gl::Context *context, EGLint *rects, EGLint
return NoError(); return NoError();
} }
Error Surface::swapWithFrameToken(const gl::Context *context, EGLFrameTokenANGLE frameToken)
{
context->getState().getOverlay()->onSwap();
ANGLE_TRY(mImplementation->swapWithFrameToken(context, frameToken));
postSwap(context);
return NoError();
}
Error Surface::postSubBuffer(const gl::Context *context, Error Surface::postSubBuffer(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,

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

@ -72,6 +72,7 @@ class Surface : public LabeledObject, public gl::FramebufferAttachmentObject
Error unMakeCurrent(const gl::Context *context); Error unMakeCurrent(const gl::Context *context);
Error swap(const gl::Context *context); Error swap(const gl::Context *context);
Error swapWithDamage(const gl::Context *context, EGLint *rects, EGLint n_rects); Error swapWithDamage(const gl::Context *context, EGLint *rects, EGLint n_rects);
Error swapWithFrameToken(const gl::Context *context, EGLFrameTokenANGLE frameToken);
Error postSubBuffer(const gl::Context *context, Error postSubBuffer(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,

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

@ -93,4 +93,10 @@ egl::Error SurfaceImpl::getFrameTimestamps(EGLuint64KHR frameId,
return egl::EglBadDisplay(); return egl::EglBadDisplay();
} }
egl::Error SurfaceImpl::swapWithFrameToken(const gl::Context *context,
EGLFrameTokenANGLE frameToken)
{
UNREACHABLE();
return egl::EglBadDisplay();
}
} // namespace rx } // namespace rx

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

@ -57,6 +57,8 @@ class SurfaceImpl : public FramebufferAttachmentObjectImpl
virtual egl::Error unMakeCurrent(const gl::Context *context); virtual egl::Error unMakeCurrent(const gl::Context *context);
virtual egl::Error swap(const gl::Context *context) = 0; virtual egl::Error swap(const gl::Context *context) = 0;
virtual egl::Error swapWithDamage(const gl::Context *context, EGLint *rects, EGLint n_rects); virtual egl::Error swapWithDamage(const gl::Context *context, EGLint *rects, EGLint n_rects);
virtual egl::Error swapWithFrameToken(const gl::Context *context,
EGLFrameTokenANGLE frameToken);
virtual egl::Error postSubBuffer(const gl::Context *context, virtual egl::Error postSubBuffer(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,

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

@ -137,6 +137,15 @@ if (is_fuchsia) {
] ]
} }
if (is_ggp) {
_vulkan_backend_sources += [
"ggp/DisplayVkGGP.cpp",
"ggp/DisplayVkGGP.h",
"ggp/WindowSurfaceVkGGP.cpp",
"ggp/WindowSurfaceVkGGP.h",
]
}
config("vulkan_config") { config("vulkan_config") {
_sws_icd = "./libvk_swiftshader_icd.json" _sws_icd = "./libvk_swiftshader_icd.json"
if (is_win) { if (is_win) {

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

@ -192,6 +192,11 @@ void DisplayVk::generateExtensions(egl::DisplayExtensions *outExtensions) const
outExtensions->surfacelessContext = true; outExtensions->surfacelessContext = true;
outExtensions->noConfigContext = true; outExtensions->noConfigContext = true;
#if defined(ANGLE_PLATFORM_GGP)
outExtensions->ggpStreamDescriptor = true;
outExtensions->swapWithFrameToken = true;
#endif // defined(ANGLE_PLATFORM_GGP)
} }
void DisplayVk::generateCaps(egl::Caps *outCaps) const void DisplayVk::generateCaps(egl::Caps *outCaps) const

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

@ -364,7 +364,8 @@ class ScopedVkLoaderEnvironment : angle::NonCopyable
// Changing CWD and setting environment variables makes no sense on Android, // Changing CWD and setting environment variables makes no sense on Android,
// since this code is a part of Java application there. // since this code is a part of Java application there.
// Android Vulkan loader doesn't need this either. // Android Vulkan loader doesn't need this either.
#if !defined(ANGLE_PLATFORM_ANDROID) && !defined(ANGLE_PLATFORM_FUCHSIA) #if !defined(ANGLE_PLATFORM_ANDROID) && !defined(ANGLE_PLATFORM_FUCHSIA) && \
!defined(ANGLE_PLATFORM_GGP)
if (icd == vk::ICD::Mock) if (icd == vk::ICD::Mock)
{ {
if (!setICDEnvironment(ANGLE_VK_MOCK_ICD_JSON)) if (!setICDEnvironment(ANGLE_VK_MOCK_ICD_JSON))

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

@ -391,7 +391,6 @@ WindowSurfaceVk::WindowSurfaceVk(const egl::SurfaceState &surfaceState, EGLNativ
: SurfaceVk(surfaceState), : SurfaceVk(surfaceState),
mNativeWindowType(window), mNativeWindowType(window),
mSurface(VK_NULL_HANDLE), mSurface(VK_NULL_HANDLE),
mInstance(VK_NULL_HANDLE),
mSwapchain(VK_NULL_HANDLE), mSwapchain(VK_NULL_HANDLE),
mSwapchainPresentMode(VK_PRESENT_MODE_FIFO_KHR), mSwapchainPresentMode(VK_PRESENT_MODE_FIFO_KHR),
mDesiredSwapchainPresentMode(VK_PRESENT_MODE_FIFO_KHR), mDesiredSwapchainPresentMode(VK_PRESENT_MODE_FIFO_KHR),
@ -954,20 +953,21 @@ egl::Error WindowSurfaceVk::swapWithDamage(const gl::Context *context,
EGLint n_rects) EGLint n_rects)
{ {
DisplayVk *displayVk = vk::GetImpl(context->getDisplay()); DisplayVk *displayVk = vk::GetImpl(context->getDisplay());
angle::Result result = swapImpl(context, rects, n_rects); angle::Result result = swapImpl(context, rects, n_rects, nullptr);
return angle::ToEGL(result, displayVk, EGL_BAD_SURFACE); return angle::ToEGL(result, displayVk, EGL_BAD_SURFACE);
} }
egl::Error WindowSurfaceVk::swap(const gl::Context *context) egl::Error WindowSurfaceVk::swap(const gl::Context *context)
{ {
DisplayVk *displayVk = vk::GetImpl(context->getDisplay()); DisplayVk *displayVk = vk::GetImpl(context->getDisplay());
angle::Result result = swapImpl(context, nullptr, 0); angle::Result result = swapImpl(context, nullptr, 0, nullptr);
return angle::ToEGL(result, displayVk, EGL_BAD_SURFACE); return angle::ToEGL(result, displayVk, EGL_BAD_SURFACE);
} }
angle::Result WindowSurfaceVk::present(ContextVk *contextVk, angle::Result WindowSurfaceVk::present(ContextVk *contextVk,
EGLint *rects, EGLint *rects,
EGLint n_rects, EGLint n_rects,
const void *pNextChain,
bool *presentOutOfDate) bool *presentOutOfDate)
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "WindowSurfaceVk::present"); ANGLE_TRACE_EVENT0("gpu.angle", "WindowSurfaceVk::present");
@ -1045,6 +1045,7 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk,
VkPresentInfoKHR presentInfo = {}; VkPresentInfoKHR presentInfo = {};
presentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; presentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
presentInfo.pNext = pNextChain;
presentInfo.waitSemaphoreCount = 1; presentInfo.waitSemaphoreCount = 1;
presentInfo.pWaitSemaphores = presentSemaphore->ptr(); presentInfo.pWaitSemaphores = presentSemaphore->ptr();
presentInfo.swapchainCount = 1; presentInfo.swapchainCount = 1;
@ -1109,7 +1110,10 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk,
return angle::Result::Continue; return angle::Result::Continue;
} }
angle::Result WindowSurfaceVk::swapImpl(const gl::Context *context, EGLint *rects, EGLint n_rects) angle::Result WindowSurfaceVk::swapImpl(const gl::Context *context,
EGLint *rects,
EGLint n_rects,
const void *pNextChain)
{ {
ANGLE_TRACE_EVENT0("gpu.angle", "WindowSurfaceVk::swapImpl"); ANGLE_TRACE_EVENT0("gpu.angle", "WindowSurfaceVk::swapImpl");
@ -1120,7 +1124,7 @@ angle::Result WindowSurfaceVk::swapImpl(const gl::Context *context, EGLint *rect
// Save this now, since present() will increment the value. // Save this now, since present() will increment the value.
uint32_t currentSwapHistoryIndex = static_cast<uint32_t>(mCurrentSwapHistoryIndex); uint32_t currentSwapHistoryIndex = static_cast<uint32_t>(mCurrentSwapHistoryIndex);
ANGLE_TRY(present(contextVk, rects, n_rects, &presentOutOfDate)); ANGLE_TRY(present(contextVk, rects, n_rects, pNextChain, &presentOutOfDate));
ANGLE_TRY(checkForOutOfDateSwapchain(contextVk, currentSwapHistoryIndex, presentOutOfDate)); ANGLE_TRY(checkForOutOfDateSwapchain(contextVk, currentSwapHistoryIndex, presentOutOfDate));

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

@ -215,9 +215,14 @@ class WindowSurfaceVk : public SurfaceVk
vk::Semaphore getAcquireImageSemaphore(); vk::Semaphore getAcquireImageSemaphore();
protected: protected:
angle::Result swapImpl(const gl::Context *context,
EGLint *rects,
EGLint n_rects,
const void *pNextChain);
EGLNativeWindowType mNativeWindowType; EGLNativeWindowType mNativeWindowType;
VkSurfaceKHR mSurface; VkSurfaceKHR mSurface;
VkInstance mInstance; VkSurfaceCapabilitiesKHR mSurfaceCaps;
private: private:
virtual angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) = 0; virtual angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) = 0;
@ -240,17 +245,15 @@ class WindowSurfaceVk : public SurfaceVk
angle::Result present(ContextVk *contextVk, angle::Result present(ContextVk *contextVk,
EGLint *rects, EGLint *rects,
EGLint n_rects, EGLint n_rects,
const void *pNextChain,
bool *presentOutOfDate); bool *presentOutOfDate);
angle::Result updateAndDrawOverlay(ContextVk *contextVk, impl::SwapchainImage *image) const; angle::Result updateAndDrawOverlay(ContextVk *contextVk, impl::SwapchainImage *image) const;
angle::Result swapImpl(const gl::Context *context, EGLint *rects, EGLint n_rects);
angle::Result newPresentSemaphore(vk::Context *context, vk::Semaphore *semaphoreOut); angle::Result newPresentSemaphore(vk::Context *context, vk::Semaphore *semaphoreOut);
bool isMultiSampled() const; bool isMultiSampled() const;
VkSurfaceCapabilitiesKHR mSurfaceCaps;
std::vector<VkPresentModeKHR> mPresentModes; std::vector<VkPresentModeKHR> mPresentModes;
VkSwapchainKHR mSwapchain; VkSwapchainKHR mSwapchain;

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

@ -0,0 +1,47 @@
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DisplayVkGGP.cpp:
// Implements the class methods for DisplayVkGGP.
//
#include "libANGLE/renderer/vulkan/ggp/DisplayVkGGP.h"
#include "libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.h"
#include "libANGLE/renderer/vulkan/vk_caps_utils.h"
namespace rx
{
DisplayVkGGP::DisplayVkGGP(const egl::DisplayState &state) : DisplayVk(state) {}
bool DisplayVkGGP::isValidNativeWindow(EGLNativeWindowType window) const
{
// GGP doesn't use window handles.
return true;
}
SurfaceImpl *DisplayVkGGP::createWindowSurfaceVk(const egl::SurfaceState &state,
EGLNativeWindowType window)
{
return new WindowSurfaceVkGGP(state, window);
}
egl::ConfigSet DisplayVkGGP::generateConfigs()
{
// Not entirely sure what backbuffer formats GGP supports.
constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX};
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this);
}
bool DisplayVkGGP::checkConfigSupport(egl::Config *config)
{
return true;
}
const char *DisplayVkGGP::getWSIExtension() const
{
return VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME;
}
} // namespace rx

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

@ -0,0 +1,34 @@
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DisplayVkGGP.h:
// Google Game Platform implementation of DisplayVk.
//
#ifndef LIBANGLE_RENDERER_VULKAN_GGP_DISPLAYVKGGP_H_
#define LIBANGLE_RENDERER_VULKAN_GGP_DISPLAYVKGGP_H_
#include "libANGLE/renderer/vulkan/DisplayVk.h"
namespace rx
{
class DisplayVkGGP : public DisplayVk
{
public:
DisplayVkGGP(const egl::DisplayState &state);
bool isValidNativeWindow(EGLNativeWindowType window) const override;
SurfaceImpl *createWindowSurfaceVk(const egl::SurfaceState &state,
EGLNativeWindowType window) override;
egl::ConfigSet generateConfigs() override;
bool checkConfigSupport(egl::Config *config) override;
const char *getWSIExtension() const override;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_GGP_DISPLAYVKGGP_H_

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

@ -0,0 +1,76 @@
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// WindowSurfaceVkGGP.cpp:
// Implements the class methods for WindowSurfaceVkGGP.
//
#include "libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.h"
#include "libANGLE/Context.h"
#include "libANGLE/Display.h"
#include "libANGLE/Surface.h"
#include "libANGLE/renderer/vulkan/DisplayVk.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
namespace rx
{
namespace
{
constexpr EGLAttrib kDefaultStreamDescriptor = static_cast<EGLAttrib>(kGgpPrimaryStreamDescriptor);
} // namespace
WindowSurfaceVkGGP::WindowSurfaceVkGGP(const egl::SurfaceState &surfaceState,
EGLNativeWindowType window)
: WindowSurfaceVk(surfaceState, window)
{}
angle::Result WindowSurfaceVkGGP::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut)
{
RendererVk *renderer = context->getRenderer();
InitGGPStreamDescriptorSurfaceFunctions(renderer->getInstance());
// Get the stream descriptor if specified. Default is kGgpPrimaryStreamDescriptor.
EGLAttrib streamDescriptor =
mState.attributes.get(EGL_GGP_STREAM_DESCRIPTOR_ANGLE, kDefaultStreamDescriptor);
VkStreamDescriptorSurfaceCreateInfoGGP createInfo = {};
createInfo.sType = VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP;
createInfo.streamDescriptor = static_cast<GgpStreamDescriptor>(streamDescriptor);
ANGLE_VK_TRY(context, vkCreateStreamDescriptorSurfaceGGP(renderer->getInstance(), &createInfo,
nullptr, &mSurface));
return getCurrentWindowSize(context, extentsOut);
}
angle::Result WindowSurfaceVkGGP::getCurrentWindowSize(vk::Context *context,
gl::Extents *extentsOut)
{
RendererVk *renderer = context->getRenderer();
const VkPhysicalDevice &physicalDevice = renderer->getPhysicalDevice();
ANGLE_VK_TRY(context, vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, mSurface,
&mSurfaceCaps));
*extentsOut =
gl::Extents(mSurfaceCaps.currentExtent.width, mSurfaceCaps.currentExtent.height, 1);
return angle::Result::Continue;
}
egl::Error WindowSurfaceVkGGP::swapWithFrameToken(const gl::Context *context,
EGLFrameTokenANGLE frameToken)
{
DisplayVk *displayVk = vk::GetImpl(context->getDisplay());
VkPresentFrameTokenGGP frameTokenData = {};
frameTokenData.sType = VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP;
frameTokenData.frameToken = static_cast<GgpFrameToken>(frameToken);
angle::Result result = swapImpl(context, nullptr, 0, &frameTokenData);
return angle::ToEGL(result, displayVk, EGL_BAD_SURFACE);
}
} // namespace rx

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

@ -0,0 +1,32 @@
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// WindowSurfaceVkGGP.h:
// Google Game Platform implementation of WindowSurfaceVk.
//
#ifndef LIBANGLE_RENDERER_VULKAN_GGP_WINDOWSURFACEVKGGP_H_
#define LIBANGLE_RENDERER_VULKAN_GGP_WINDOWSURFACEVKGGP_H_
#include "libANGLE/renderer/vulkan/SurfaceVk.h"
namespace rx
{
class WindowSurfaceVkGGP : public WindowSurfaceVk
{
public:
WindowSurfaceVkGGP(const egl::SurfaceState &surfaceState, EGLNativeWindowType window);
private:
egl::Error swapWithFrameToken(const gl::Context *context,
EGLFrameTokenANGLE frameToken) override;
angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override;
angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_GGP_WINDOWSURFACEVKGGP_H_

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

@ -624,6 +624,15 @@ void InitExternalMemoryHardwareBufferANDROIDFunctions(VkInstance instance)
} }
#endif #endif
#if defined(ANGLE_PLATFORM_GGP)
PFN_vkCreateStreamDescriptorSurfaceGGP vkCreateStreamDescriptorSurfaceGGP = nullptr;
void InitGGPStreamDescriptorSurfaceFunctions(VkInstance instance)
{
GET_FUNC(vkCreateStreamDescriptorSurfaceGGP);
}
#endif // defined(ANGLE_PLATFORM_GGP)
void InitExternalSemaphoreFdFunctions(VkInstance instance) void InitExternalSemaphoreFdFunctions(VkInstance instance)
{ {
GET_FUNC(vkImportSemaphoreFdKHR); GET_FUNC(vkImportSemaphoreFdKHR);

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

@ -640,6 +640,12 @@ extern PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBuf
void InitExternalMemoryHardwareBufferANDROIDFunctions(VkInstance instance); void InitExternalMemoryHardwareBufferANDROIDFunctions(VkInstance instance);
#endif #endif
#if defined(ANGLE_PLATFORM_GGP)
// VK_GGP_stream_descriptor_surface
extern PFN_vkCreateStreamDescriptorSurfaceGGP vkCreateStreamDescriptorSurfaceGGP;
void InitGGPStreamDescriptorSurfaceFunctions(VkInstance instance);
#endif // defined(ANGLE_PLATFORM_GGP)
void InitExternalSemaphoreFdFunctions(VkInstance instance); void InitExternalSemaphoreFdFunctions(VkInstance instance);
namespace gl_vk namespace gl_vk

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

@ -1436,6 +1436,14 @@ Error ValidateCreateWindowSurface(Display *display,
} }
break; break;
case EGL_GGP_STREAM_DESCRIPTOR_ANGLE:
if (!display->getExtensions().ggpStreamDescriptor)
{
return EglBadAttribute() << "EGL_GGP_STREAM_DESCRIPTOR_ANGLE requires "
"EGL_ANGLE_ggp_stream_descriptor.";
}
break;
default: default:
return EglBadAttribute(); return EglBadAttribute();
} }
@ -4073,4 +4081,19 @@ Error ValidateDupNativeFenceFDANDROID(const Display *display, const Sync *sync)
return NoError(); return NoError();
} }
Error ValidateSwapBuffersWithFrameTokenANGLE(const Display *display,
const Surface *surface,
EGLFrameTokenANGLE frametoken)
{
ANGLE_TRY(ValidateDisplay(display));
if (!display->getExtensions().swapWithFrameToken)
{
return EglBadDisplay() << "EGL_ANGLE_swap_buffers_with_frame_token is not available.";
}
ANGLE_TRY(ValidateSurface(display, surface));
return NoError();
}
} // namespace egl } // namespace egl

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

@ -330,6 +330,11 @@ Error ValidateGetNativeClientBufferANDROID(const struct AHardwareBuffer *buffer)
// EGL_ANDROID_native_fence_sync // EGL_ANDROID_native_fence_sync
Error ValidateDupNativeFenceFDANDROID(const Display *display, const Sync *sync); Error ValidateDupNativeFenceFDANDROID(const Display *display, const Sync *sync);
// EGL_ANGLE_swap_with_frame_token
Error ValidateSwapBuffersWithFrameTokenANGLE(const Display *display,
const Surface *surface,
EGLFrameTokenANGLE frametoken);
} // namespace egl } // namespace egl
#define ANGLE_EGL_TRY(THREAD, EXPR, FUNCNAME, LABELOBJECT) \ #define ANGLE_EGL_TRY(THREAD, EXPR, FUNCNAME, LABELOBJECT) \

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

@ -74,6 +74,7 @@ PFNEGLPROGRAMCACHERESIZEANGLEPROC EGL_ProgramCacheResizeANGLE;
PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointerANGLE; PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointerANGLE;
PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC EGL_CreateStreamProducerD3DTextureANGLE; PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC EGL_CreateStreamProducerD3DTextureANGLE;
PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE; PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE;
PFNEGLSWAPBUFFERSWITHFRAMETOKENANGLEPROC EGL_SwapBuffersWithFrameTokenANGLE;
PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM; PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM;
PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT; PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT;
PFNEGLQUERYDEVICESTRINGEXTPROC EGL_QueryDeviceStringEXT; PFNEGLQUERYDEVICESTRINGEXTPROC EGL_QueryDeviceStringEXT;
@ -206,6 +207,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_SwapBuffersWithFrameTokenANGLE = reinterpret_cast<PFNEGLSWAPBUFFERSWITHFRAMETOKENANGLEPROC>(
loadProc("EGL_SwapBuffersWithFrameTokenANGLE"));
EGL_GetSyncValuesCHROMIUM = EGL_GetSyncValuesCHROMIUM =
reinterpret_cast<PFNEGLGETSYNCVALUESCHROMIUMPROC>(loadProc("EGL_GetSyncValuesCHROMIUM")); reinterpret_cast<PFNEGLGETSYNCVALUESCHROMIUMPROC>(loadProc("EGL_GetSyncValuesCHROMIUM"));
EGL_QueryDeviceAttribEXT = EGL_QueryDeviceAttribEXT =

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

@ -82,6 +82,7 @@ ANGLE_NO_EXPORT extern PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointe
ANGLE_NO_EXPORT extern PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC ANGLE_NO_EXPORT extern PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC
EGL_CreateStreamProducerD3DTextureANGLE; EGL_CreateStreamProducerD3DTextureANGLE;
ANGLE_NO_EXPORT extern PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE; ANGLE_NO_EXPORT extern PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE;
ANGLE_NO_EXPORT extern PFNEGLSWAPBUFFERSWITHFRAMETOKENANGLEPROC EGL_SwapBuffersWithFrameTokenANGLE;
ANGLE_NO_EXPORT extern PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM; ANGLE_NO_EXPORT extern PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM;
ANGLE_NO_EXPORT extern PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT; ANGLE_NO_EXPORT extern PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT;
ANGLE_NO_EXPORT extern PFNEGLQUERYDEVICESTRINGEXTPROC EGL_QueryDeviceStringEXT; ANGLE_NO_EXPORT extern PFNEGLQUERYDEVICESTRINGEXTPROC EGL_QueryDeviceStringEXT;

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

@ -712,4 +712,11 @@ EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync)
return EGL_DupNativeFenceFDANDROID(dpy, sync); return EGL_DupNativeFenceFDANDROID(dpy, sync);
} }
EGLBoolean EGLAPIENTRY eglSwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,
EGLSurface surface,
EGLFrameTokenANGLE frametoken)
{
EnsureEGLLoaded();
return EGL_SwapBuffersWithFrameTokenANGLE(dpy, surface, frametoken);
}
} // extern "C" } // extern "C"

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

@ -1491,4 +1491,28 @@ EGLint EGLAPIENTRY EGL_DupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync)
return result; return result;
} }
EGLBoolean EGLAPIENTRY EGL_SwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,
EGLSurface surface,
EGLFrameTokenANGLE frametoken)
{
ANGLE_SCOPED_GLOBAL_LOCK();
FUNC_EVENT("EGLDisplay dpy = 0x%016" PRIxPTR ", EGLSurface surface = 0x%016" PRIxPTR
", EGLFrameTokenANGLE frametoken = 0x%llX",
(uintptr_t)dpy, (uintptr_t)surface, (unsigned long long)frametoken);
egl::Display *display = static_cast<egl::Display *>(dpy);
egl::Surface *eglSurface = static_cast<egl::Surface *>(surface);
Thread *thread = egl::GetCurrentThread();
ANGLE_EGL_TRY_RETURN(
thread, ValidateSwapBuffersWithFrameTokenANGLE(display, eglSurface, frametoken),
"eglSwapBuffersWithFrameTokenANGLE", GetDisplayIfValid(display), EGL_FALSE);
ANGLE_EGL_TRY_RETURN(thread, eglSurface->swapWithFrameToken(thread->getContext(), frametoken),
"eglSwapBuffersWithFrameTokenANGLE", GetDisplayIfValid(display),
EGL_FALSE);
thread->setSuccess();
return EGL_TRUE;
}
} // extern "C" } // extern "C"

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

@ -217,6 +217,12 @@ EGL_GetNativeClientBufferANDROID(const struct AHardwareBuffer *buffer);
// EGL_ANDROID_native_fence_sync // EGL_ANDROID_native_fence_sync
ANGLE_EXPORT EGLint EGLAPIENTRY EGL_DupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync); ANGLE_EXPORT EGLint EGLAPIENTRY EGL_DupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync);
// EGL_ANGLE_swap_with_frame_token
ANGLE_EXPORT EGLBoolean EGLAPIENTRY
EGL_SwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,
EGLSurface surface,
EGLFrameTokenANGLE frametoken);
} // extern "C" } // extern "C"
#endif // LIBGLESV2_ENTRYPOINTSEGLEXT_H_ #endif // LIBGLESV2_ENTRYPOINTSEGLEXT_H_

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

@ -1635,6 +1635,9 @@ EXPORTS
EGL_CreateStreamProducerD3DTextureANGLE EGL_CreateStreamProducerD3DTextureANGLE
EGL_StreamPostD3DTextureANGLE EGL_StreamPostD3DTextureANGLE
; EGL_ANGLE_swap_with_frame_token
EGL_SwapBuffersWithFrameTokenANGLE
; EGL_CHROMIUM_get_sync_values ; EGL_CHROMIUM_get_sync_values
EGL_GetSyncValuesCHROMIUM EGL_GetSyncValuesCHROMIUM

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

@ -1635,6 +1635,9 @@ EXPORTS
EGL_CreateStreamProducerD3DTextureANGLE EGL_CreateStreamProducerD3DTextureANGLE
EGL_StreamPostD3DTextureANGLE EGL_StreamPostD3DTextureANGLE
; EGL_ANGLE_swap_with_frame_token
EGL_SwapBuffersWithFrameTokenANGLE
; EGL_CHROMIUM_get_sync_values ; EGL_CHROMIUM_get_sync_values
EGL_GetSyncValuesCHROMIUM EGL_GetSyncValuesCHROMIUM

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

@ -1635,6 +1635,9 @@ EXPORTS
EGL_CreateStreamProducerD3DTextureANGLE EGL_CreateStreamProducerD3DTextureANGLE
EGL_StreamPostD3DTextureANGLE EGL_StreamPostD3DTextureANGLE
; EGL_ANGLE_swap_with_frame_token
EGL_SwapBuffersWithFrameTokenANGLE
; EGL_CHROMIUM_get_sync_values ; EGL_CHROMIUM_get_sync_values
EGL_GetSyncValuesCHROMIUM EGL_GetSyncValuesCHROMIUM

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

@ -115,6 +115,7 @@ ProcEntry g_procTable[] = {
{"eglSurfaceAttrib", P(EGL_SurfaceAttrib)}, {"eglSurfaceAttrib", P(EGL_SurfaceAttrib)},
{"eglSwapBuffers", P(EGL_SwapBuffers)}, {"eglSwapBuffers", P(EGL_SwapBuffers)},
{"eglSwapBuffersWithDamageKHR", P(EGL_SwapBuffersWithDamageKHR)}, {"eglSwapBuffersWithDamageKHR", P(EGL_SwapBuffersWithDamageKHR)},
{"eglSwapBuffersWithFrameTokenANGLE", P(EGL_SwapBuffersWithFrameTokenANGLE)},
{"eglSwapInterval", P(EGL_SwapInterval)}, {"eglSwapInterval", P(EGL_SwapInterval)},
{"eglTerminate", P(EGL_Terminate)}, {"eglTerminate", P(EGL_Terminate)},
{"eglWaitClient", P(EGL_WaitClient)}, {"eglWaitClient", P(EGL_WaitClient)},
@ -1519,5 +1520,5 @@ ProcEntry g_procTable[] = {
{"glWeightPointerOES", P(gl::WeightPointerOES)}, {"glWeightPointerOES", P(gl::WeightPointerOES)},
{"glWeightPointerOESContextANGLE", P(gl::WeightPointerOESContextANGLE)}}; {"glWeightPointerOESContextANGLE", P(gl::WeightPointerOESContextANGLE)}};
size_t g_numProcs = 1420; size_t g_numProcs = 1421;
} // namespace egl } // namespace egl

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

@ -76,6 +76,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 PFNEGLSWAPBUFFERSWITHFRAMETOKENANGLEPROC eglSwapBuffersWithFrameTokenANGLE;
ANGLE_UTIL_EXPORT PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM; ANGLE_UTIL_EXPORT PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM;
ANGLE_UTIL_EXPORT PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT; ANGLE_UTIL_EXPORT PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT;
ANGLE_UTIL_EXPORT PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT; ANGLE_UTIL_EXPORT PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT;
@ -210,6 +211,8 @@ void LoadEGL(LoadProc loadProc)
loadProc("eglCreateStreamProducerD3DTextureANGLE")); loadProc("eglCreateStreamProducerD3DTextureANGLE"));
eglStreamPostD3DTextureANGLE = reinterpret_cast<PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC>( eglStreamPostD3DTextureANGLE = reinterpret_cast<PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC>(
loadProc("eglStreamPostD3DTextureANGLE")); loadProc("eglStreamPostD3DTextureANGLE"));
eglSwapBuffersWithFrameTokenANGLE = reinterpret_cast<PFNEGLSWAPBUFFERSWITHFRAMETOKENANGLEPROC>(
loadProc("eglSwapBuffersWithFrameTokenANGLE"));
eglGetSyncValuesCHROMIUM = eglGetSyncValuesCHROMIUM =
reinterpret_cast<PFNEGLGETSYNCVALUESCHROMIUMPROC>(loadProc("eglGetSyncValuesCHROMIUM")); reinterpret_cast<PFNEGLGETSYNCVALUESCHROMIUMPROC>(loadProc("eglGetSyncValuesCHROMIUM"));
eglQueryDeviceAttribEXT = eglQueryDeviceAttribEXT =

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

@ -83,6 +83,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 PFNEGLSWAPBUFFERSWITHFRAMETOKENANGLEPROC eglSwapBuffersWithFrameTokenANGLE;
ANGLE_UTIL_EXPORT extern PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM; ANGLE_UTIL_EXPORT extern PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM;
ANGLE_UTIL_EXPORT extern PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT; ANGLE_UTIL_EXPORT extern PFNEGLQUERYDEVICEATTRIBEXTPROC eglQueryDeviceAttribEXT;
ANGLE_UTIL_EXPORT extern PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT; ANGLE_UTIL_EXPORT extern PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT;