• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("@rules_cc//cc:defs.bzl", "cc_library", "objc_library")
2
3cc_library(
4    name = "gles1_dec",
5    srcs = [
6        "gles1_dec/GLESv1Decoder.cpp",
7        "gles1_dec/gles1_dec.cpp",
8        "gles1_dec/gles1_server_context.cpp",
9    ] + glob(["gles1_dec/*.h"]),
10    copts = ["-fno-exceptions"],
11    defines = ["EMUGL_BUILD"],
12    visibility = ["//visibility:public"],
13    deps = [
14        ":GLSnapshot",
15        "//common/opengl:gfxstream_opengl_headers",
16        "//host/apigen-codec-common",
17    ],
18)
19
20objc_library(
21    name = "gfxstream-gl-host-common-darwin",
22    srcs = [
23        "gl-host-common/opengl/macTouchOpenGL.m",
24    ],
25    hdrs = ["gl-host-common/include/host-common/opengl/macTouchOpenGL.h"],
26    defines = ["EMUGL_BUILD"],
27    includes = ["gl-host-common/include"],
28    target_compatible_with = [
29        "@platforms//os:macos",
30    ],
31    deps = [
32        "//:gfxstream-gl-host-common-headers",
33    ],
34)
35
36cc_library(
37    name = "gl-common-headers",
38    hdrs = glob(["glestranslator/GLcommon/include/**/*.h"]),
39    copts = ["-fno-exceptions"],
40    includes = ["glestranslator/GLcommon/include"],
41    visibility = ["//visibility:public"],
42    deps = ["//host/apigen-codec-common"],
43)
44
45objc_library(
46    name = "egl_translator-darwin",
47    srcs = [
48        "glestranslator/EGL/MacNative.m",
49        "glestranslator/EGL/MacPixelFormatsAttribs.m",
50    ] + glob(["glestranslator/EGL/*.h"]),
51    copts = ["-Wno-deprecated-declarations"],
52    defines = ["EMUGL_BUILD"],
53    sdk_frameworks = [
54        "IOSurface",
55        "AppKit",
56        "CoreGraphics",
57        "OpenGL",
58    ],
59    target_compatible_with = [
60        "@platforms//os:macos",
61    ],
62    visibility = ["//visibility:public"],
63    deps = [
64        "//:gfxstream-gl-host-common-headers",
65    ],
66    alwayslink = True,
67)
68
69cc_library(
70    name = "EGL_translator_static",
71    srcs = [
72        "glestranslator/EGL/ClientAPIExts.cpp",
73        "glestranslator/EGL/EglConfig.cpp",
74        "glestranslator/EGL/EglContext.cpp",
75        "glestranslator/EGL/EglDisplay.cpp",
76        "glestranslator/EGL/EglGlobalInfo.cpp",
77        "glestranslator/EGL/EglImp.cpp",
78        "glestranslator/EGL/EglOsApi_egl.cpp",
79        "glestranslator/EGL/EglPbufferSurface.cpp",
80        "glestranslator/EGL/EglSurface.cpp",
81        "glestranslator/EGL/EglThreadInfo.cpp",
82        "glestranslator/EGL/EglValidate.cpp",
83        "glestranslator/EGL/EglWindowSurface.cpp",
84        "glestranslator/EGL/ShaderCache.cpp",
85        "glestranslator/EGL/ThreadInfo.cpp",
86    ] + glob([
87        "glestranslator/EGL/*.h",
88    ]) + select({
89        "@platforms//os:macos": ["glestranslator/EGL/EglOsApi_darwin.cpp"],
90        "@platforms//os:windows": [
91            "glestranslator/EGL/CoreProfileConfigs_windows.cpp",
92            "glestranslator/EGL/EglOsApi_wgl.cpp",
93        ],
94        "@platforms//os:linux": [
95            "glestranslator/EGL/CoreProfileConfigs_linux.cpp",
96            "glestranslator/EGL/EglOsApi_glx.cpp",
97            "glestranslator/EGL/X11ErrorHandler.cpp",
98        ],
99        "//conditions:default": [],
100    }),
101    hdrs =
102        ["glestranslator/EGL/ClientAPIExts.in"],
103    copts = [
104        "-fno-exceptions",
105        "-Wno-extern-c-compat",
106        "-Wno-inconsistent-missing-override",
107        "-Wno-return-type-c-linkage",
108    ],
109    defines = ["EMUGL_BUILD"],
110    visibility = ["//visibility:public"],
111    deps =
112        [
113            ":gl-common-headers",
114            "//:gfxstream-gl-host-common-headers",
115            "//common/etc:gfxstream_etc",
116            "//common/opengl:gfxstream_opengl_headers",
117            "//host:gfxstream_host_headers",
118            "//host/apigen-codec-common",
119            "//host/gl:gfxstream-gl-host-common",
120            "//host/gl/glestranslator/GLES_CM:GLES_CM_translator_static",
121            "//host/gl/glestranslator/GLES_V2:GLES_V2_translator_static",
122            "@aemu//host-common:aemu-host-common-headers",
123            "@aemu//snapshot:aemu-snapshot",
124        ] + select({
125            "@platforms//os:macos": [":egl_translator-darwin"],
126            "//conditions:default": [],
127        }),
128    alwayslink = True,
129)
130
131cc_library(
132    name = "gl_common",
133    srcs = [
134        "glestranslator/GLcommon/FramebufferData.cpp",
135        "glestranslator/GLcommon/GLBackgroundLoader.cpp",
136        "glestranslator/GLcommon/GLDispatch.cpp",
137        "glestranslator/GLcommon/GLESbuffer.cpp",
138        "glestranslator/GLcommon/GLEScontext.cpp",
139        "glestranslator/GLcommon/GLESpointer.cpp",
140        "glestranslator/GLcommon/GLESvalidate.cpp",
141        "glestranslator/GLcommon/GLutils.cpp",
142        "glestranslator/GLcommon/NamedObject.cpp",
143        "glestranslator/GLcommon/ObjectData.cpp",
144        "glestranslator/GLcommon/ObjectNameSpace.cpp",
145        "glestranslator/GLcommon/PaletteTexture.cpp",
146        "glestranslator/GLcommon/RangeManip.cpp",
147        "glestranslator/GLcommon/SaveableTexture.cpp",
148        "glestranslator/GLcommon/ScopedGLState.cpp",
149        "glestranslator/GLcommon/ShareGroup.cpp",
150        "glestranslator/GLcommon/TextureData.cpp",
151        "glestranslator/GLcommon/TextureUtils.cpp",
152        "glestranslator/GLcommon/rgtc.cpp",
153    ],
154    copts = [
155        "-Wno-extern-c-compat",
156        "-fno-exceptions",
157    ],
158    defines = [
159        "EMUGL_BUILD",
160        "BUILDING_EMUGL_COMMON_SHARED",
161    ],
162    visibility = ["//visibility:public"],
163    deps = [
164        ":gl-common-headers",
165        # "//external/angle:angle-headers",
166        "//common/opengl:gfxstream_opengl_headers",
167        "@aemu//snapshot:aemu-snapshot",
168        "//common/etc:gfxstream_etc",
169        "//host:gfxstream-compressedTextures",
170    ],
171)
172
173cc_library(
174    name = "gfxstream-gl-host-common",
175    srcs = [
176        "gl-host-common/opengl/EmuglBackendList.cpp",
177        "gl-host-common/opengl/GLProcessPipe.cpp",
178        "gl-host-common/opengl/OpenglEsPipe.cpp",
179        "gl-host-common/opengl/emugl_config.cpp",
180        "gl-host-common/opengl/gpuinfo.cpp",
181        "gl-host-common/opengl/logger.cpp",
182        "gl-host-common/opengl/misc.cpp",
183        "gl-host-common/opengles.cpp",
184    ] + select({
185        "@platforms//os:macos": [
186            "gl-host-common/opengl/NativeGpuInfo_darwin.cpp",
187        ],
188        "@platforms//os:windows": ["gl-host-common/opengl/NativeGpuInfo_windows.cpp"],
189        "@platforms//os:linux": ["gl-host-common/opengl/NativeGpuInfo_linux.cpp"],
190        "//conditions:default": [],
191    }) + glob(["gl-host-common/include/**/*.h"]),
192    copts = [
193        "-Wno-return-type-c-linkage",
194        "-fno-exceptions",
195        "-Wno-extern-c-compat",
196    ],
197    defines = ["EMUGL_BUILD"],
198    includes = ["gl-host-common/include"],
199    linkopts = select({
200        "@platforms//os:windows": [
201            "-DEFAULTLIB:D3d9.lib",
202            "-DEFAULTLIB:Advapi32.lib",
203        ],
204        "//conditions:default": [],
205    }),
206    visibility = ["//visibility:public"],
207    deps = [
208        "//common/opengl:gfxstream_opengl_headers",
209        "//host/apigen-codec-common",
210        "//host/features:gfxstream_features",
211        "@aemu//snapshot:aemu-snapshot",
212    ] + select({
213        "@platforms//os:macos": ["gfxstream-gl-host-common-darwin"],
214        "//conditions:default": [],
215    }),
216)
217
218cc_library(
219    name = "gles2_dec",
220    srcs = [
221        "gles2_dec/GLESv2Decoder.cpp",
222        "gles2_dec/gles2_dec.cpp",
223        "gles2_dec/gles2_server_context.cpp",
224    ] + glob(["gles2_dec/*.h"]),
225    copts = ["-fno-exceptions"],
226    defines = ["EMUGL_BUILD"],
227    visibility = ["//visibility:public"],
228    deps = [
229        ":GLSnapshot",
230        "//:gfxstream-gl-host-common-headers",
231        "//common/opengl:gfxstream_opengl_headers",
232        "//host/apigen-codec-common",
233    ],
234)
235
236cc_library(
237    name = "GLSnapshot",
238    srcs = ["glsnapshot/GLSnapshot.cpp"],
239    hdrs = ["glsnapshot/GLSnapshot.h"],
240    copts = [
241        "-fno-exceptions",
242        "-Wno-extern-c-compat",
243    ],
244    defines = ["EMUGL_BUILD"],
245    includes = ["glsnapshot"],
246    visibility = ["//visibility:public"],
247    deps = ["//host/apigen-codec-common"],
248)
249
250cc_library(
251    name = "OpenGLESDispatch",
252    srcs = [
253        "OpenGLESDispatch/EGLDispatch.cpp",
254        "OpenGLESDispatch/GLESv1Dispatch.cpp",
255        "OpenGLESDispatch/GLESv2Dispatch.cpp",
256        "OpenGLESDispatch/OpenGLDispatchLoader.cpp",
257        "OpenGLESDispatch/StaticDispatch.cpp",
258        "OpenGLESDispatch/gles1_stubbed_in_translator_namespace.cpp",
259        "OpenGLESDispatch/gles2_stubbed_in_translator_namespace.cpp",
260    ],
261    copts = [
262        "-fno-exceptions",
263        "-Wno-extern-c-compat",
264    ],
265    defines = ["EMUGL_BUILD"],
266    visibility = ["//visibility:public"],
267    deps = [
268        ":EGL_translator_static",
269        ":gles1_dec",
270        ":gles2_dec",
271        "//:gfxstream-gl-host-common-headers",
272        "//common/opengl:gfxstream_opengl_headers",
273        "//host/apigen-codec-common",
274    ],
275)
276
277cc_library(
278    name = "gfxstream-gl-server",
279    srcs = [
280        "BufferGl.cpp",
281        "ColorBufferGl.cpp",
282        "CompositorGl.cpp",
283        "DebugGl.cpp",
284        "DisplayGl.cpp",
285        "DisplaySurfaceGl.cpp",
286        "EmulatedEglConfig.cpp",
287        "EmulatedEglContext.cpp",
288        "EmulatedEglFenceSync.cpp",
289        "EmulatedEglImage.cpp",
290        "EmulatedEglWindowSurface.cpp",
291        "EmulationGl.cpp",
292        "GLESVersionDetector.cpp",
293        "ReadbackWorkerGl.cpp",
294        "TextureDraw.cpp",
295        "TextureResize.cpp",
296        "YUVConverter.cpp",
297    ] + glob([
298        "*.h",
299    ]),
300    hdrs = [],
301    copts = [
302        "-fno-exceptions",
303        "-Wno-extern-c-compat",
304    ],
305    defines = [
306        "GFXSTREAM_ENABLE_HOST_GLES=1",
307        "EMUGL_BUILD",
308    ],
309    visibility = ["//visibility:public"],
310    deps = [
311        ":OpenGLESDispatch",
312        ":gfxstream-gl-host-common",
313        ":gles1_dec",
314        ":gles2_dec",
315        "//:gfxstream-gl-host-common-headers",
316        "//host:gfxstream_host_headers",
317        "//host/apigen-codec-common",
318        "//host/gl:GLSnapshot",
319    ],
320)
321
322cc_library(
323    name = "gl_headers",
324    hdrs = glob(["*.h"]),
325    visibility = ["//visibility:public"],
326    # visibility = ["//a:__pkg__"],
327)
328