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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
|
# Copyright (C) 2022-2025 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if ENABLE(WEBGL) && ENABLE(GPU_PROCESS)
header: <WebCore/GraphicsTypesGL.h>
using PlatformGLObject = GCGLuint
using GCGLuint = unsigned
header: <WebCore/GCGLExtension.h>
enum class WebCore::GCGLExtension : uint8_t {
ANGLE_base_vertex_base_instance,
ANGLE_clip_cull_distance,
ANGLE_compressed_texture_etc,
ANGLE_depth_texture,
ANGLE_instanced_arrays,
ANGLE_multi_draw,
ANGLE_pack_reverse_row_order,
ANGLE_polygon_mode,
ANGLE_provoking_vertex,
ANGLE_stencil_texturing,
ANGLE_texture_compression_dxt3,
ANGLE_texture_compression_dxt5,
ANGLE_translated_shader_source,
CHROMIUM_color_buffer_float_rgb,
CHROMIUM_color_buffer_float_rgba,
EXT_blend_func_extended,
EXT_blend_minmax,
EXT_clip_control,
EXT_color_buffer_float,
EXT_color_buffer_half_float,
EXT_conservative_depth,
EXT_depth_clamp,
EXT_disjoint_timer_query,
EXT_draw_buffers,
EXT_float_blend,
EXT_frag_depth,
EXT_polygon_offset_clamp,
EXT_render_snorm,
EXT_shader_texture_lod,
EXT_sRGB,
EXT_texture_compression_bptc,
EXT_texture_compression_dxt1,
EXT_texture_compression_rgtc,
EXT_texture_compression_s3tc_srgb,
EXT_texture_filter_anisotropic,
EXT_texture_mirror_clamp_to_edge,
EXT_texture_norm16,
IMG_texture_compression_pvrtc,
KHR_parallel_shader_compile,
KHR_texture_compression_astc_hdr,
KHR_texture_compression_astc_ldr,
NV_shader_noperspective_interpolation,
OES_compressed_ETC1_RGB8_texture,
OES_depth_texture,
OES_draw_buffers_indexed,
OES_element_index_uint,
OES_fbo_render_mipmap,
OES_packed_depth_stencil,
OES_sample_variables,
OES_shader_multisample_interpolation,
OES_standard_derivatives,
OES_texture_float_linear,
OES_texture_float,
OES_texture_half_float_linear,
OES_texture_half_float,
OES_vertex_array_object,
QCOM_render_shared_exponent
};
header: <WebCore/GraphicsContextGL.h>
#if PLATFORM(COCOA)
[CustomHeader, RValue] struct WebCore::GraphicsContextGLExternalImageSourceIOSurfaceHandle {
MachSendRight handle;
};
[CustomHeader, RValue] struct WebCore::GraphicsContextGLExternalImageSourceMTLSharedTextureHandle {
MachSendRight handle;
};
using WebCore::GraphicsContextGL::ExternalImageSource = Variant<WebCore::GraphicsContextGLExternalImageSourceIOSurfaceHandle, WebCore::GraphicsContextGLExternalImageSourceMTLSharedTextureHandle>
using WebCore::GraphicsContextGL::ExternalSyncSource = std::tuple<MachSendRight, uint64_t>
#endif
#if !PLATFORM(COCOA)
#if (PLATFORM(GTK) || PLATFORM(WPE))
[CustomHeader] struct WebCore::GraphicsContextGLExternalImageSource {
#if OS(ANDROID)
RefPtr<AHardwareBuffer> hardwareBuffer;
#else
Vector<WTF::UnixFileDescriptor> fds;
Vector<uint32_t> strides;
Vector<uint32_t> offsets;
uint32_t fourcc;
uint64_t modifier;
#endif
WebCore::IntSize size;
};
using WebCore::GraphicsContextGL::ExternalImageSource = WebCore::GraphicsContextGLExternalImageSource;
#else
using WebCore::GraphicsContextGL::ExternalImageSource = int
#endif
using WebCore::GraphicsContextGL::ExternalSyncSource = int
#endif
header: <WebCore/GraphicsContextGLAttributes.h>
[CustomHeader] enum class WebCore::GraphicsContextGLPowerPreference : uint8_t {
Default,
LowPower,
HighPerformance
};
header: <WebCore/GraphicsContextGLAttributes.h>
[CustomHeader] enum class WebCore::GraphicsContextGLSimulatedCreationFailure : uint8_t {
None,
IPCBufferOOM,
CreationTimeout,
FailPlatformContextCreation
};
struct WebCore::GraphicsContextGLAttributes {
bool alpha;
bool depth;
bool stencil;
bool antialias;
bool premultipliedAlpha;
bool preserveDrawingBuffer;
WebCore::GraphicsContextGLPowerPreference powerPreference;
bool isWebGL2;
#if PLATFORM(MAC)
uint64_t windowGPUID;
#endif
#if ENABLE(WEBXR)
bool xrCompatible;
#endif
WebCore::GraphicsContextGLSimulatedCreationFailure failContextCreationForTesting;
};
header: <WebCore/GraphicsContextGLEnums.h>
enum class WebCore::GraphicsContextGLSimulatedEventForTesting : uint8_t {
GPUStatusFailure,
Timeout,
DisplayBufferAllocationFailure
};
header: <WebCore/GraphicsContextGLActiveInfo.h>
[AdditionalEncoder=StreamConnectionEncoder, CustomHeader] class WebCore::GCGLUniformActiveInfo {
CString name;
GCGLenum type;
Vector<int> locations;
int blockIndex;
int offset;
int arrayStride;
int matrixStride;
int isRowMajor;
};
header: <WebCore/GraphicsContextGLActiveInfo.h>
[AdditionalEncoder=StreamConnectionEncoder, CustomHeader] class WebCore::GCGLAttribActiveInfo {
CString name;
GCGLenum type;
int location;
};
header: <WebCore/GraphicsContextGLActiveInfo.h>
[AdditionalEncoder=StreamConnectionEncoder, CustomHeader] class WebCore::GCGLTransformFeedbackActiveInfo {
CString name;
GCGLenum type;
int size;
};
#endif
|