18bf80f4bSopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd.
28bf80f4bSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
38bf80f4bSopenharmony_ci# you may not use this file except in compliance with the License.
48bf80f4bSopenharmony_ci# You may obtain a copy of the License at
58bf80f4bSopenharmony_ci#
68bf80f4bSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
78bf80f4bSopenharmony_ci#
88bf80f4bSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
98bf80f4bSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
108bf80f4bSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
118bf80f4bSopenharmony_ci# See the License for the specific language governing permissions and
128bf80f4bSopenharmony_ci# limitations under the License.
138bf80f4bSopenharmony_ciimport("//build/ohos.gni")
148bf80f4bSopenharmony_ciimport("//foundation/graphic/graphic_2d/graphic_config.gni")
158bf80f4bSopenharmony_ciimport("//foundation/graphic/graphic_3d/lume/lume_config.gni")
168bf80f4bSopenharmony_ci
178bf80f4bSopenharmony_cideclare_args() {
188bf80f4bSopenharmony_ci  RENDER_BUILD_GLES = true
198bf80f4bSopenharmony_ci  RENDER_BUILD_VULKAN = true
208bf80f4bSopenharmony_ci  RENDER_EMBEDDED_ASSETS_ENABLED = true
218bf80f4bSopenharmony_ci  RENDER_ROFS = "rofsRndr"
228bf80f4bSopenharmony_ci}
238bf80f4bSopenharmony_ci
248bf80f4bSopenharmony_ciconfig("lume_render_api") {
258bf80f4bSopenharmony_ci  include_dirs = [ "api" ]
268bf80f4bSopenharmony_ci
278bf80f4bSopenharmony_ci  defines = []
288bf80f4bSopenharmony_ci
298bf80f4bSopenharmony_ci  if (BUILDTYPE == "Release") {
308bf80f4bSopenharmony_ci    defines += [ "PLUGIN_LOG_NO_DEBUG=0" ]
318bf80f4bSopenharmony_ci  }
328bf80f4bSopenharmony_ci
338bf80f4bSopenharmony_ci  if (BUILDTYPE == "MinSizeRel") {
348bf80f4bSopenharmony_ci    defines += [ "PLUGIN_LOG_NO_DEBUG=0" ]
358bf80f4bSopenharmony_ci  }
368bf80f4bSopenharmony_ci
378bf80f4bSopenharmony_ci  if (BUILDTYPE == "RelWithDebInfo") {
388bf80f4bSopenharmony_ci    defines += [ "PLUGIN_LOG_NO_DEBUG=0" ]
398bf80f4bSopenharmony_ci  }
408bf80f4bSopenharmony_ci
418bf80f4bSopenharmony_ci  if (LUME_OHOS_BUILD) {
428bf80f4bSopenharmony_ci    defines += [ "__OHOS_PLATFORM__" ]
438bf80f4bSopenharmony_ci  }
448bf80f4bSopenharmony_ci
458bf80f4bSopenharmony_ci  if (LUME_OHOS_BUILD && RENDER_BUILD_VULKAN) {
468bf80f4bSopenharmony_ci    include_dirs += [
478bf80f4bSopenharmony_ci      "src/vulkan/ohos",
488bf80f4bSopenharmony_ci      #"//third_party/skia/third_party/vulkanmemoryallocator/include"
498bf80f4bSopenharmony_ci    ]
508bf80f4bSopenharmony_ci  }
518bf80f4bSopenharmony_ci}
528bf80f4bSopenharmony_ci
538bf80f4bSopenharmony_ciconfig("lume_render_config") {
548bf80f4bSopenharmony_ci  include_dirs = [
558bf80f4bSopenharmony_ci    "3rdparty/",
568bf80f4bSopenharmony_ci    "src/",
578bf80f4bSopenharmony_ci  ]
588bf80f4bSopenharmony_ci
598bf80f4bSopenharmony_ci  defines = [
608bf80f4bSopenharmony_ci    "RENDER_PUBLIC=__attribute__((visibility(\"default\")))",
618bf80f4bSopenharmony_ci    "RENDER_DEV_ENABLED=0",
628bf80f4bSopenharmony_ci    "RENDER_PERF_ENABLED=0",
638bf80f4bSopenharmony_ci    "RENDER_TESTS_ENABLED=0",
648bf80f4bSopenharmony_ci    "RENDER_LOG_TO_CONSOLE=1",
658bf80f4bSopenharmony_ci    "RENDER_LOG_TO_FILE",
668bf80f4bSopenharmony_ci    "RENDER_LOG_TO_DEBUG_OUTPUT=0",
678bf80f4bSopenharmony_ci    "RENDER_VULKAN_VALIDATION_ENABLED=0",
688bf80f4bSopenharmony_ci    "RENDER_DEBUG_GPU_RESOURCE_IDS=0",
698bf80f4bSopenharmony_ci    "RENDER_DEBUG_MARKERS_ENABLED=0",
708bf80f4bSopenharmony_ci    "RENDER_DEBUG_COMMAND_MARKERS_ENABLED=0",
718bf80f4bSopenharmony_ci    "RENDER_GL_FLIP_Y_SWAPCHAIN=0",
728bf80f4bSopenharmony_ci    "RENDER_GL_DEBUG=0",
738bf80f4bSopenharmony_ci    "RENDER_GPU_TIMESTAMP_QUERIES_ENABLED=0",
748bf80f4bSopenharmony_ci    "RENDER_VULKAN_RT_ENABLED=0",
758bf80f4bSopenharmony_ci    "RENDER_BUILDTYPE=${BUILDTYPE}",
768bf80f4bSopenharmony_ci    "CORE_USE_COMPILER_GENERATED_STATIC_LIST=1",
778bf80f4bSopenharmony_ci    "CORE_STATIC_PLUGIN_HEADER=${CORE_STATIC_PLUGIN_HEADER}",
788bf80f4bSopenharmony_ci  ]
798bf80f4bSopenharmony_ci
808bf80f4bSopenharmony_ci  if (RENDER_EMBEDDED_ASSETS_ENABLED) {
818bf80f4bSopenharmony_ci    defines += [ "RENDER_EMBEDDED_ASSETS_ENABLED=1" ]
828bf80f4bSopenharmony_ci  }
838bf80f4bSopenharmony_ci
848bf80f4bSopenharmony_ci  if (RENDER_BUILD_GLES) {
858bf80f4bSopenharmony_ci    defines += [ "RENDER_HAS_GLES_BACKEND=1" ]
868bf80f4bSopenharmony_ci  }
878bf80f4bSopenharmony_ci
888bf80f4bSopenharmony_ci  if (RENDER_BUILD_VULKAN) {
898bf80f4bSopenharmony_ci    defines += [
908bf80f4bSopenharmony_ci      "RENDER_HAS_VULKAN_BACKEND=1",
918bf80f4bSopenharmony_ci      "VMA_STATS_STRING_ENABLED=0",
928bf80f4bSopenharmony_ci      "VMA_STATIC_VULKAN_FUNCTIONS=0",
938bf80f4bSopenharmony_ci
948bf80f4bSopenharmony_ci      #"USE_NEW_VMA=0"
958bf80f4bSopenharmony_ci    ]
968bf80f4bSopenharmony_ci
978bf80f4bSopenharmony_ci    if (LUME_OHOS_BUILD) {
988bf80f4bSopenharmony_ci      defines += [ "RENDER_VULKAN_VALIDATION_ENABLE_WARNINGS=0" ]
998bf80f4bSopenharmony_ci    }
1008bf80f4bSopenharmony_ci  }
1018bf80f4bSopenharmony_ci  defines += [ "RENDER_PUBLIC=__attribute__((visibility(\"default\")))" ]
1028bf80f4bSopenharmony_ci
1038bf80f4bSopenharmony_ci  ldflags = [ "-Wl,--undefined=AGPRender_StaticPlugin" ]
1048bf80f4bSopenharmony_ci
1058bf80f4bSopenharmony_ci  cflags = [
1068bf80f4bSopenharmony_ci    "-Wno-nullability-completeness",
1078bf80f4bSopenharmony_ci    "-Wno-ignored-qualifiers",
1088bf80f4bSopenharmony_ci    "-Wno-switch",
1098bf80f4bSopenharmony_ci  ]
1108bf80f4bSopenharmony_ci}
1118bf80f4bSopenharmony_cigroup("libvulkan") {
1128bf80f4bSopenharmony_ci  #public_deps = [ "${LIB_VULKAN_3D}" ]
1138bf80f4bSopenharmony_ci  #public_deps = libvulkan3D
1148bf80f4bSopenharmony_ci  external_deps = [ "vulkan-loader:vulkan_loader" ]
1158bf80f4bSopenharmony_ci}
1168bf80f4bSopenharmony_ci
1178bf80f4bSopenharmony_ciohos_source_set("lume_render_src") {
1188bf80f4bSopenharmony_ci  public_configs = [
1198bf80f4bSopenharmony_ci    ":lume_render_config",
1208bf80f4bSopenharmony_ci    ":lume_render_api",
1218bf80f4bSopenharmony_ci    "${LUME_CORE_PATH}:lume_base_api",
1228bf80f4bSopenharmony_ci    "${LUME_CORE_PATH}:lume_engine_api",
1238bf80f4bSopenharmony_ci    "${LUME_CORE_PATH}:lume_default",
1248bf80f4bSopenharmony_ci    "${LUME_CORE_PATH}:lume_component_help_config",
1258bf80f4bSopenharmony_ci  ]
1268bf80f4bSopenharmony_ci
1278bf80f4bSopenharmony_ci  sources = [
1288bf80f4bSopenharmony_ci    "src/default_engine_constants.h",
1298bf80f4bSopenharmony_ci    "src/device/device.cpp",
1308bf80f4bSopenharmony_ci    "src/device/device.h",
1318bf80f4bSopenharmony_ci
1328bf80f4bSopenharmony_ci    # "src/device/generic/platform_hardware_buffer.cpp",
1338bf80f4bSopenharmony_ci    "src/device/gpu_acceleration_structure.h",
1348bf80f4bSopenharmony_ci    "src/device/gpu_buffer.h",
1358bf80f4bSopenharmony_ci    "src/device/gpu_image.h",
1368bf80f4bSopenharmony_ci    "src/device/gpu_program.h",
1378bf80f4bSopenharmony_ci    "src/device/gpu_program_util.cpp",
1388bf80f4bSopenharmony_ci    "src/device/gpu_program_util.h",
1398bf80f4bSopenharmony_ci    "src/device/gpu_resource_cache.cpp",
1408bf80f4bSopenharmony_ci    "src/device/gpu_resource_cache.h",
1418bf80f4bSopenharmony_ci    "src/device/gpu_resource_desc_flag_validation.h",
1428bf80f4bSopenharmony_ci    "src/device/gpu_resource_handle_util.cpp",
1438bf80f4bSopenharmony_ci    "src/device/gpu_resource_handle_util.h",
1448bf80f4bSopenharmony_ci    "src/device/gpu_resource_manager.cpp",
1458bf80f4bSopenharmony_ci    "src/device/gpu_resource_manager.h",
1468bf80f4bSopenharmony_ci    "src/device/gpu_resource_manager_base.h",
1478bf80f4bSopenharmony_ci    "src/device/gpu_resource_manager_base.inl",
1488bf80f4bSopenharmony_ci    "src/device/gpu_resource_util.cpp",
1498bf80f4bSopenharmony_ci    "src/device/gpu_resource_util.h",
1508bf80f4bSopenharmony_ci    "src/device/gpu_sampler.h",
1518bf80f4bSopenharmony_ci    "src/device/gpu_semaphore.h",
1528bf80f4bSopenharmony_ci    "src/device/pipeline_state_object.h",
1538bf80f4bSopenharmony_ci    "src/device/render_frame_sync.h",
1548bf80f4bSopenharmony_ci    "src/device/shader_manager.cpp",
1558bf80f4bSopenharmony_ci    "src/device/shader_manager.h",
1568bf80f4bSopenharmony_ci    "src/device/shader_module.h",
1578bf80f4bSopenharmony_ci    "src/device/shader_pipeline_binder.cpp",
1588bf80f4bSopenharmony_ci    "src/device/shader_pipeline_binder.h",
1598bf80f4bSopenharmony_ci    "src/device/swapchain.h",
1608bf80f4bSopenharmony_ci    "src/loader/json_format_serialization.h",
1618bf80f4bSopenharmony_ci    "src/loader/json_util.h",
1628bf80f4bSopenharmony_ci    "src/loader/pipeline_layout_loader.cpp",
1638bf80f4bSopenharmony_ci    "src/loader/pipeline_layout_loader.h",
1648bf80f4bSopenharmony_ci    "src/loader/render_data_configuration_loader.cpp",
1658bf80f4bSopenharmony_ci    "src/loader/render_data_configuration_loader.h",
1668bf80f4bSopenharmony_ci    "src/loader/render_data_loader.cpp",
1678bf80f4bSopenharmony_ci    "src/loader/render_data_loader.h",
1688bf80f4bSopenharmony_ci    "src/loader/render_node_graph_loader.cpp",
1698bf80f4bSopenharmony_ci    "src/loader/render_node_graph_loader.h",
1708bf80f4bSopenharmony_ci    "src/loader/shader_data_loader.cpp",
1718bf80f4bSopenharmony_ci    "src/loader/shader_data_loader.h",
1728bf80f4bSopenharmony_ci    "src/loader/shader_loader.cpp",
1738bf80f4bSopenharmony_ci    "src/loader/shader_loader.h",
1748bf80f4bSopenharmony_ci    "src/loader/shader_state_loader.cpp",
1758bf80f4bSopenharmony_ci    "src/loader/shader_state_loader.h",
1768bf80f4bSopenharmony_ci    "src/loader/shader_state_loader_util.cpp",
1778bf80f4bSopenharmony_ci    "src/loader/shader_state_loader_util.h",
1788bf80f4bSopenharmony_ci    "src/loader/vertex_input_declaration_loader.cpp",
1798bf80f4bSopenharmony_ci    "src/loader/vertex_input_declaration_loader.h",
1808bf80f4bSopenharmony_ci    "src/perf/cpu_perf_scope.h",
1818bf80f4bSopenharmony_ci    "src/perf/cpu_timer.cpp",
1828bf80f4bSopenharmony_ci    "src/perf/cpu_timer.h",
1838bf80f4bSopenharmony_ci    "src/perf/gpu_query.h",
1848bf80f4bSopenharmony_ci    "src/perf/gpu_query_manager.cpp",
1858bf80f4bSopenharmony_ci    "src/perf/gpu_query_manager.h",
1868bf80f4bSopenharmony_ci    "src/plugin/static_plugin.cpp",
1878bf80f4bSopenharmony_ci    "src/render_backend.h",
1888bf80f4bSopenharmony_ci    "src/render_context.cpp",
1898bf80f4bSopenharmony_ci    "src/render_context.h",
1908bf80f4bSopenharmony_ci    "src/render_graph.cpp",
1918bf80f4bSopenharmony_ci    "src/render_graph.h",
1928bf80f4bSopenharmony_ci    "src/renderer.cpp",
1938bf80f4bSopenharmony_ci    "src/renderer.h",
1948bf80f4bSopenharmony_ci    "src/resource_handle_impl.cpp",
1958bf80f4bSopenharmony_ci    "src/resource_handle_impl.h",
1968bf80f4bSopenharmony_ci    "version.cpp",
1978bf80f4bSopenharmony_ci
1988bf80f4bSopenharmony_ci    #"src/plugin/static_registry.cpp",
1998bf80f4bSopenharmony_ci
2008bf80f4bSopenharmony_ci    "src/datastore/render_data_store_default_acceleration_structure_staging.cpp",
2018bf80f4bSopenharmony_ci    "src/datastore/render_data_store_default_acceleration_structure_staging.h",
2028bf80f4bSopenharmony_ci    "src/datastore/render_data_store_default_gpu_resource_data_copy.cpp",
2038bf80f4bSopenharmony_ci    "src/datastore/render_data_store_default_gpu_resource_data_copy.h",
2048bf80f4bSopenharmony_ci    "src/datastore/render_data_store_default_staging.cpp",
2058bf80f4bSopenharmony_ci    "src/datastore/render_data_store_default_staging.h",
2068bf80f4bSopenharmony_ci    "src/datastore/render_data_store_manager.cpp",
2078bf80f4bSopenharmony_ci    "src/datastore/render_data_store_manager.h",
2088bf80f4bSopenharmony_ci    "src/datastore/render_data_store_pod.cpp",
2098bf80f4bSopenharmony_ci    "src/datastore/render_data_store_pod.h",
2108bf80f4bSopenharmony_ci    "src/datastore/render_data_store_post_process.cpp",
2118bf80f4bSopenharmony_ci    "src/datastore/render_data_store_post_process.h",
2128bf80f4bSopenharmony_ci    "src/datastore/render_data_store_shader_passes.cpp",
2138bf80f4bSopenharmony_ci    "src/node/core_render_node_factory.cpp",
2148bf80f4bSopenharmony_ci    "src/node/core_render_node_factory.h",
2158bf80f4bSopenharmony_ci    "src/node/render_bloom.cpp",
2168bf80f4bSopenharmony_ci    "src/node/render_bloom.h",
2178bf80f4bSopenharmony_ci    "src/node/render_blur.cpp",
2188bf80f4bSopenharmony_ci    "src/node/render_blur.h",
2198bf80f4bSopenharmony_ci    "src/node/render_copy.cpp",
2208bf80f4bSopenharmony_ci    "src/node/render_copy.h",
2218bf80f4bSopenharmony_ci    "src/node/render_motion_blur.cpp",
2228bf80f4bSopenharmony_ci    "src/node/render_motion_blur.h",
2238bf80f4bSopenharmony_ci    "src/node/render_node_back_buffer.cpp",
2248bf80f4bSopenharmony_ci    "src/node/render_node_back_buffer.h",
2258bf80f4bSopenharmony_ci    "src/node/render_node_bloom.cpp",
2268bf80f4bSopenharmony_ci    "src/node/render_node_bloom.h",
2278bf80f4bSopenharmony_ci    "src/node/render_node_combined_post_process.cpp",
2288bf80f4bSopenharmony_ci    "src/node/render_node_combined_post_process.h",
2298bf80f4bSopenharmony_ci    "src/node/render_node_compute_generic.cpp",
2308bf80f4bSopenharmony_ci    "src/node/render_node_compute_generic.h",
2318bf80f4bSopenharmony_ci    "src/node/render_node_create_gpu_buffers.cpp",
2328bf80f4bSopenharmony_ci    "src/node/render_node_create_gpu_buffers.h",
2338bf80f4bSopenharmony_ci    "src/node/render_node_create_gpu_images.cpp",
2348bf80f4bSopenharmony_ci    "src/node/render_node_create_gpu_images.h",
2358bf80f4bSopenharmony_ci    "src/node/render_node_default_acceleration_structure_staging.cpp",
2368bf80f4bSopenharmony_ci    "src/node/render_node_default_acceleration_structure_staging.h",
2378bf80f4bSopenharmony_ci    "src/node/render_node_end_frame_staging.cpp",
2388bf80f4bSopenharmony_ci    "src/node/render_node_end_frame_staging.h",
2398bf80f4bSopenharmony_ci    "src/node/render_node_fullscreen_generic.cpp",
2408bf80f4bSopenharmony_ci    "src/node/render_node_fullscreen_generic.h",
2418bf80f4bSopenharmony_ci    "src/node/render_node_mip_chain_post_process.cpp",
2428bf80f4bSopenharmony_ci    "src/node/render_node_mip_chain_post_process.h",
2438bf80f4bSopenharmony_ci    "src/node/render_node_shader_passes_generic.cpp",
2448bf80f4bSopenharmony_ci    "src/node/render_node_shader_passes_generic.h",
2458bf80f4bSopenharmony_ci    "src/node/render_node_single_post_process.cpp",
2468bf80f4bSopenharmony_ci    "src/node/render_node_single_post_process.h",
2478bf80f4bSopenharmony_ci    "src/node/render_node_staging.cpp",
2488bf80f4bSopenharmony_ci    "src/node/render_node_staging.h",
2498bf80f4bSopenharmony_ci    "src/node/render_staging.cpp",
2508bf80f4bSopenharmony_ci    "src/node/render_staging.h",
2518bf80f4bSopenharmony_ci    "src/nodecontext/node_context_descriptor_set_manager.cpp",
2528bf80f4bSopenharmony_ci    "src/nodecontext/node_context_descriptor_set_manager.h",
2538bf80f4bSopenharmony_ci    "src/nodecontext/node_context_pool_manager.h",
2548bf80f4bSopenharmony_ci    "src/nodecontext/node_context_pso_manager.cpp",
2558bf80f4bSopenharmony_ci    "src/nodecontext/node_context_pso_manager.h",
2568bf80f4bSopenharmony_ci    "src/nodecontext/pipeline_descriptor_set_binder.cpp",
2578bf80f4bSopenharmony_ci    "src/nodecontext/pipeline_descriptor_set_binder.h",
2588bf80f4bSopenharmony_ci    "src/nodecontext/render_barrier_list.cpp",
2598bf80f4bSopenharmony_ci    "src/nodecontext/render_barrier_list.h",
2608bf80f4bSopenharmony_ci    "src/nodecontext/render_command_list.cpp",
2618bf80f4bSopenharmony_ci    "src/nodecontext/render_command_list.h",
2628bf80f4bSopenharmony_ci    "src/nodecontext/render_node_context_manager.cpp",
2638bf80f4bSopenharmony_ci    "src/nodecontext/render_node_context_manager.h",
2648bf80f4bSopenharmony_ci    "src/nodecontext/render_node_graph_manager.cpp",
2658bf80f4bSopenharmony_ci    "src/nodecontext/render_node_graph_manager.h",
2668bf80f4bSopenharmony_ci    "src/nodecontext/render_node_graph_node_store.h",
2678bf80f4bSopenharmony_ci    "src/nodecontext/render_node_graph_share_manager.cpp",
2688bf80f4bSopenharmony_ci    "src/nodecontext/render_node_graph_share_manager.h",
2698bf80f4bSopenharmony_ci    "src/nodecontext/render_node_manager.cpp",
2708bf80f4bSopenharmony_ci    "src/nodecontext/render_node_manager.h",
2718bf80f4bSopenharmony_ci    "src/nodecontext/render_node_parser_util.cpp",
2728bf80f4bSopenharmony_ci    "src/nodecontext/render_node_parser_util.h",
2738bf80f4bSopenharmony_ci    "src/nodecontext/render_node_post_process_util.cpp",
2748bf80f4bSopenharmony_ci    "src/nodecontext/render_node_post_process_util.h",
2758bf80f4bSopenharmony_ci    "src/nodecontext/render_node_util.cpp",
2768bf80f4bSopenharmony_ci    "src/nodecontext/render_node_util.h",
2778bf80f4bSopenharmony_ci    "src/util/linear_allocator.h",
2788bf80f4bSopenharmony_ci    "src/util/log.h",
2798bf80f4bSopenharmony_ci    "src/util/property_util.cpp",
2808bf80f4bSopenharmony_ci    "src/util/render_frame_util.cpp",
2818bf80f4bSopenharmony_ci    "src/util/render_frame_util.h",
2828bf80f4bSopenharmony_ci    "src/util/render_util.cpp",
2838bf80f4bSopenharmony_ci    "src/util/render_util.h",
2848bf80f4bSopenharmony_ci    "src/util/string_util.h",
2858bf80f4bSopenharmony_ci  ]
2868bf80f4bSopenharmony_ci
2878bf80f4bSopenharmony_ci  if (RENDER_BUILD_GLES) {
2888bf80f4bSopenharmony_ci    sources += [
2898bf80f4bSopenharmony_ci      "src/gles/device_gles.cpp",
2908bf80f4bSopenharmony_ci      "src/gles/device_gles.h",
2918bf80f4bSopenharmony_ci      "src/gles/egl_state.cpp",
2928bf80f4bSopenharmony_ci      "src/gles/egl_state.h",
2938bf80f4bSopenharmony_ci      "src/gles/generic/platform_device_gles.cpp",
2948bf80f4bSopenharmony_ci      "src/gles/gl_functions.h",
2958bf80f4bSopenharmony_ci      "src/gles/gpu_buffer_gles.cpp",
2968bf80f4bSopenharmony_ci      "src/gles/gpu_buffer_gles.h",
2978bf80f4bSopenharmony_ci      "src/gles/gpu_image_gles.cpp",
2988bf80f4bSopenharmony_ci      "src/gles/gpu_image_gles.h",
2998bf80f4bSopenharmony_ci      "src/gles/gpu_program_gles.cpp",
3008bf80f4bSopenharmony_ci      "src/gles/gpu_program_gles.h",
3018bf80f4bSopenharmony_ci      "src/gles/gpu_query_gles.cpp",
3028bf80f4bSopenharmony_ci      "src/gles/gpu_query_gles.h",
3038bf80f4bSopenharmony_ci      "src/gles/gpu_resource_util_gles.cpp",
3048bf80f4bSopenharmony_ci      "src/gles/gpu_resource_util_gles.h",
3058bf80f4bSopenharmony_ci      "src/gles/gpu_sampler_gles.cpp",
3068bf80f4bSopenharmony_ci      "src/gles/gpu_sampler_gles.h",
3078bf80f4bSopenharmony_ci      "src/gles/gpu_semaphore_gles.cpp",
3088bf80f4bSopenharmony_ci      "src/gles/node_context_descriptor_set_manager_gles.cpp",
3098bf80f4bSopenharmony_ci      "src/gles/node_context_descriptor_set_manager_gles.h",
3108bf80f4bSopenharmony_ci      "src/gles/node_context_pool_manager_gles.cpp",
3118bf80f4bSopenharmony_ci      "src/gles/node_context_pool_manager_gles.h",
3128bf80f4bSopenharmony_ci      "src/gles/pipeline_state_object_gles.cpp",
3138bf80f4bSopenharmony_ci      "src/gles/pipeline_state_object_gles.h",
3148bf80f4bSopenharmony_ci      "src/gles/render_backend_gles.cpp",
3158bf80f4bSopenharmony_ci      "src/gles/render_backend_gles.h",
3168bf80f4bSopenharmony_ci      "src/gles/render_frame_sync_gles.cpp",
3178bf80f4bSopenharmony_ci      "src/gles/render_frame_sync_gles.h",
3188bf80f4bSopenharmony_ci      "src/gles/shader_module_gles.cpp",
3198bf80f4bSopenharmony_ci      "src/gles/shader_module_gles.h",
3208bf80f4bSopenharmony_ci      "src/gles/spirv_cross_helper_structs_gles.h",
3218bf80f4bSopenharmony_ci      "src/gles/spirv_cross_helpers_gles.cpp",
3228bf80f4bSopenharmony_ci      "src/gles/spirv_cross_helpers_gles.h",
3238bf80f4bSopenharmony_ci      "src/gles/surface_information.h",
3248bf80f4bSopenharmony_ci      "src/gles/swapchain_gles.cpp",
3258bf80f4bSopenharmony_ci      "src/gles/swapchain_gles.h",
3268bf80f4bSopenharmony_ci      "src/gles/wgl_state.cpp",
3278bf80f4bSopenharmony_ci      "src/gles/wgl_state.h",
3288bf80f4bSopenharmony_ci    ]
3298bf80f4bSopenharmony_ci  }
3308bf80f4bSopenharmony_ci
3318bf80f4bSopenharmony_ci  if (RENDER_BUILD_VULKAN) {
3328bf80f4bSopenharmony_ci    sources += [
3338bf80f4bSopenharmony_ci      "src/vulkan/create_functions_vk.cpp",
3348bf80f4bSopenharmony_ci      "src/vulkan/create_functions_vk.h",
3358bf80f4bSopenharmony_ci      "src/vulkan/device_vk.cpp",
3368bf80f4bSopenharmony_ci      "src/vulkan/device_vk.h",
3378bf80f4bSopenharmony_ci      "src/vulkan/gpu_buffer_vk.cpp",
3388bf80f4bSopenharmony_ci      "src/vulkan/gpu_buffer_vk.h",
3398bf80f4bSopenharmony_ci      "src/vulkan/gpu_image_vk.cpp",
3408bf80f4bSopenharmony_ci      "src/vulkan/gpu_image_vk.h",
3418bf80f4bSopenharmony_ci      "src/vulkan/gpu_memory_allocator_vk.cpp",
3428bf80f4bSopenharmony_ci      "src/vulkan/gpu_memory_allocator_vk.h",
3438bf80f4bSopenharmony_ci      "src/vulkan/gpu_program_vk.cpp",
3448bf80f4bSopenharmony_ci      "src/vulkan/gpu_program_vk.h",
3458bf80f4bSopenharmony_ci      "src/vulkan/gpu_query_vk.cpp",
3468bf80f4bSopenharmony_ci      "src/vulkan/gpu_query_vk.h",
3478bf80f4bSopenharmony_ci      "src/vulkan/gpu_resource_util_vk.cpp",
3488bf80f4bSopenharmony_ci      "src/vulkan/gpu_resource_util_vk.h",
3498bf80f4bSopenharmony_ci      "src/vulkan/gpu_sampler_vk.cpp",
3508bf80f4bSopenharmony_ci      "src/vulkan/gpu_sampler_vk.h",
3518bf80f4bSopenharmony_ci      "src/vulkan/gpu_semaphore_vk.cpp",
3528bf80f4bSopenharmony_ci      "src/vulkan/gpu_semaphore_vk.h",
3538bf80f4bSopenharmony_ci      "src/vulkan/node_context_descriptor_set_manager_vk.cpp",
3548bf80f4bSopenharmony_ci      "src/vulkan/node_context_descriptor_set_manager_vk.h",
3558bf80f4bSopenharmony_ci      "src/vulkan/node_context_pool_manager_vk.cpp",
3568bf80f4bSopenharmony_ci      "src/vulkan/node_context_pool_manager_vk.h",
3578bf80f4bSopenharmony_ci      "src/vulkan/pipeline_create_functions_vk.cpp",
3588bf80f4bSopenharmony_ci      "src/vulkan/pipeline_create_functions_vk.h",
3598bf80f4bSopenharmony_ci      "src/vulkan/pipeline_state_object_vk.cpp",
3608bf80f4bSopenharmony_ci      "src/vulkan/pipeline_state_object_vk.h",
3618bf80f4bSopenharmony_ci      "src/vulkan/platform_hardware_buffer_util_vk.cpp",
3628bf80f4bSopenharmony_ci      "src/vulkan/platform_hardware_buffer_util_vk.h",
3638bf80f4bSopenharmony_ci      "src/vulkan/render_backend_vk.cpp",
3648bf80f4bSopenharmony_ci      "src/vulkan/render_backend_vk.h",
3658bf80f4bSopenharmony_ci      "src/vulkan/render_frame_sync_vk.cpp",
3668bf80f4bSopenharmony_ci      "src/vulkan/render_frame_sync_vk.h",
3678bf80f4bSopenharmony_ci      "src/vulkan/shader_module_vk.cpp",
3688bf80f4bSopenharmony_ci      "src/vulkan/shader_module_vk.h",
3698bf80f4bSopenharmony_ci      "src/vulkan/swapchain_vk.cpp",
3708bf80f4bSopenharmony_ci      "src/vulkan/swapchain_vk.h",
3718bf80f4bSopenharmony_ci      "src/vulkan/validate_vk.h",
3728bf80f4bSopenharmony_ci    ]
3738bf80f4bSopenharmony_ci
3748bf80f4bSopenharmony_ci    if (LUME_OHOS_BUILD) {
3758bf80f4bSopenharmony_ci      # platform source
3768bf80f4bSopenharmony_ci      sources += [
3778bf80f4bSopenharmony_ci        "src/device/ohos/platform_hardware_buffer.cpp",
3788bf80f4bSopenharmony_ci        "src/vulkan/ohos/platform_create_functions_vk.cpp",
3798bf80f4bSopenharmony_ci        "src/vulkan/ohos/platform_device_vk.cpp",
3808bf80f4bSopenharmony_ci        "src/vulkan/ohos/platform_gpu_image_vk.cpp",
3818bf80f4bSopenharmony_ci        "src/vulkan/ohos/platform_hardware_buffer_util.cpp",
3828bf80f4bSopenharmony_ci        "src/vulkan/ohos/platform_vk.cpp",
3838bf80f4bSopenharmony_ci        "src/vulkan/ohos/platform_vk.h",
3848bf80f4bSopenharmony_ci      ]
3858bf80f4bSopenharmony_ci    }
3868bf80f4bSopenharmony_ci  }
3878bf80f4bSopenharmony_ci  external_deps = [
3888bf80f4bSopenharmony_ci    "c_utils:utils",
3898bf80f4bSopenharmony_ci    "graphic_2d:EGL",
3908bf80f4bSopenharmony_ci    "graphic_2d:GLESv3",
3918bf80f4bSopenharmony_ci  ]
3928bf80f4bSopenharmony_ci
3938bf80f4bSopenharmony_ci  if (RENDER_BUILD_VULKAN) {
3948bf80f4bSopenharmony_ci    deps = [ ":libvulkan" ]
3958bf80f4bSopenharmony_ci
3968bf80f4bSopenharmony_ci    #public_deps = [ "//third_party/vulkan-headers:vulkan_headers" ]
3978bf80f4bSopenharmony_ci    external_deps += [ "vulkan-headers:vulkan_headers" ]
3988bf80f4bSopenharmony_ci  }
3998bf80f4bSopenharmony_ci
4008bf80f4bSopenharmony_ci  part_name = "graphic_3d"
4018bf80f4bSopenharmony_ci  subsystem_name = "graphic"
4028bf80f4bSopenharmony_ci}
4038bf80f4bSopenharmony_ci
4048bf80f4bSopenharmony_cilume_compile_shader("lume_render_compile_shader") {
4058bf80f4bSopenharmony_ci  script = "${LUME_CORE_PATH}/tools/CompilerShader.sh"
4068bf80f4bSopenharmony_ci  outputs = [ "$target_gen_dir" ]
4078bf80f4bSopenharmony_ci  tool_path = "$target_gen_dir"
4088bf80f4bSopenharmony_ci  dest_gen_path = "$target_gen_dir/assets"
4098bf80f4bSopenharmony_ci  asset_path = rebase_path("./assets/render", root_build_dir)
4108bf80f4bSopenharmony_ci  shader_path = "${dest_gen_path}/shaders"
4118bf80f4bSopenharmony_ci  include_path = rebase_path("api", root_build_dir)
4128bf80f4bSopenharmony_ci  compileShader_deps =
4138bf80f4bSopenharmony_ci      [ "${LUME_BINARY_PATH}/LumeShaderCompiler:lume_binary_shader_compile" ]
4148bf80f4bSopenharmony_ci}
4158bf80f4bSopenharmony_ci
4168bf80f4bSopenharmony_cilume_rofs("lume_render_rofs") {
4178bf80f4bSopenharmony_ci  output_obj = ""
4188bf80f4bSopenharmony_ci  if (target_cpu == "arm") {
4198bf80f4bSopenharmony_ci    output_obj = "${RENDER_ROFS}_32.o"
4208bf80f4bSopenharmony_ci  }
4218bf80f4bSopenharmony_ci
4228bf80f4bSopenharmony_ci  if (target_cpu == "arm64") {
4238bf80f4bSopenharmony_ci    output_obj = "${RENDER_ROFS}_64.o"
4248bf80f4bSopenharmony_ci  }
4258bf80f4bSopenharmony_ci
4268bf80f4bSopenharmony_ci  outputs = "${target_gen_dir}/assets/${output_obj}"
4278bf80f4bSopenharmony_ci
4288bf80f4bSopenharmony_ci  tool_path = "$target_gen_dir"
4298bf80f4bSopenharmony_ci  root = "/"
4308bf80f4bSopenharmony_ci  bin_name = "BINARYDATAFORRENDER"
4318bf80f4bSopenharmony_ci  size_name = "SIZEOFDATAFORRENDER"
4328bf80f4bSopenharmony_ci  base_name = RENDER_ROFS
4338bf80f4bSopenharmony_ci  script = "${LUME_CORE_PATH}/tools/CompilerAsset.sh"
4348bf80f4bSopenharmony_ci  copy_path = "$target_gen_dir/assets"
4358bf80f4bSopenharmony_ci  compileShader_deps = [
4368bf80f4bSopenharmony_ci    ":lume_render_compile_shader",
4378bf80f4bSopenharmony_ci    "${LUME_BINARY_PATH}/lumeassetcompiler:lume_binary_assets_compile",
4388bf80f4bSopenharmony_ci  ]
4398bf80f4bSopenharmony_ci  file_extension = "\".spv;.json;.lsb;.shader;.shadergs;.shadervid;.shaderpl;.rng;.gl;.gles\""
4408bf80f4bSopenharmony_ci}
4418bf80f4bSopenharmony_ci
4428bf80f4bSopenharmony_cisource_set("lume_render_rofs_obj") {
4438bf80f4bSopenharmony_ci  output_obj = ""
4448bf80f4bSopenharmony_ci  if (target_cpu == "arm") {
4458bf80f4bSopenharmony_ci    output_obj = "${RENDER_ROFS}_32.o"
4468bf80f4bSopenharmony_ci  }
4478bf80f4bSopenharmony_ci
4488bf80f4bSopenharmony_ci  if (target_cpu == "arm64") {
4498bf80f4bSopenharmony_ci    output_obj = "${RENDER_ROFS}_64.o"
4508bf80f4bSopenharmony_ci  }
4518bf80f4bSopenharmony_ci
4528bf80f4bSopenharmony_ci  sources = [ "${target_gen_dir}/assets/${output_obj}" ]
4538bf80f4bSopenharmony_ci  deps = [ ":lume_render_rofs" ]
4548bf80f4bSopenharmony_ci}
4558bf80f4bSopenharmony_ci
4568bf80f4bSopenharmony_ciohos_static_library("libAGPRender") {
4578bf80f4bSopenharmony_ci  public_deps = [ ":lume_render_src" ]
4588bf80f4bSopenharmony_ci
4598bf80f4bSopenharmony_ci  if (RENDER_EMBEDDED_ASSETS_ENABLED) {
4608bf80f4bSopenharmony_ci    deps = [ ":lume_render_rofs_obj" ]
4618bf80f4bSopenharmony_ci  }
4628bf80f4bSopenharmony_ci  part_name = "graphic_3d"
4638bf80f4bSopenharmony_ci  subsystem_name = "graphic"
4648bf80f4bSopenharmony_ci}
4658bf80f4bSopenharmony_ci
4668bf80f4bSopenharmony_ciconfig("lume_render_plugin_config") {
4678bf80f4bSopenharmony_ci  defines = [ "CORE_PLUGIN=1" ]
4688bf80f4bSopenharmony_ci}
4698bf80f4bSopenharmony_ci
4708bf80f4bSopenharmony_ciohos_source_set("lume_render_src_plugin") {
4718bf80f4bSopenharmony_ci  sources = [
4728bf80f4bSopenharmony_ci    "src/plugin/dynamic_plugin.cpp",
4738bf80f4bSopenharmony_ci    "src/plugin/dynamic_registry.cpp",
4748bf80f4bSopenharmony_ci    "src/util/json.cpp",
4758bf80f4bSopenharmony_ci  ]
4768bf80f4bSopenharmony_ci
4778bf80f4bSopenharmony_ci  configs = [
4788bf80f4bSopenharmony_ci    ":lume_render_plugin_config",
4798bf80f4bSopenharmony_ci    ":lume_render_api",
4808bf80f4bSopenharmony_ci    "${LUME_CORE_PATH}:lume_base_api",
4818bf80f4bSopenharmony_ci    "${LUME_CORE_PATH}:lume_engine_api",
4828bf80f4bSopenharmony_ci    "${LUME_CORE_PATH}:lume_default",
4838bf80f4bSopenharmony_ci  ]
4848bf80f4bSopenharmony_ci
4858bf80f4bSopenharmony_ci  part_name = "graphic_3d"
4868bf80f4bSopenharmony_ci  subsystem_name = "graphic"
4878bf80f4bSopenharmony_ci}
4888bf80f4bSopenharmony_ci
4898bf80f4bSopenharmony_ciohos_shared_library(LIB_RENDER) {
4908bf80f4bSopenharmony_ci  public_deps = [
4918bf80f4bSopenharmony_ci    ":libAGPRender",
4928bf80f4bSopenharmony_ci    ":lume_render_src_plugin",
4938bf80f4bSopenharmony_ci  ]
4948bf80f4bSopenharmony_ci
4958bf80f4bSopenharmony_ci  part_name = "graphic_3d"
4968bf80f4bSopenharmony_ci  subsystem_name = "graphic"
4978bf80f4bSopenharmony_ci}
498