load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") load("//:build_variables.bzl", "GFXSTREAM_HOST_COPTS", "GFXSTREAM_HOST_DEFINES") package( default_applicable_licenses = ["//:gfxstream_license"], default_visibility = ["//:gfxstream"], ) cc_library( name = "gfxstream_vulkan_headers", copts = GFXSTREAM_HOST_COPTS, defines = GFXSTREAM_HOST_DEFINES, includes = ["."], textual_hdrs = [ "vk_android_native_buffer_gfxstream.h", "vk_android_native_buffer_structure_type.h", "vulkan_gfxstream_structure_type.h", "vulkan_gfxstream.h", ], ) cc_library( name = "gfxstream_vulkan_server_headers", hdrs = [ "RenderThreadInfoVk.h", "VkDecoder.h", "VkDecoderContext.h", "VkDecoderGlobalState.h", "VkFormatUtils.h", "VkQsriTimeline.h", "VkSnapshotHandles.h", "VkUtils.h", "VulkanBoxedHandles.h", "VulkanDispatch.h", "VulkanHandleMapping.h", "VulkanHandles.h", "VulkanStream.h", "vk_fn_info.h", ], copts = GFXSTREAM_HOST_COPTS, defines = GFXSTREAM_HOST_DEFINES, includes = ["."], deps = [ ":gfxstream_vulkan_headers", "//common/base:gfxstream_common_base", "//common/logging:gfxstream_common_logging", "//host:gfxstream_backend_headers", "//host/backend:gfxstream_host_backend", "//host/decoder_common:gfxstream_host_decoder_common", "//host/features:gfxstream_host_features", "//host/health:gfxstream_host_health", "//host/iostream:gfxstream_host_iostream", "//host/metrics:gfxstream_host_metrics", "//host/vulkan/cereal:gfxstream_vulkan_cereal_headers", "//third_party/vulkan:gfxstream_vulkan_headers", ], ) cc_library( name = "gfxstream_vulkan_server", srcs = [ "BorrowedImageVk.cpp", "BufferVk.cpp", "ColorBufferVk.cpp", "CompositorVk.cpp", "DebugUtilsHelper.cpp", "DependencyGraph.cpp", "DeviceLostHelper.cpp", "DeviceOpTracker.cpp", "DisplaySurfaceVk.cpp", "DisplayVk.cpp", "PostWorkerVk.cpp", "RenderThreadInfoVk.cpp", "SwapChainStateVk.cpp", "VkAndroidNativeBuffer.cpp", "VkCommonOperations.cpp", "VkDecoder.cpp", "VkDecoderGlobalState.cpp", "VkDecoderSnapshot.cpp", "VkDecoderSnapshotUtils.cpp", "VkEmulatedPhysicalDeviceMemory.cpp", "VkEmulatedPhysicalDeviceQueue.cpp", "VkFormatUtils.cpp", "VkReconstruction.cpp", "VkUtils.cpp", "VulkanBoxedHandles.cpp", "VulkanDispatch.cpp", "VulkanHandleMapping.cpp", "VulkanStream.cpp", ], hdrs = [ "BorrowedImageVk.h", "BufferVk.h", "ColorBufferVk.h", "CompositorFragmentShader.h", "CompositorVertexShader.h", "CompositorVk.h", "DebugUtilsHelper.h", "DependencyGraph.h", "DeviceLostHelper.h", "DeviceOpTracker.h", "DisplaySurfaceVk.h", "DisplayVk.h", "GrallocDefs.h", "PostWorkerVk.h", "RenderThreadInfoVk.h", "SwapChainStateVk.h", "TrivialStream.h", "VkAndroidNativeBuffer.h", "VkCommonOperations.h", "VkDecoder.h", "VkDecoderContext.h", "VkDecoderGlobalState.h", "VkDecoderInternalStructs.h", "VkDecoderSnapshot.h", "VkDecoderSnapshotUtils.h", "VkEmulatedPhysicalDeviceMemory.h", "VkEmulatedPhysicalDeviceQueue.h", "VkFormatUtils.h", "VkQsriTimeline.h", "VkReconstruction.h", "VkSnapshotHandles.h", "VkUtils.h", "VulkanBoxedHandles.h", "VulkanDispatch.h", "VulkanHandleMapping.h", "VulkanHandles.h", "VulkanStream.h", "vk_fn_info.h", ], copts = GFXSTREAM_HOST_COPTS + [ "-Wno-return-type-c-linkage", "-Wno-extern-c-compat", "-Wno-unused-variable", ], defines = GFXSTREAM_HOST_DEFINES, includes = [ ".", "cereal", "cereal/common", ], textual_hdrs = [ "VkSubDecoder.cpp", ], deps = [ ":gfxstream_vulkan_headers", "//common/base:gfxstream_common_base", "//common/logging:gfxstream_common_logging", "//host:gfxstream_backend_headers", "//host:gfxstream_host_headers", "//host/backend:gfxstream_host_backend", "//host/compressed_textures:gfxstream_host_compressed_textures", "//host/decoder_common:gfxstream_host_decoder_common", "//host/features:gfxstream_host_features", "//host/gl:gfxstream_opengl_server_headers", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch_headers", "//host/health:gfxstream_host_health", "//host/iostream:gfxstream_host_iostream", "//host/library:gfxstream_host_library", "//host/metrics:gfxstream_host_metrics", "//host/renderdoc:gfxstream_host_renderdoc", "//host/tracing:gfxstream_host_tracing", "//host/vulkan/cereal:gfxstream_vulkan_cereal", "//host/vulkan/emulated_textures:gfxstream_host_vulkan_emulated_textures", "//third_party/glm", "//third_party/opengl:gfxstream_gles2_headers", "//third_party/opengl:gfxstream_gles3_headers", "//third_party/renderdoc", "//third_party/vulkan:gfxstream_vulkan_headers", ], ) cc_test( name = "gfxstream_compositorvk_tests", srcs = [ "CompositorVk_unittest.cpp", ], copts = GFXSTREAM_HOST_COPTS, data = [ "testdata/256x256_android.png", "testdata/256x256_android_with_transparency.png", "testdata/256x256_golden_blend_premultiplied.png", "testdata/256x256_golden_crop.png", "testdata/256x256_golden_multiple_layers.png", "testdata/256x256_golden_multiple_targets_0.png", "testdata/256x256_golden_multiple_targets_1.png", "testdata/256x256_golden_multiple_targets_2.png", "testdata/256x256_golden_multiple_targets_3.png", "testdata/256x256_golden_multiple_targets_4.png", "testdata/256x256_golden_multiple_targets_5.png", "testdata/256x256_golden_multiple_targets_6.png", "testdata/256x256_golden_multiple_targets_7.png", "testdata/256x256_golden_multiple_targets_8.png", "testdata/256x256_golden_multiple_targets_9.png", "testdata/256x256_golden_simple_composition.png", "testdata/256x256_golden_solid_color.png", "testdata/256x256_golden_solid_color_above.png", "testdata/256x256_golden_solid_color_below.png", "testdata/256x256_golden_transform_fliph.png", "testdata/256x256_golden_transform_fliphrot90.png", "testdata/256x256_golden_transform_flipv.png", "testdata/256x256_golden_transform_flipvrot90.png", "testdata/256x256_golden_transform_none.png", "testdata/256x256_golden_transform_rot180.png", "testdata/256x256_golden_transform_rot270.png", "testdata/256x256_golden_transform_rot90.png", ], deps = [ ":gfxstream_vulkan_server", "//common/base:gfxstream_common_base", "//common/image:gfxstream_common_image", "//host/testlibs/support:gfxstream_host_testing_support", "//third_party/glm", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", "@rules_cc//cc/runfiles", ], ) cc_test( name = "gfxstream_displayvk_tests", srcs = [ "DisplayVk_unittest.cpp", ], copts = GFXSTREAM_HOST_COPTS, deps = [ ":gfxstream_vulkan_server", "//common/base:gfxstream_common_base", "//host:gfxstream_host_headers", "//host/testlibs/oswindow:gfxstream_oswindow_test_support", "//host/testlibs/support:gfxstream_host_testing_support", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) cc_test( name = "gfxstream_emulatedphysicalmemory_tests", srcs = [ "VkEmulatedPhysicalDeviceMemoryTests.cpp", ], copts = GFXSTREAM_HOST_COPTS, deps = [ ":gfxstream_vulkan_server", "//common/base:gfxstream_common_base", "//host:gfxstream_host_headers", "//host/features:gfxstream_host_features", "//host/testlibs/support:gfxstream_host_testing_support", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], )