Commit e25f3b10 by John Plate Committed by Commit Bot

Generate empty CL object classes

Bug: angleproject:5886 Change-Id: I01566f40e85bd7f5531536fdc1df42965622a939 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2844969Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
parent f2b47418
...@@ -56,9 +56,11 @@ if (angle_build_all) { ...@@ -56,9 +56,11 @@ if (angle_build_all) {
":translator_fuzzer", ":translator_fuzzer",
":xxhash_fuzzer", ":xxhash_fuzzer",
"$angle_root/samples:angle_samples", "$angle_root/samples:angle_samples",
"$angle_root/src/libOpenCL:angle_cl",
"$angle_root/src/tests:angle_tests", "$angle_root/src/tests:angle_tests",
] ]
if (angle_enable_cl) {
deps += [ "$angle_root/src/libOpenCL:angle_cl" ]
}
} }
} }
...@@ -265,9 +267,16 @@ config("angle_uwp_env") { ...@@ -265,9 +267,16 @@ config("angle_uwp_env") {
} }
} }
angle_source_set("cl_includes") {
sources = cl_includes
}
angle_source_set("includes") { angle_source_set("includes") {
sources = libangle_includes sources = libangle_includes
public_configs = [ ":includes_config" ] public_configs = [ ":includes_config" ]
if (angle_enable_cl) {
public_deps = [ ":cl_includes" ]
}
} }
angle_static_library("preprocessor") { angle_static_library("preprocessor") {
...@@ -725,6 +734,9 @@ config("libANGLE_config") { ...@@ -725,6 +734,9 @@ config("libANGLE_config") {
angle_source_set("libANGLE_headers") { angle_source_set("libANGLE_headers") {
sources = libangle_headers sources = libangle_headers
if (angle_enable_cl) {
sources += libangle_cl_headers
}
public_deps = [ public_deps = [
":angle_common", ":angle_common",
":angle_translator_headers", ":angle_translator_headers",
...@@ -772,6 +784,9 @@ if (is_win) { ...@@ -772,6 +784,9 @@ if (is_win) {
angle_source_set("libANGLE_base") { angle_source_set("libANGLE_base") {
sources = libangle_sources sources = libangle_sources
if (angle_enable_cl) {
sources += libangle_cl_sources
}
include_dirs = [] include_dirs = []
libs = [] libs = []
...@@ -1027,6 +1042,9 @@ set_defaults("angle_libGLESv2") { ...@@ -1027,6 +1042,9 @@ set_defaults("angle_libGLESv2") {
template("angle_libGLESv2") { template("angle_libGLESv2") {
angle_shared_library(target_name) { angle_shared_library(target_name) {
sources = libglesv2_sources + invoker.sources sources = libglesv2_sources + invoker.sources
if (angle_enable_cl) {
sources += libglesv2_cl_sources
}
if (is_win) { if (is_win) {
sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ] sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ]
...@@ -1096,6 +1114,9 @@ if (is_win && !angle_is_winuwp) { ...@@ -1096,6 +1114,9 @@ if (is_win && !angle_is_winuwp) {
angle_static_library("libGLESv2_static") { angle_static_library("libGLESv2_static") {
sources = libglesv2_sources sources = libglesv2_sources
if (angle_enable_cl) {
sources += libglesv2_cl_sources
}
configs += [ ":debug_annotations_config" ] configs += [ ":debug_annotations_config" ]
public_configs += [ ":angle_static" ] public_configs += [ ":angle_static" ]
......
...@@ -184,6 +184,11 @@ declare_args() { ...@@ -184,6 +184,11 @@ declare_args() {
angle_has_histograms = angle_has_build angle_has_histograms = angle_has_build
} }
declare_args() {
# Build OpenCL support by default.
angle_enable_cl = true
}
if (!defined(angle_zlib_compression_utils_dir)) { if (!defined(angle_zlib_compression_utils_dir)) {
angle_zlib_compression_utils_dir = "//third_party/zlib/google" angle_zlib_compression_utils_dir = "//third_party/zlib/google"
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"4f7b43863a5e61991bba4010db463679", "4f7b43863a5e61991bba4010db463679",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"6be5ee077187f1ec68e8e6035bcd2cae", "992b715af193e3c5667e6c2b3240d4e6",
"scripts/gl.xml": "scripts/gl.xml":
"2a73a58a7e26d8676a2c0af6d528cae6", "2a73a58a7e26d8676a2c0af6d528cae6",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
"src/libGL/libGL_autogen.def": "src/libGL/libGL_autogen.def":
"2789d87b05eea9f53d52e2aff499b785", "2789d87b05eea9f53d52e2aff499b785",
"src/libGLESv2/cl_stubs_autogen.h": "src/libGLESv2/cl_stubs_autogen.h":
"a20a5e774c40e4230878b90e76fe4f82", "3757cdaee900021bc14c21e97bd91d50",
"src/libGLESv2/egl_ext_stubs_autogen.h": "src/libGLESv2/egl_ext_stubs_autogen.h":
"2ef3b8d087f2a97f7270b96077c93856", "2ef3b8d087f2a97f7270b96077c93856",
"src/libGLESv2/egl_get_labeled_object_data.json": "src/libGLESv2/egl_get_labeled_object_data.json":
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
"src/libGLESv2/egl_stubs_autogen.h": "src/libGLESv2/egl_stubs_autogen.h":
"6439daa350c1663e71dd0af37dcc91df", "6439daa350c1663e71dd0af37dcc91df",
"src/libGLESv2/entry_points_cl_autogen.cpp": "src/libGLESv2/entry_points_cl_autogen.cpp":
"3a65b1fd9a07a192819df70e7b8ec292", "e9310db2512fb91852dc8834717d4209",
"src/libGLESv2/entry_points_cl_autogen.h": "src/libGLESv2/entry_points_cl_autogen.h":
"129fa7936c8bc6a20de9269da0c3c7d3", "129fa7936c8bc6a20de9269da0c3c7d3",
"src/libGLESv2/entry_points_egl_autogen.cpp": "src/libGLESv2/entry_points_egl_autogen.cpp":
......
...@@ -159,7 +159,7 @@ extern "C" {{ ...@@ -159,7 +159,7 @@ extern "C" {{
}} // extern "C" }} // extern "C"
""" """
TEMPLATE_ENTRY_POINT_DECL = """ANGLE_EXPORT {return_type}{export_def} {name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params});""" TEMPLATE_ENTRY_POINT_DECL = """ANGLE_EXPORT {return_type} {export_def} {name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params});"""
TEMPLATE_GLES_ENTRY_POINT_NO_RETURN = """\ TEMPLATE_GLES_ENTRY_POINT_NO_RETURN = """\
void GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params}) void GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params})
...@@ -185,7 +185,7 @@ void GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{exp ...@@ -185,7 +185,7 @@ void GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{exp
""" """
TEMPLATE_GLES_ENTRY_POINT_WITH_RETURN = """\ TEMPLATE_GLES_ENTRY_POINT_WITH_RETURN = """\
{return_type}GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params}) {return_type} GL_APIENTRY GL_{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params})
{{ {{
Context *context = {context_getter}; Context *context = {context_getter};
{event_comment}EVENT(context, GL{name}, "context = %d{comma_if_needed}{format_params}", CID(context){comma_if_needed}{pass_params}); {event_comment}EVENT(context, GL{name}, "context = %d{comma_if_needed}{format_params}", CID(context){comma_if_needed}{pass_params});
...@@ -231,7 +231,7 @@ void EGLAPIENTRY EGL_{name}({params}) ...@@ -231,7 +231,7 @@ void EGLAPIENTRY EGL_{name}({params})
""" """
TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN = """\ TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN = """\
{return_type}EGLAPIENTRY EGL_{name}({params}) {return_type} EGLAPIENTRY EGL_{name}({params})
{{ {{
ANGLE_SCOPED_GLOBAL_LOCK(); ANGLE_SCOPED_GLOBAL_LOCK();
EGL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params}); EGL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
...@@ -260,7 +260,7 @@ void CL_API_CALL CL_{name}({params}) ...@@ -260,7 +260,7 @@ void CL_API_CALL CL_{name}({params})
""" """
TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\ TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\
{return_type}CL_API_CALL CL_{name}({params}) {return_type} CL_API_CALL CL_{name}({params})
{{ {{
CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params}); CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
...@@ -268,7 +268,7 @@ TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\ ...@@ -268,7 +268,7 @@ TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\
// TODO: validate // TODO: validate
return cl::{name}({internal_params}); return {return_cast}(cl::{name}({internal_params}));
}} }}
""" """
...@@ -291,6 +291,16 @@ TEMPLATE_CL_STUBS_HEADER = """\ ...@@ -291,6 +291,16 @@ TEMPLATE_CL_STUBS_HEADER = """\
namespace cl namespace cl
{{ {{
class CommandQueue;
class Context;
class Device;
class Event;
class Kernel;
class Memory;
class Platform;
class Program;
class Sampler;
{stubs} {stubs}
}} // namespace cl }} // namespace cl
#endif // LIBGLESV2_{annotation_upper}_STUBS_AUTOGEN_H_ #endif // LIBGLESV2_{annotation_upper}_STUBS_AUTOGEN_H_
...@@ -366,14 +376,14 @@ TEMPLATE_CL_ENTRY_POINT_EXPORT = """\ ...@@ -366,14 +376,14 @@ TEMPLATE_CL_ENTRY_POINT_EXPORT = """\
""" """
TEMPLATE_GL_ENTRY_POINT_EXPORT = """\ TEMPLATE_GL_ENTRY_POINT_EXPORT = """\
{return_type}GL_APIENTRY gl{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params}) {return_type} GL_APIENTRY gl{name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params})
{{ {{
return GL_{name}{explicit_context_suffix}({explicit_context_internal_param}{explicit_context_comma}{internal_params}); return GL_{name}{explicit_context_suffix}({explicit_context_internal_param}{explicit_context_comma}{internal_params});
}} }}
""" """
TEMPLATE_EGL_ENTRY_POINT_EXPORT = """\ TEMPLATE_EGL_ENTRY_POINT_EXPORT = """\
{return_type}EGLAPIENTRY egl{name}({params}) {return_type} EGLAPIENTRY egl{name}({params})
{{ {{
EnsureEGLLoaded(); EnsureEGLLoaded();
return EGL_{name}({internal_params}); return EGL_{name}({internal_params});
...@@ -1194,6 +1204,7 @@ TEMPLATE_RESOURCE_ID_TYPE_NAME_CASE = """\ ...@@ -1194,6 +1204,7 @@ TEMPLATE_RESOURCE_ID_TYPE_NAME_CASE = """\
return "{resource_id_type}";""" return "{resource_id_type}";"""
CL_PACKED_TYPES = { CL_PACKED_TYPES = {
# Enums
"cl_platform_info": "PlatformInfo", "cl_platform_info": "PlatformInfo",
"cl_device_info": "DeviceInfo", "cl_device_info": "DeviceInfo",
"cl_context_info": "ContextInfo", "cl_context_info": "ContextInfo",
...@@ -1214,6 +1225,24 @@ CL_PACKED_TYPES = { ...@@ -1214,6 +1225,24 @@ CL_PACKED_TYPES = {
"cl_kernel_exec_info": "KernelExecInfo", "cl_kernel_exec_info": "KernelExecInfo",
"cl_event_info": "EventInfo", "cl_event_info": "EventInfo",
"cl_profiling_info": "ProfilingInfo", "cl_profiling_info": "ProfilingInfo",
# Objects
"cl_platform_id": "Platform *",
"cl_platform_id*": "Platform **",
"cl_device_id": "Device *",
"cl_device_id*": "Device **",
"const cl_device_id*": "Device *const *",
"cl_context": "Context *",
"cl_command_queue": "CommandQueue *",
"cl_mem": "Memory *",
"const cl_mem*": "Memory *const *",
"cl_program": "Program *",
"const cl_program*": "Program *const *",
"cl_kernel": "Kernel *",
"cl_kernel*": "Kernel **",
"cl_event": "Event *",
"cl_event*": "Event **",
"const cl_event*": "Event *const *",
"cl_sampler": "Sampler *",
} }
EGL_PACKED_TYPES = { EGL_PACKED_TYPES = {
...@@ -1265,7 +1294,7 @@ def format_entry_point_decl(api, cmd_name, proto, params, is_explicit_context): ...@@ -1265,7 +1294,7 @@ def format_entry_point_decl(api, cmd_name, proto, params, is_explicit_context):
return TEMPLATE_ENTRY_POINT_DECL.format( return TEMPLATE_ENTRY_POINT_DECL.format(
export_def=get_api_entry_def(api), export_def=get_api_entry_def(api),
name="%s_%s" % (entry_point_prefix(api), stripped), name="%s_%s" % (entry_point_prefix(api), stripped),
return_type=proto[:-len(cmd_name)], return_type=proto[:-len(cmd_name)].strip(),
params=", ".join(params), params=", ".join(params),
comma_if_needed=comma_if_needed, comma_if_needed=comma_if_needed,
explicit_context_suffix="ContextANGLE" if is_explicit_context else "", explicit_context_suffix="ContextANGLE" if is_explicit_context else "",
...@@ -1511,8 +1540,9 @@ def format_entry_point_def(api, command_node, cmd_name, proto, params, is_explic ...@@ -1511,8 +1540,9 @@ def format_entry_point_def(api, command_node, cmd_name, proto, params, is_explic
pass_params = [param_print_argument(command_node, param) for param in params] pass_params = [param_print_argument(command_node, param) for param in params]
format_params = [param_format_string(param) for param in params] format_params = [param_format_string(param) for param in params]
return_type = proto[:-len(cmd_name)] return_type = proto[:-len(cmd_name)].strip()
default_return = default_return_value(cmd_name, return_type.strip()) return_cast = "UnpackParam<" + return_type + ">" if return_type in packed_param_types else ""
default_return = default_return_value(cmd_name, return_type)
event_comment = TEMPLATE_EVENT_COMMENT if cmd_name in NO_EVENT_MARKER_EXCEPTIONS_LIST else "" event_comment = TEMPLATE_EVENT_COMMENT if cmd_name in NO_EVENT_MARKER_EXCEPTIONS_LIST else ""
name_lower_no_suffix = strip_suffix(api, cmd_name[2:3].lower() + cmd_name[3:]) name_lower_no_suffix = strip_suffix(api, cmd_name[2:3].lower() + cmd_name[3:])
...@@ -1523,6 +1553,8 @@ def format_entry_point_def(api, command_node, cmd_name, proto, params, is_explic ...@@ -1523,6 +1553,8 @@ def format_entry_point_def(api, command_node, cmd_name, proto, params, is_explic
name_lower_no_suffix, name_lower_no_suffix,
"return_type": "return_type":
return_type, return_type,
"return_cast":
return_cast,
"params": "params":
", ".join(params), ", ".join(params),
"internal_params": "internal_params":
...@@ -1676,7 +1708,7 @@ def format_context_decl(api, cmd_name, proto, params, template, cmd_packed_gl_en ...@@ -1676,7 +1708,7 @@ def format_context_decl(api, cmd_name, proto, params, template, cmd_packed_gl_en
internal_params = get_internal_params(api, cmd_name, params, cmd_packed_gl_enums, internal_params = get_internal_params(api, cmd_name, params, cmd_packed_gl_enums,
packed_param_types) packed_param_types)
return_type = proto[:-len(cmd_name)] return_type = proto[:-len(cmd_name)].strip()
name_lower_no_suffix = cmd_name[2:3].lower() + cmd_name[3:] name_lower_no_suffix = cmd_name[2:3].lower() + cmd_name[3:]
name_lower_no_suffix = strip_suffix(api, name_lower_no_suffix) name_lower_no_suffix = strip_suffix(api, name_lower_no_suffix)
maybe_const = " const" if name_lower_no_suffix.startswith( maybe_const = " const" if name_lower_no_suffix.startswith(
...@@ -1691,7 +1723,7 @@ def format_context_decl(api, cmd_name, proto, params, template, cmd_packed_gl_en ...@@ -1691,7 +1723,7 @@ def format_context_decl(api, cmd_name, proto, params, template, cmd_packed_gl_en
def format_entry_point_export(cmd_name, proto, params, is_explicit_context, template): def format_entry_point_export(cmd_name, proto, params, is_explicit_context, template):
internal_params = [just_the_name(param) for param in params] internal_params = [just_the_name(param) for param in params]
return_type = proto[:-len(cmd_name)] return_type = proto[:-len(cmd_name)].strip()
return template.format( return template.format(
name=strip_api_prefix(cmd_name), name=strip_api_prefix(cmd_name),
...@@ -2471,6 +2503,8 @@ def write_stubs_header(api, annotation, title, data_source, out_file, all_comman ...@@ -2471,6 +2503,8 @@ def write_stubs_header(api, annotation, title, data_source, out_file, all_comman
params = [] if api == apis.CL else ["Thread *thread"] params = [] if api == apis.CL else ["Thread *thread"]
params += ["".join(param.itertext()) for param in command.findall('param')] params += ["".join(param.itertext()) for param in command.findall('param')]
return_type = proto_text[:-len(cmd_name)].strip() return_type = proto_text[:-len(cmd_name)].strip()
if api == apis.CL and return_type in packed_param_types:
return_type = packed_param_types[return_type]
internal_params = get_internal_params(api, cmd_name, params, cmd_packed_egl_enums, internal_params = get_internal_params(api, cmd_name, params, cmd_packed_egl_enums,
packed_param_types) packed_param_types)
......
//
// 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.
//
// CLCommandQueue.cpp: Implements the cl::CommandQueue class.
#include "libANGLE/CLCommandQueue.h"
namespace cl
{
// TODO
} // namespace cl
//
// 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.
//
// CLCommandQueue.h: Defines the cl::CommandQueue class, which can be used to queue a set of OpenCL
// operations.
#ifndef LIBANGLE_CLCOMMANDQUEUE_H_
#define LIBANGLE_CLCOMMANDQUEUE_H_
namespace cl
{
class CommandQueue final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLCOMMANDQUEUE_H_
//
// 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.
//
// CLContext.cpp: Implements the cl::Context class.
#include "libANGLE/CLContext.h"
namespace cl
{
// TODO
} // namespace cl
//
// 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.
//
// CLContext.h: Defines the cl::Context class, which manages OpenCL objects such as command-queues,
// memory, program and kernel objects and for executing kernels on one or more devices.
#ifndef LIBANGLE_CLCONTEXT_H_
#define LIBANGLE_CLCONTEXT_H_
namespace cl
{
class Context final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLCONTEXT_H_
//
// 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.
//
// CLDevice.cpp: Implements the cl::Device class.
#include "libANGLE/CLDevice.h"
namespace cl
{
// TODO
} // namespace cl
//
// 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.
//
// CLDevice.h: Defines the cl::Device class, which provides information about OpenCL device
// configurations.
#ifndef LIBANGLE_CLDEVICE_H_
#define LIBANGLE_CLDEVICE_H_
namespace cl
{
class Device final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLDEVICE_H_
//
// 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.
//
// CLEvent.cpp: Implements the cl::Event class.
#include "libANGLE/CLEvent.h"
namespace cl
{
// TODO
} // namespace cl
//
// 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.
//
// CLEvent.h: Defines the cl::Event class, which can be used to track the execution status of an
// OpenCL command.
#ifndef LIBANGLE_CLEVENT_H_
#define LIBANGLE_CLEVENT_H_
namespace cl
{
class Event final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLEVENT_H_
//
// 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.
//
// CLKernel.cpp: Implements the cl::Kernel class.
#include "libANGLE/CLKernel.h"
namespace cl
{
// TODO
} // namespace cl
//
// 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.
//
// CLKernel.h: Defines the cl::Kernel class, which is a function declared in an OpenCL program.
#ifndef LIBANGLE_CLKERNEL_H_
#define LIBANGLE_CLKERNEL_H_
namespace cl
{
class Kernel final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLKERNEL_H_
//
// 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.
//
// CLMemory.cpp: Implements the cl::Memory class.
#include "libANGLE/CLMemory.h"
namespace cl
{
// TODO
} // namespace cl
//
// 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.
//
// CLMemory.h: Defines the cl::Memory class, which is a memory object and the base class for OpenCL
// objects such as Buffer, Image and Pipe.
#ifndef LIBANGLE_CLMEMORY_H_
#define LIBANGLE_CLMEMORY_H_
namespace cl
{
class Memory final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLMEMORY_H_
//
// 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.
//
// CLPlatform.cpp: Implements the cl::Platform class.
#include "libANGLE/CLPlatform.h"
namespace cl
{
// TODO
} // namespace cl
//
// 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.
//
// CLPlatform.h: Defines the cl::Platform class, which provides information about platform-specific
// OpenCL features.
#ifndef LIBANGLE_CLPLATFORM_H_
#define LIBANGLE_CLPLATFORM_H_
namespace cl
{
class Platform final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLPLATFORM_H_
//
// 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.
//
// CLProgram.cpp: Implements the cl::Program class.
#include "libANGLE/CLProgram.h"
namespace cl
{
// TODO
} // namespace cl
//
// 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.
//
// CLProgram.h: Defines the cl::Program class, which consists of a set of OpenCL kernels.
#ifndef LIBANGLE_CLPROGRAM_H_
#define LIBANGLE_CLPROGRAM_H_
namespace cl
{
class Program final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLPROGRAM_H_
//
// 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.
//
// CLSampler.cpp: Implements the cl::Sampler class.
#include "libANGLE/CLSampler.h"
namespace cl
{
// TODO
} // namespace cl
//
// 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.
//
// CLSampler.h: Defines the cl::Sampler class, which describes how to sample an OpenCL Image.
#ifndef LIBANGLE_CLSAMPLER_H_
#define LIBANGLE_CLSAMPLER_H_
namespace cl
{
class Sampler final
{
public:
};
} // namespace cl
#endif // LIBANGLE_CLSAMPLER_H_
...@@ -159,26 +159,8 @@ libangle_gpu_info_util_ios_sources = [ ...@@ -159,26 +159,8 @@ libangle_gpu_info_util_ios_sources = [
] ]
libangle_includes = [ libangle_includes = [
"include/angle_cl.h",
"include/angle_gl.h", "include/angle_gl.h",
"include/export.h", "include/export.h",
"include/CL/cl.h",
"include/CL/cl_d3d10.h",
"include/CL/cl_d3d11.h",
"include/CL/cl_dx9_media_sharing.h",
"include/CL/cl_dx9_media_sharing_intel.h",
"include/CL/cl_egl.h",
"include/CL/cl_ext.h",
"include/CL/cl_ext_intel.h",
"include/CL/cl_gl.h",
"include/CL/cl_gl_ext.h",
"include/CL/cl_half.h",
"include/CL/cl_icd.h",
"include/CL/cl_layer.h",
"include/CL/cl_platform.h",
"include/CL/cl_va_api_media_sharing_intel.h",
"include/CL/cl_version.h",
"include/CL/opencl.h",
"include/EGL/egl.h", "include/EGL/egl.h",
"include/EGL/eglext.h", "include/EGL/eglext.h",
"include/EGL/eglext_angle.h", "include/EGL/eglext_angle.h",
...@@ -445,6 +427,52 @@ libangle_sources = [ ...@@ -445,6 +427,52 @@ libangle_sources = [
"src/libANGLE/validationGL4.cpp", "src/libANGLE/validationGL4.cpp",
] ]
cl_includes = [
"include/angle_cl.h",
"include/export.h",
"include/CL/cl.h",
"include/CL/cl_d3d10.h",
"include/CL/cl_d3d11.h",
"include/CL/cl_dx9_media_sharing.h",
"include/CL/cl_dx9_media_sharing_intel.h",
"include/CL/cl_egl.h",
"include/CL/cl_ext.h",
"include/CL/cl_ext_intel.h",
"include/CL/cl_gl.h",
"include/CL/cl_gl_ext.h",
"include/CL/cl_half.h",
"include/CL/cl_icd.h",
"include/CL/cl_layer.h",
"include/CL/cl_platform.h",
"include/CL/cl_va_api_media_sharing_intel.h",
"include/CL/cl_version.h",
"include/CL/opencl.h",
]
libangle_cl_headers = [
"src/libANGLE/CLCommandQueue.h",
"src/libANGLE/CLContext.h",
"src/libANGLE/CLDevice.h",
"src/libANGLE/CLEvent.h",
"src/libANGLE/CLKernel.h",
"src/libANGLE/CLMemory.h",
"src/libANGLE/CLPlatform.h",
"src/libANGLE/CLProgram.h",
"src/libANGLE/CLSampler.h",
]
libangle_cl_sources = [
"src/libANGLE/CLCommandQueue.cpp",
"src/libANGLE/CLContext.cpp",
"src/libANGLE/CLDevice.cpp",
"src/libANGLE/CLEvent.cpp",
"src/libANGLE/CLKernel.cpp",
"src/libANGLE/CLMemory.cpp",
"src/libANGLE/CLPlatform.cpp",
"src/libANGLE/CLProgram.cpp",
"src/libANGLE/CLSampler.cpp",
]
libangle_mac_sources = [ libangle_mac_sources = [
"src/libANGLE/renderer/driver_utils_mac.mm", "src/libANGLE/renderer/driver_utils_mac.mm",
"src/libANGLE/renderer/gl/apple/DisplayApple_api.cpp", "src/libANGLE/renderer/gl/apple/DisplayApple_api.cpp",
...@@ -513,15 +541,10 @@ if (is_win) { ...@@ -513,15 +541,10 @@ if (is_win) {
} }
libglesv2_sources = [ libglesv2_sources = [
"src/libGLESv2/cl_stubs.cpp",
"src/libGLESv2/cl_stubs_autogen.h",
"src/libGLESv2/egl_ext_stubs.cpp", "src/libGLESv2/egl_ext_stubs.cpp",
"src/libGLESv2/egl_ext_stubs_autogen.h", "src/libGLESv2/egl_ext_stubs_autogen.h",
"src/libGLESv2/egl_stubs.cpp", "src/libGLESv2/egl_stubs.cpp",
"src/libGLESv2/egl_stubs_autogen.h", "src/libGLESv2/egl_stubs_autogen.h",
"src/libGLESv2/entry_points_cl_autogen.cpp",
"src/libGLESv2/entry_points_cl_autogen.h",
"src/libGLESv2/entry_points_cl_utils.h",
"src/libGLESv2/entry_points_egl_autogen.cpp", "src/libGLESv2/entry_points_egl_autogen.cpp",
"src/libGLESv2/entry_points_egl_autogen.h", "src/libGLESv2/entry_points_egl_autogen.h",
"src/libGLESv2/entry_points_egl_ext_autogen.cpp", "src/libGLESv2/entry_points_egl_ext_autogen.cpp",
...@@ -544,6 +567,14 @@ libglesv2_sources = [ ...@@ -544,6 +567,14 @@ libglesv2_sources = [
"src/libGLESv2/proc_table_egl.h", "src/libGLESv2/proc_table_egl.h",
"src/libGLESv2/proc_table_egl_autogen.cpp", "src/libGLESv2/proc_table_egl_autogen.cpp",
"src/libGLESv2/resource.h", "src/libGLESv2/resource.h",
]
libglesv2_cl_sources = [
"src/libGLESv2/cl_stubs.cpp",
"src/libGLESv2/cl_stubs_autogen.h",
"src/libGLESv2/entry_points_cl_autogen.cpp",
"src/libGLESv2/entry_points_cl_autogen.h",
"src/libGLESv2/entry_points_cl_utils.h",
"src/libGLESv2/validationCL.h", "src/libGLESv2/validationCL.h",
] ]
......
...@@ -27,7 +27,20 @@ inline typename std::enable_if<!std::is_enum<PackedT>::value, ...@@ -27,7 +27,20 @@ inline typename std::enable_if<!std::is_enum<PackedT>::value,
typename std::remove_reference<PackedT>::type>::type typename std::remove_reference<PackedT>::type>::type
PackParam(FromT from) PackParam(FromT from)
{ {
return static_cast<PackedT>(from); return reinterpret_cast<PackedT>(from);
}
// First case: handling packed enums.
template <typename UnpackedT, typename FromT>
typename std::enable_if<std::is_enum<FromT>::value, UnpackedT>::type UnpackParam(FromT from)
{
return ToCLenum(from);
}
template <typename UnpackedT, typename FromT>
inline typename std::enable_if<!std::is_enum<FromT>::value, UnpackedT>::type UnpackParam(FromT from)
{
return reinterpret_cast<UnpackedT>(from);
} }
} // namespace cl } // namespace cl
......
...@@ -6,29 +6,7 @@ ...@@ -6,29 +6,7 @@
import("../../gni/angle.gni") import("../../gni/angle.gni")
angle_source_set("cl_includes") { assert(angle_enable_cl)
sources = [
"../../include/CL/cl.h",
"../../include/CL/cl_d3d10.h",
"../../include/CL/cl_d3d11.h",
"../../include/CL/cl_dx9_media_sharing.h",
"../../include/CL/cl_dx9_media_sharing_intel.h",
"../../include/CL/cl_egl.h",
"../../include/CL/cl_ext.h",
"../../include/CL/cl_ext_intel.h",
"../../include/CL/cl_gl.h",
"../../include/CL/cl_gl_ext.h",
"../../include/CL/cl_half.h",
"../../include/CL/cl_icd.h",
"../../include/CL/cl_layer.h",
"../../include/CL/cl_platform.h",
"../../include/CL/cl_va_api_media_sharing_intel.h",
"../../include/CL/cl_version.h",
"../../include/CL/opencl.h",
"../../include/angle_cl.h",
"../../include/export.h",
]
}
angle_shared_library("OpenCL") { angle_shared_library("OpenCL") {
defines = [ "LIBCL_IMPLEMENTATION" ] defines = [ "LIBCL_IMPLEMENTATION" ]
...@@ -45,8 +23,8 @@ angle_shared_library("OpenCL") { ...@@ -45,8 +23,8 @@ angle_shared_library("OpenCL") {
] ]
deps = [ deps = [
":cl_includes",
"$angle_root:angle_common", "$angle_root:angle_common",
"$angle_root:cl_includes",
] ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment