Hash :
a7ae63e4
Author :
Date :
2021-05-14T21:55:52
CL: Move object cast from entry points to stubs and front end Move the OpenCl object cast from the generated entry points to the stubs and front end, to make it possible to properly use static_cast. This removes the limitation that the front end objects have to be standard layout (and makes it possible to use virtual functions), which is consistent with other front end objects. Move the back end initialization from the stubs to the entry point functions, which fixes a bug where the back ends were not initialized during validation. Move more code from the stubs to the front end, to keep the stubs light. Remove unused function `default_return_value` from `generate_entry_points.py`. Bug: angleproject:5904 Change-Id: Id999ad6c537888017bf3252c6f6e088b7d4c7984 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897245 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
//
// Copyright 2021 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.
//
// entry_points_cl_utils.h: These helpers are used in CL entry point routines.
#ifndef LIBGLESV2_ENTRY_POINTS_CL_UTILS_H_
#define LIBGLESV2_ENTRY_POINTS_CL_UTILS_H_
#include "libANGLE/Debug.h"
#include "common/PackedCLEnums_autogen.h"
#include <cstdio>
#if defined(ANGLE_ENABLE_DEBUG_TRACE)
# define CL_EVENT(entryPoint, ...) \
std::printf("CL " #entryPoint ": " __VA_ARGS__); \
std::printf("\n")
#else
# define CL_EVENT(entryPoint, ...) (void(0))
#endif
namespace cl
{
// Handling only packed enums
template <typename Enum>
constexpr auto PackParam = FromCLenum<Enum>;
void InitBackEnds(bool isIcd);
} // namespace cl
#endif // LIBGLESV2_ENTRY_POINTS_CL_UTILS_H_