Hash :
df0203a9
Author :
Date :
2020-01-15T14:05:33
EGL: Add support for EGL_EXT_pixel_format_float extension
Add support for floating point configs. On backends that
support rendering to floating point formats, add them to
EGL's frambuffer config list
Bug: angleproject:3958
Tests: dEQP-EGL.functional.wide_color.*fp16*
angle_end2end_tests --gtest_filter=EGLFloatSurfaceTest*
Change-Id: Ie65f63013483267985c2b308567bf5025acf750e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1993686
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
//
// Copyright 2016 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.
//
// WindowSurfaceEGL.h: EGL implementation of egl::Surface for windows
#include "libANGLE/renderer/gl/egl/WindowSurfaceEGL.h"
#include "libANGLE/Surface.h"
#include "libANGLE/renderer/gl/egl/egl_utils.h"
namespace rx
{
WindowSurfaceEGL::WindowSurfaceEGL(const egl::SurfaceState &state,
const FunctionsEGL *egl,
EGLConfig config,
EGLNativeWindowType window)
: SurfaceEGL(state, egl, config), mWindow(window)
{}
WindowSurfaceEGL::~WindowSurfaceEGL() {}
egl::Error WindowSurfaceEGL::initialize(const egl::Display *display)
{
constexpr EGLint kForwardedWindowSurfaceAttributes[] = {
EGL_RENDER_BUFFER, EGL_POST_SUB_BUFFER_SUPPORTED_NV, EGL_GL_COLORSPACE,
EGL_COLOR_COMPONENT_TYPE_EXT};
native_egl::AttributeVector nativeAttribs =
native_egl::TrimAttributeMap(mState.attributes, kForwardedWindowSurfaceAttributes);
native_egl::FinalizeAttributeVector(&nativeAttribs);
mSurface = mEGL->createWindowSurface(mConfig, mWindow, nativeAttribs.data());
if (mSurface == EGL_NO_SURFACE)
{
return egl::Error(mEGL->getError(), "eglCreateWindowSurface failed");
}
return egl::NoError();
}
} // namespace rx