diff --git a/base/cvd/build_external/build_external.MODULE.bazel b/base/cvd/build_external/build_external.MODULE.bazel index 6a58eeb026d..19c74b8b3ba 100644 --- a/base/cvd/build_external/build_external.MODULE.bazel +++ b/base/cvd/build_external/build_external.MODULE.bazel @@ -19,6 +19,7 @@ include("//build_external/f2fs_tools:f2fs_tools.MODULE.bazel") include("//build_external/fec_rs:fec_rs.MODULE.bazel") include("//build_external/fruit:fruit.MODULE.bazel") include("//build_external/gflags:gflags.MODULE.bazel") +include("//build_external/glslang:glslang.MODULE.bazel") include("//build_external/gfxstream:gfxstream.MODULE.bazel") include("//build_external/googletest:googletest.MODULE.bazel") include("//build_external/grpc-proto:grpc-proto.MODULE.bazel") diff --git a/base/cvd/build_external/glslang/BUILD.bazel b/base/cvd/build_external/glslang/BUILD.bazel new file mode 100644 index 00000000000..e69de29bb2d diff --git a/base/cvd/build_external/glslang/BUILD.glslang.bazel b/base/cvd/build_external/glslang/BUILD.glslang.bazel new file mode 100644 index 00000000000..bd7c1ac2bbf --- /dev/null +++ b/base/cvd/build_external/glslang/BUILD.glslang.bazel @@ -0,0 +1,227 @@ +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_python//python:defs.bzl", "py_binary") + +package( + default_visibility = [ + "@//:android_cuttlefish", + ], +) + +# Build information generation script +py_binary( + name = "build_info", + srcs = ["build_info.py"], +) + +genrule( + name = "gen_build_info_h", + srcs = [ + "CHANGES.md", + "build_info.h.tmpl", + ], + outs = ["glslang/build_info.h"], + cmd = "$(location build_info) $$(dirname $(location CHANGES.md)) -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)", + tools = [":build_info"], +) + +# Intrinsics generation script +py_binary( + name = "gen_extension_headers", + srcs = ["gen_extension_headers.py"], +) + +genrule( + name = "glsl_intrinsic_header_h", + srcs = [ + "glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl", + ], + outs = ["glslang/glsl_intrinsic_header.h"], + cmd = "$(location gen_extension_headers) -i $$(dirname $(location glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl)) -o $(location glslang/glsl_intrinsic_header.h)", + tools = [":gen_extension_headers"], +) + +cc_library( + name = "generated_headers", + hdrs = [ + ":gen_build_info_h", + ":glsl_intrinsic_header_h", + ], + copts = [ + "$(STACK_FRAME_UNLIMITED)", + "-Wno-logical-op-parentheses", + "-Wno-gnu-redeclared-enum", + "-Wno-sometimes-uninitialized", + "-Wno-implicit-fallthrough", + "-Ithird_party/glslang", + # glslang is not clean under certain sanitizers + "-fno-sanitize=float-cast-overflow,null,signed-integer-overflow", + ], + includes = ["."], + linkstatic = 1, +) + +cc_library( + name = "glslang", + srcs = glob( + [ + "glslang/CInterface/*.cpp", + "glslang/GenericCodeGen/*.cpp", + "glslang/HLSL/*.cpp", + "glslang/MachineIndependent/*.cpp", + "glslang/MachineIndependent/preprocessor/*.cpp", + ], + exclude = [ + "glslang/HLSL/pch.cpp", + "glslang/HLSL/pch.h", + "glslang/MachineIndependent/pch.cpp", + "glslang/MachineIndependent/pch.h", + ], + ) + [ + "glslang/OSDependent/Unix/ossource.cpp", + ], + hdrs = glob([ + "glslang/HLSL/*.h", + "glslang/Include/*.h", + "glslang/MachineIndependent/*.h", + "glslang/MachineIndependent/preprocessor/*.h", + ]) + [ + "StandAlone/DirStackFileIncluder.h", + "glslang/OSDependent/osinclude.h", + "glslang/Public/ResourceLimits.h", + "glslang/Public/ShaderLang.h", + ], + copts = [ + "$(STACK_FRAME_UNLIMITED)", + "-Wno-logical-op-parentheses", + "-Wno-gnu-redeclared-enum", + "-Wno-sometimes-uninitialized", + "-Wno-implicit-fallthrough", + "-Ithird_party/glslang", + # glslang is not clean under certain sanitizers + "-fno-sanitize=float-cast-overflow,null,signed-integer-overflow", + "-Ithird_party/glslang/glslang/MachineIndependent", + ], + defines = [ + "AMD_EXTENSIONS", + "ENABLE_HLSL", + "ENABLE_OPT=1", + "ENABLE_SPIRV", + "GLSLANG_OSINCLUDE_UNIX", + "NV_EXTENSIONS", + ], + linkstatic = 1, + deps = [":generated_headers"], +) + +cc_library( + name = "SPIRV_headers", + hdrs = [ + "SPIRV/GLSL.ext.AMD.h", + "SPIRV/GLSL.ext.ARM.h", + "SPIRV/GLSL.ext.EXT.h", + "SPIRV/GLSL.ext.KHR.h", + "SPIRV/GLSL.ext.NV.h", + "SPIRV/GLSL.ext.QCOM.h", + "SPIRV/GLSL.std.450.h", + "SPIRV/spirv.hpp11", + "SPIRV/spvUtil.h", + ], + copts = [ + "$(STACK_FRAME_UNLIMITED)", + "-Wno-logical-op-parentheses", + "-Wno-gnu-redeclared-enum", + "-Wno-sometimes-uninitialized", + "-Wno-implicit-fallthrough", + "-Ithird_party/glslang", + # glslang is not clean under certain sanitizers + "-fno-sanitize=float-cast-overflow,null,signed-integer-overflow", + ], + includes = ["."], + linkstatic = 1, +) + +cc_library( + name = "SPIRV", + srcs = glob([ + "SPIRV/*.cpp", + "SPIRV/CInterface/*.cpp", + ]), + hdrs = [ + "SPIRV/GlslangToSpv.h", + "SPIRV/Logger.h", + "SPIRV/NonSemanticDebugPrintf.h", + "SPIRV/NonSemanticShaderDebugInfo.h", + "SPIRV/SpvBuilder.h", + "SPIRV/SpvTools.h", + "SPIRV/bitutils.h", + "SPIRV/disassemble.h", + "SPIRV/doc.h", + "SPIRV/hex_float.h", + "SPIRV/spvIR.h", + ], + copts = [ + "$(STACK_FRAME_UNLIMITED)", + "-Wno-logical-op-parentheses", + "-Wno-gnu-redeclared-enum", + "-Wno-sometimes-uninitialized", + "-Wno-implicit-fallthrough", + "-Ithird_party/glslang", + # glslang is not clean under certain sanitizers + "-fno-sanitize=float-cast-overflow,null,signed-integer-overflow", + ], + linkstatic = 1, + deps = [ + ":SPIRV_headers", + ":generated_headers", + ":glslang", + "@spirv_tools//:spirv_tools_opt", + ], +) + +cc_library( + name = "glslang-default-resource-limits", + srcs = [ + "glslang/ResourceLimits/ResourceLimits.cpp", + "glslang/ResourceLimits/resource_limits_c.cpp", + ], + hdrs = [ + "glslang/Public/ResourceLimits.h", + "glslang/Public/resource_limits_c.h", + ], + copts = [ + "$(STACK_FRAME_UNLIMITED)", + "-Wno-logical-op-parentheses", + "-Wno-gnu-redeclared-enum", + "-Wno-sometimes-uninitialized", + "-Wno-implicit-fallthrough", + "-Ithird_party/glslang", + # glslang is not clean under certain sanitizers + "-fno-sanitize=float-cast-overflow,null,signed-integer-overflow", + ], + deps = [":glslang"], +) + +cc_binary( + name = "glslangValidator", + srcs = [ + "StandAlone/StandAlone.cpp", + "StandAlone/Worklist.h", + ], + copts = [ + "$(STACK_FRAME_UNLIMITED)", + "-Wno-logical-op-parentheses", + "-Wno-gnu-redeclared-enum", + "-Wno-sometimes-uninitialized", + "-Wno-implicit-fallthrough", + "-Ithird_party/glslang", + # glslang is not clean under certain sanitizers + "-fno-sanitize=float-cast-overflow,null,signed-integer-overflow", + ], + deps = [ + ":SPIRV", + ":glslang", + ":glslang-default-resource-limits", + ], + visibility = ["//visibility:public"], +) diff --git a/base/cvd/build_external/glslang/glslang.MODULE.bazel b/base/cvd/build_external/glslang/glslang.MODULE.bazel new file mode 100644 index 00000000000..245044e372e --- /dev/null +++ b/base/cvd/build_external/glslang/glslang.MODULE.bazel @@ -0,0 +1,8 @@ +git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") + +git_repository( + name = "glslang", + commit = "76038dbb8708236407e121fa11e99a96377b88ad", + build_file = "@//build_external/glslang:BUILD.glslang.bazel", + remote = "https://github.com/KhronosGroup/glslang", +) diff --git a/base/cvd/build_external/mesa/BUILD.bazel b/base/cvd/build_external/mesa/BUILD.bazel index e69de29bb2d..22f8a26f957 100644 --- a/base/cvd/build_external/mesa/BUILD.bazel +++ b/base/cvd/build_external/mesa/BUILD.bazel @@ -0,0 +1 @@ +exports_files(["patches/rename_nv.patch"]) diff --git a/base/cvd/build_external/mesa/BUILD.mesa.bazel b/base/cvd/build_external/mesa/BUILD.mesa.bazel index 9255fcef21a..ff9a3fea95d 100644 --- a/base/cvd/build_external/mesa/BUILD.mesa.bazel +++ b/base/cvd/build_external/mesa/BUILD.mesa.bazel @@ -1,1089 +1,711 @@ +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") load("@rules_cc//cc:cc_library.bzl", "cc_library") load("@rules_cc//cc:cc_shared_library.bzl", "cc_shared_library") load("@rules_python//python:defs.bzl", "py_binary") -load("@//:build_variables.bzl", "COPTS") - package( default_visibility = ["@//:android_cuttlefish"], ) -MESA_DEFAULT_COPTS = [ - "-Wno-error", - "-D__STDC_CONSTANT_MACROS", - "-D__STDC_LIMIT_MACROS", - "-D_GNU_SOURCE", - "-DHAVE_SECURE_GETENV", - "-DDRAW_LLVM_AVAILABLE=1", - "-DENABLE_SHADER_CACHE", - "-DHAVE___BUILTIN_CLZ", - "-DHAVE___BUILTIN_CLZLL", - "-DHAVE___BUILTIN_CTZ", - "-DHAVE___BUILTIN_EXPECT", - "-DHAVE___BUILTIN_FFS", - "-DHAVE___BUILTIN_FFSLL", - "-DHAVE___BUILTIN_POPCOUNT", - "-DHAVE___BUILTIN_POPCOUNTLL", - "-DHAVE___BUILTIN_UNREACHABLE", - "-DHAVE_ENDIAN_H", - "-DHAVE_LIBDRM", - "-DHAVE_FUNC_ATTRIBUTE_ALIAS", - "-DHAVE_FUNC_ATTRIBUTE_FLATTEN", - "-DHAVE_FUNC_ATTRIBUTE_FORMAT", - "-DHAVE_FUNC_ATTRIBUTE_NORETURN", - "-DHAVE_FUNC_ATTRIBUTE_PACKED", - "-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL", - "-DHAVE_FUNC_ATTRIBUTE_UNUSED", - "-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", - "-DHAVE_REALLOCARRAY", - "-DHAVE_PTHREAD=1", - "-DHAVE_STRUCT_TIMESPEC", - "-DHAVE_TIMESPEC_GET", - "-DHAVE_COMPRESSION", - "-DCLOCK_MONOTONIC=1", - "-DHAVE_ZLIB", - "-DMAJOR_IN_SYSMACROS", - "-DMESA_DEBUG=0", - "-DMESA_LLVM_VERSION_STRING=\\\"16.0.0\\\"", - "-DPACKAGE_BUGREPORT=\\\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\\\"", - "-DPACKAGE_VERSION=\\\"24.2\\\"", - "-fno-math-errno", - "-fno-trapping-math", - "-fvisibility=hidden", - "-Werror=incompatible-pointer-types", - "-Wno-#pragma-messages", - "-Wno-#warnings", - "-Wno-asm-operand-widths", - "-Wno-cast-calling-convention", - "-Wno-constant-conversion", - "-Wno-constant-logical-operand", - "-Wno-enum-conversion", - "-Wno-format", - "-Wno-gnu-variable-sized-type-not-at-end", - "-Wno-implicit-const-int-float-conversion", - "-Wno-implicit-fallthrough", - "-Wno-implicit-function-declaration", - "-Wno-implicit-int", - "-Wno-incompatible-pointer-types", - "-Wno-inconsistent-missing-override", - "-Wno-initializer-overrides", - "-Wno-mismatched-tags", - "-Wno-missing-braces", - "-Wno-missing-field-initializers", - "-Wno-overloaded-virtual", - "-Wno-pointer-arith", - "-Wno-self-assign", - "-Wno-shift-negative-value", - "-Wno-sign-compare", - "-Wno-sometimes-uninitialized", - "-Wno-switch", - "-Wno-sync-alignment", - "-Wno-typedef-redefinition", - "-Wno-uninitialized", - "-Wno-unused-but-set-variable", - "-Wno-unused-const-variable", - "-Wno-unused-function", - "-Wno-unused-parameter", - "-Wno-unused-private-field", - "-Wno-visibility", - "-DTIME_UTC", - "-DTIME_MONOTONIC", - "-DTIME_ACTIVE", - "-DTIME_THREAD_ACTIVE", - "-DTIME_MONOTONIC_RAW", -] - -MESA_DEFAULT_CXXOPTS = COPTS +py_binary( + name = "git_sha1_gen", + srcs = ["bin/git_sha1_gen.py"], + imports = ["bin"], + main = "bin/git_sha1_gen.py", +) py_binary( - name = "builtin_types_header_gen", - srcs = [ - "src/compiler/builtin_types.py", - "src/compiler/builtin_types_h.py", - ], - imports = [ - "src/compiler", - ], - main = "src/compiler/builtin_types_h.py", + name = "gen_vs_module_defs", + srcs = ["bin/gen_vs_module_defs.py"], + imports = ["bin"], + main = "bin/gen_vs_module_defs.py", +) + +cc_library( + name = "include_directory_include", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["include/."], + textual_hdrs = glob( + ["include/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +cc_library( + name = "include_directory_src", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/."], + textual_hdrs = glob( + ["src/**/*.h"], + allow_empty = True, + ) + [":gen_git_sha1_h"], + visibility = ["//visibility:public"], deps = [ - "@mako", + ":include_directory_src_compiler", + ":include_directory_src_loader", + ":include_directory_src_util", + ":include_directory_src_vulkan", ], ) -py_binary( - name = "builtin_types_impl_gen", +genrule( + name = "gen_git_sha1_h", + srcs = ["bin/git_sha1_gen.py"], + outs = ["src/git_sha1.h"], + cmd = "$(location :git_sha1_gen) --output $(location src/git_sha1.h)", + tools = [":git_sha1_gen"], +) + +cc_library( + name = "mesa_util_c11", srcs = [ - "src/compiler/builtin_types.py", - "src/compiler/builtin_types_c.py", - ], - imports = [ - "src/compiler", + "src/c11/impl/threads_posix.c", + "src/c11/impl/time.c", ], - main = "src/compiler/builtin_types_c.py", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, deps = [ - "@mako", + ":include_directory_src", + ":include_directory_src_c11_impl", ], ) +cc_library( + name = "include_directory_src_c11_impl", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/c11/impl/."], + textual_hdrs = glob( + ["src/c11/impl/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + genrule( - name = "gen_mesa_commit", - outs = ["git_sha1.h"], - cmd = """ - echo '#define MESA_GIT_SHA1 "unspecified"' > $(location git_sha1.h) - """, + name = "gen_ir_expression_operation_h", + srcs = ["src/compiler/glsl/ir_expression_operation.py"], + outs = ["src/compiler/ir_expression_operation.h"], + cmd = "$(location :ir_expression_operation) enum > $(location src/compiler/ir_expression_operation.h)", + tools = [":ir_expression_operation"], ) cc_library( - name = "mesa_commit", + name = "compiler", + srcs = [ + "src/compiler/glsl_types.c", + "src/compiler/shader_enums.c", + ":gen_builtin_types_c", + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ], hdrs = [ - ":gen_mesa_commit", + "src/compiler/glsl_types.h", + "src/compiler/list.h", + "src/compiler/shader_enums.h", + "src/compiler/shader_info.h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", ], ) genrule( - name = "builtin_types_header", + name = "gen_builtin_types_h", + srcs = ["src/compiler/builtin_types.py"], outs = ["src/compiler/builtin_types.h"], - cmd = "python3 $(location builtin_types_header_gen) $(location src/compiler/builtin_types.h)", - tools = ["builtin_types_header_gen"], + cmd = "$(location :builtin_types_h) $(location src/compiler/builtin_types.h)", + tools = [":builtin_types_h"], ) genrule( - name = "builtin_types_impl", + name = "gen_builtin_types_c", + srcs = ["src/compiler/builtin_types.py"], outs = ["src/compiler/builtin_types.c"], - cmd = "python3 $(location builtin_types_impl_gen) $(location src/compiler/builtin_types.c)", - tools = ["builtin_types_impl_gen"], + cmd = "$(location :builtin_types_c) $(location src/compiler/builtin_types.c)", + tools = [":builtin_types_c"], ) cc_library( - name = "mesa_util_detect", - hdrs = [ - "src/util/detect.h", - "src/util/detect_arch.h", - "src/util/detect_os.h", - "src/util/u_endian.h", + name = "include_directory_src_compiler", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/compiler/."], + textual_hdrs = glob( + ["src/compiler/**/*.h"], + allow_empty = True, + ) + [ + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ], + visibility = ["//visibility:public"], + deps = [ + ":include_directory_src_compiler_glsl", + ":include_directory_src_compiler_nir", + ":include_directory_src_compiler_spirv", ], - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "src", ) py_binary( - name = "u_format_table_gen", + name = "builtin_types_h", srcs = [ - "src/util/format/u_format_pack.py", - "src/util/format/u_format_parse.py", - "src/util/format/u_format_table.py", - ], - imports = [ - "src/util/format", - ], - main = "src/util/format/u_format_table.py", - deps = [ - "@pyyaml//:yaml", + "src/compiler/builtin_types.py", + "src/compiler/builtin_types_h.py", ], + imports = ["src/compiler"], + main = "src/compiler/builtin_types_h.py", + deps = ["@mako"], ) -filegroup( - name = "mesa_u_format_yaml", +py_binary( + name = "builtin_types_c", srcs = [ - "src/util/format/u_format.yaml", + "src/compiler/builtin_types.py", + "src/compiler/builtin_types_c.py", ], + imports = ["src/compiler"], + main = "src/compiler/builtin_types_c.py", + deps = ["@mako"], ) -genrule( - name = "gen_u_format_pack_header", - srcs = [ - ":mesa_u_format_yaml", - ], - outs = ["src/util/format/u_format_pack.h"], - cmd = "python3 $(location u_format_table_gen) " + - "$(location :mesa_u_format_yaml) --header " + - "&> $(location src/util/format/u_format_pack.h)", - tools = ["u_format_table_gen"], +py_binary( + name = "ir_expression_operation", + srcs = ["src/compiler/glsl/ir_expression_operation.py"], + imports = ["src/compiler/glsl"], + main = "src/compiler/glsl/ir_expression_operation.py", + deps = ["@mako"], ) -genrule( - name = "gen_u_format_gen_header", - srcs = [ - ":mesa_u_format_yaml", - ], - outs = [ - "src/util/format/u_format_gen.h", - ], - cmd = "python3 $(location u_format_table_gen) " + - "$(location :mesa_u_format_yaml) --enums " + - "&> $(location src/util/format/u_format_gen.h)", - tools = [":u_format_table_gen"], +cc_library( + name = "include_directory_src_compiler_glsl", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/compiler/glsl/."], + textual_hdrs = glob( + ["src/compiler/glsl/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +cc_library( + name = "include_directory_src_compiler_nir", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/compiler/nir/."], + textual_hdrs = glob( + ["src/compiler/nir/**/*.h"], + allow_empty = True, + ) + [ + ":gen_nir_builder_opcodes_h", + ":gen_nir_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ], + visibility = ["//visibility:public"], ) genrule( - name = "gen_u_format_table_impl", - srcs = [":mesa_u_format_yaml"], - outs = [ - "src/util/format/u_format_table.c", - ], - cmd = "python3 $(location u_format_table_gen) " + - "$(location :mesa_u_format_yaml) " + - " &> $(location src/util/format/u_format_table.c)", - tools = [":u_format_table_gen"], + name = "gen_nir_intrinsics_indices_h", + srcs = ["src/compiler/nir/nir_intrinsics.py"], + outs = ["src/compiler/nir/nir_intrinsics_indices.h"], + cmd = "$(location :nir_intrinsics_indices_h) --out $(location src/compiler/nir/nir_intrinsics_indices.h)", + tools = [":nir_intrinsics_indices_h"], ) -py_binary( - name = "format_srgb_gen", +genrule( + name = "gen_nir_constant_expressions_c", srcs = [ - "src/util/format_srgb.py", - ], - imports = [ - "src/util", + "src/compiler/nir/nir_intrinsics.py", + "src/compiler/nir/nir_opcodes.py", ], - main = "src/util/format_srgb.py", + outs = ["src/compiler/nir/nir_constant_expressions.c"], + cmd = "$(location :nir_constant_expressions) > $(location src/compiler/nir/nir_constant_expressions.c)", + tools = [":nir_constant_expressions"], ) genrule( - name = "gen_format_srgb_impl", - outs = ["src/util/format_srgb.c"], - cmd = "python3 $(location :format_srgb_gen) &> $(location src/util/format_srgb.c)", - tools = [":format_srgb_gen"], -) - -cc_library( - name = "mesa_util_format", + name = "gen_nir_opcodes_h", srcs = [ - "src/util/format/u_format.c", - "src/util/format/u_format_bptc.c", - "src/util/format/u_format_etc.c", - "src/util/format/u_format_fxt1.c", - "src/util/format/u_format_latc.c", - "src/util/format/u_format_other.c", - "src/util/format/u_format_rgtc.c", - "src/util/format/u_format_s3tc.c", - "src/util/format/u_format_table.c", - "src/util/format/u_format_tests.c", - "src/util/format/u_format_unpack_neon.c", - "src/util/format/u_format_yuv.c", - "src/util/format/u_format_zs.c", - "src/util/format_srgb.c", - ], - hdrs = [ - "src/util/format/format_utils.h", - "src/util/format/texcompress_bptc_tmp.h", - "src/util/format/texcompress_etc_tmp.h", - "src/util/format/texcompress_s3tc_tmp.h", - "src/util/format/u_format.h", - "src/util/format/u_format_bptc.h", - "src/util/format/u_format_etc.h", - "src/util/format/u_format_fxt1.h", - "src/util/format/u_format_gen.h", - "src/util/format/u_format_latc.h", - "src/util/format/u_format_other.h", - "src/util/format/u_format_pack.h", - "src/util/format/u_format_rgtc.h", - "src/util/format/u_format_s3tc.h", - "src/util/format/u_format_tests.h", - "src/util/format/u_format_yuv.h", - "src/util/format/u_format_zs.h", - "src/util/format/u_formats.h", - "src/util/format_srgb.h", - ], - copts = MESA_DEFAULT_COPTS, - includes = [ - "src/util/format", - ], - strip_include_prefix = "src", - deps = [ - ":mesa_include_gl", - ":mesa_util", - ":mesa_util_detect", + "src/compiler/nir/nir_intrinsics.py", + "src/compiler/nir/nir_opcodes.py", ], + outs = ["src/compiler/nir/nir_opcodes.h"], + cmd = "$(location :nir_opcodes_h) > $(location src/compiler/nir/nir_opcodes.h)", + tools = [":nir_opcodes_h"], ) -py_binary( - name = "nir_builder_opcodes_gen", +genrule( + name = "gen_nir_opcodes_c", srcs = [ - "src/compiler/nir/nir_builder_opcodes_h.py", "src/compiler/nir/nir_intrinsics.py", "src/compiler/nir/nir_opcodes.py", ], - imports = [ - "src/compiler/nir", - ], - main = "src/compiler/nir/nir_builder_opcodes_h.py", - deps = [ - "@mako", - ], + outs = ["src/compiler/nir/nir_opcodes.c"], + cmd = "$(location :nir_opcodes_c) > $(location src/compiler/nir/nir_opcodes.c)", + tools = [":nir_opcodes_c"], ) py_binary( - name = "nir_constant_expressions_gen", + name = "nir_constant_expressions", srcs = [ "src/compiler/nir/nir_constant_expressions.py", "src/compiler/nir/nir_intrinsics.py", "src/compiler/nir/nir_opcodes.py", ], - imports = [ - "src/compiler/nir", - ], + imports = ["src/compiler/nir"], main = "src/compiler/nir/nir_constant_expressions.py", - deps = [ - "@mako", - ], + deps = ["@mako"], ) py_binary( - name = "nir_opcodes_header_gen", + name = "nir_opcodes_h", srcs = [ "src/compiler/nir/nir_intrinsics.py", "src/compiler/nir/nir_opcodes.py", "src/compiler/nir/nir_opcodes_h.py", ], - imports = [ - "src/compiler/nir", - ], + imports = ["src/compiler/nir"], main = "src/compiler/nir/nir_opcodes_h.py", - deps = [ - "@mako", - ], + deps = ["@mako"], ) -py_binary( - name = "nir_opcodes_impl_gen", +genrule( + name = "gen_nir_builder_opcodes_h", srcs = [ "src/compiler/nir/nir_intrinsics.py", "src/compiler/nir/nir_opcodes.py", - "src/compiler/nir/nir_opcodes_c.py", - ], - imports = [ - "src/compiler/nir", - ], - main = "src/compiler/nir/nir_opcodes_c.py", - deps = [ - "@mako", ], + outs = ["src/compiler/nir/nir_builder_opcodes.h"], + cmd = "$(location :nir_builder_opcodes_h) > $(location src/compiler/nir/nir_builder_opcodes.h)", + tools = [":nir_builder_opcodes_h"], ) -py_binary( - name = "nir_opt_algebraic_gen", +genrule( + name = "gen_nir_opt_algebraic", srcs = [ "src/compiler/nir/nir_algebraic.py", "src/compiler/nir/nir_opcodes.py", - "src/compiler/nir/nir_opt_algebraic.py", - ], - imports = [ - "src/compiler/nir", - ], - main = "src/compiler/nir/nir_opt_algebraic.py", - deps = [ - "@mako", ], + outs = ["src/compiler/nir/nir_opt_algebraic.c"], + cmd = "$(location :nir_opt_algebraic) --out $(location src/compiler/nir/nir_opt_algebraic.c)", + tools = [":nir_opt_algebraic"], ) py_binary( - name = "nir_intrinsics_header_gen", + name = "nir_intrinsics_h", srcs = [ "src/compiler/nir/nir_intrinsics.py", "src/compiler/nir/nir_intrinsics_h.py", ], - imports = [ - "src/compiler/nir", - ], + imports = ["src/compiler/nir"], main = "src/compiler/nir/nir_intrinsics_h.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "nir_intrinsics_indices_gen", - srcs = [ - "src/compiler/nir/nir_intrinsics.py", - "src/compiler/nir/nir_intrinsics_indices_h.py", - ], - imports = [ - "src/compiler/nir", - ], - main = "src/compiler/nir/nir_intrinsics_indices_h.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "nir_intrinsics_impl_gen", - srcs = [ - "src/compiler/nir/nir_intrinsics.py", - "src/compiler/nir/nir_intrinsics_c.py", - ], - imports = [ - "src/compiler/nir", - ], - main = "src/compiler/nir/nir_intrinsics_c.py", - deps = [ - "@mako", - ], -) - -genrule( - name = "nir_builder_opcodes_header", - outs = ["src/compiler/nir_builder_opcodes.h"], - cmd = "python3 $(location nir_builder_opcodes_gen) &> $(location src/compiler/nir_builder_opcodes.h)", - tools = ["nir_builder_opcodes_gen"], -) - -genrule( - name = "nir_constant_expressions_impl", - outs = ["src/compiler/nir_constant_expressions.c"], - cmd = "python3 $(location nir_constant_expressions_gen) &> $(location src/compiler/nir_constant_expressions.c)", - tools = ["nir_constant_expressions_gen"], -) - -genrule( - name = "nir_opcodes_header", - outs = ["src/compiler/nir_opcodes.h"], - cmd = "python3 $(location nir_opcodes_header_gen) &> $(location src/compiler/nir_opcodes.h)", - tools = ["nir_opcodes_header_gen"], -) - -genrule( - name = "nir_opcodes_impl", - outs = ["src/compiler/nir_opcodes.c"], - cmd = "python3 $(location nir_opcodes_impl_gen) &> $(location src/compiler/nir_opcodes.c)", - tools = ["nir_opcodes_impl_gen"], -) - -genrule( - name = "nir_opt_algebraic_impl", - outs = ["src/compiler/nir_opt_algebraic.c"], - cmd = "python3 $(location nir_opt_algebraic_gen) --out $(location src/compiler/nir_opt_algebraic.c)", - tools = ["nir_opt_algebraic_gen"], -) - -genrule( - name = "nir_intrinsics_header", - outs = ["src/compiler/nir_intrinsics.h"], - cmd = "python3 $(location nir_intrinsics_header_gen) --outdir $$(dirname $(location src/compiler/nir_intrinsics.h))", - tools = ["nir_intrinsics_header_gen"], -) - -genrule( - name = "nir_intrinsics_indices_header", - outs = ["src/compiler/nir_intrinsics_indices.h"], - cmd = "python3 $(location nir_intrinsics_indices_gen) --outdir $$(dirname $(location src/compiler/nir_intrinsics_indices.h))", - tools = ["nir_intrinsics_indices_gen"], -) - -genrule( - name = "nir_intrinsics_impl", - outs = ["src/compiler/nir_intrinsics.c"], - cmd = "python3 $(location nir_intrinsics_impl_gen) --outdir $$(dirname $(location src/compiler/nir_intrinsics.c))", - tools = ["nir_intrinsics_impl_gen"], -) - -py_binary( - name = "vk_entrypoints_gen", - srcs = [ - "src/vulkan/util/vk_entrypoints.py", - "src/vulkan/util/vk_entrypoints_gen.py", - "src/vulkan/util/vk_extensions.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_entrypoints_gen.py", - deps = [ - "@mako", - ], -) - -genrule( - name = "gen_lvp_vk_entrypoints", - srcs = ["src/vulkan/registry/vk.xml"], - outs = [ - "src/gallium/frontends/lavapipe/lvp_entrypoints.c", - "src/gallium/frontends/lavapipe/lvp_entrypoints.h", - ], - cmd = "python3 $(location :vk_entrypoints_gen) --xml " + - "$(location src/vulkan/registry/vk.xml) --proto --weak " + - "--out-c $(location src/gallium/frontends/lavapipe/lvp_entrypoints.c) " + - "--out-h $(location src/gallium/frontends/lavapipe/lvp_entrypoints.h) " + - "--prefix lvp --beta false", - tools = [":vk_entrypoints_gen"], -) - -py_binary( - name = "vk_format_info_gen", - srcs = ["src/vulkan/runtime/vk_format_info_gen.py"], - imports = [ - "src/vulkan/runtime", - ], - main = "src/vulkan/runtime/vk_format_info_gen.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "vk_dispatch_trampolines_gen", - srcs = [ - "src/vulkan/util/vk_dispatch_trampolines_gen.py", - "src/vulkan/util/vk_entrypoints.py", - "src/vulkan/util/vk_extensions.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_dispatch_trampolines_gen.py", - deps = [ - "@mako", - ], + deps = ["@mako"], ) -py_binary( - name = "vk_physical_device_features_gen", - srcs = [ - "src/vulkan/util/vk_entrypoints.py", - "src/vulkan/util/vk_extensions.py", - "src/vulkan/util/vk_physical_device_features_gen.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_physical_device_features_gen.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "vk_physical_device_properties_gen", - srcs = [ - "src/vulkan/util/vk_entrypoints.py", - "src/vulkan/util/vk_extensions.py", - "src/vulkan/util/vk_physical_device_properties_gen.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_physical_device_properties_gen.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "vk_extensions_gen", - srcs = [ - "src/vulkan/util/vk_extensions.py", - "src/vulkan/util/vk_extensions_gen.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_extensions_gen.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "vk_dispatch_table_gen", - srcs = [ - "src/vulkan/util/vk_dispatch_table_gen.py", - "src/vulkan/util/vk_entrypoints.py", - "src/vulkan/util/vk_extensions.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_dispatch_table_gen.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "gen_enum_to_str", - srcs = [ - "src/vulkan/util/gen_enum_to_str.py", - "src/vulkan/util/vk_extensions.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/gen_enum_to_str.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "vk_struct_type_cast_gen", - srcs = [ - "src/vulkan/util/vk_extensions.py", - "src/vulkan/util/vk_struct_type_cast_gen.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_struct_type_cast_gen.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "vk_physical_device_spirv_caps_gen", - srcs = [ - "src/vulkan/util/vk_extensions.py", - "src/vulkan/util/vk_physical_device_features_gen.py", - "src/vulkan/util/vk_physical_device_spirv_caps_gen.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_physical_device_spirv_caps_gen.py", - deps = [ - "@mako", - ], -) - -py_binary( - name = "vk_synchronization_helpers_gen", - srcs = [ - "src/vulkan/util/vk_extensions.py", - "src/vulkan/util/vk_synchronization_helpers_gen.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_synchronization_helpers_gen.py", - deps = [ - "@mako", - ], -) - -filegroup( - name = "mesa_vulkan_xml", - srcs = [ - "src/vulkan/registry/vk.xml", - ], -) - -genrule( - name = "vk_extensions_header", - srcs = [":mesa_vulkan_xml"], - outs = ["vk_extensions.h"], - cmd = "python3 $(location vk_extensions_gen) --xml " + - "$(location :mesa_vulkan_xml) --out-h " + - "$(location vk_extensions.h)", - tools = ["vk_extensions_gen"], -) - -genrule( - name = "vk_extensions_impl", - srcs = [":mesa_vulkan_xml"], - outs = ["vk_extensions.c"], - cmd = "python3 $(location vk_extensions_gen) --xml " + - "$(location :mesa_vulkan_xml) --out-c " + - "$(location vk_extensions.c)", - tools = ["vk_extensions_gen"], -) - -genrule( - name = "vk_dispatch_table_header", - srcs = [":mesa_vulkan_xml"], - outs = ["vk_dispatch_table.h"], - cmd = "python3 $(location vk_dispatch_table_gen) --xml " + - "$(location :mesa_vulkan_xml) --out-h " + - "$(location vk_dispatch_table.h) --beta false", - tools = ["vk_dispatch_table_gen"], -) - -genrule( - name = "vk_dispatch_table_impl", - srcs = [":mesa_vulkan_xml"], - outs = ["vk_dispatch_table.c"], - cmd = "python3 $(location vk_dispatch_table_gen) --xml " + - "$(location :mesa_vulkan_xml) --out-c " + - "$(location vk_dispatch_table.c) --beta false", - tools = ["vk_dispatch_table_gen"], -) - -genrule( - name = "gen_vk_enum_to_str_sources", - srcs = [":mesa_vulkan_xml"], - outs = [ - "vk_enum_to_str.c", - "vk_enum_to_str.h", - "vk_enum_defines.h", - ], - cmd = "python3 $(location gen_enum_to_str) --xml " + - "$(location :mesa_vulkan_xml) --outdir $$(dirname $(location vk_enum_to_str.h)) " + - "--beta false", - tools = ["gen_enum_to_str"], -) - -genrule( - name = "vk_struct_type_cast_header", - srcs = [":mesa_vulkan_xml"], - outs = ["vk_struct_type_cast.h"], - cmd = "python3 $(location vk_struct_type_cast_gen) --xml " + - "$(location :mesa_vulkan_xml) --outdir $$(dirname $(location vk_struct_type_cast.h)) " + - "--beta false", - tools = ["vk_struct_type_cast_gen"], -) - -cc_library( - name = "mesa_drm", - hdrs = [ - "include/drm-uapi/amdgpu_drm.h", - "include/drm-uapi/d3dkmthk.h", - "include/drm-uapi/dma-buf.h", - "include/drm-uapi/drm.h", - "include/drm-uapi/drm_fourcc.h", - "include/drm-uapi/drm_mode.h", - "include/drm-uapi/etnaviv_drm.h", - "include/drm-uapi/gpu_scheduler.h", - "include/drm-uapi/i915_drm.h", - "include/drm-uapi/lima_drm.h", - "include/drm-uapi/msm_drm.h", - "include/drm-uapi/nouveau_drm.h", - "include/drm-uapi/panfrost_drm.h", - "include/drm-uapi/panthor_drm.h", - "include/drm-uapi/pvr_drm.h", - "include/drm-uapi/radeon_drm.h", - "include/drm-uapi/sync_file.h", - "include/drm-uapi/tegra_drm.h", - "include/drm-uapi/v3d_drm.h", - "include/drm-uapi/vc4_drm.h", - "include/drm-uapi/virtgpu_drm.h", - "include/drm-uapi/xe_drm.h", - ], - copts = MESA_DEFAULT_COPTS, - includes = [ - "include", - "include/drm-uapi", - ], - strip_include_prefix = "include", -) - -cc_library( - name = "mesa_include_c99", - hdrs = [ - "include/c99_alloca.h", - ], - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "include", -) - -cc_library( - name = "mesa_include_gl", - hdrs = glob([ - "include/EGL/**/*.h", - "include/GL/**/*.h", - "include/GLES/**/*.h", - "include/GLES2/**/*.h", - "include/GLES3/**/*.h", - "include/KHR/**/*.h", - ]), - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "include", -) - -cc_library( - name = "mesa_include_vulkan", - hdrs = glob([ - "include/vulkan/**/*.h", - "include/vk_video/**/*.h", - ]), - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "include", -) - -cc_library( - name = "mesa_util_c11", - srcs = [ - "src/c11/impl/threads_posix.c", - "src/c11/impl/time.c", - ], - hdrs = [ - "src/c11/threads.h", - "src/c11/time.h", - ], - copts = MESA_DEFAULT_COPTS, - cxxopts = MESA_DEFAULT_CXXOPTS, - strip_include_prefix = "src", -) - -filegroup( - name = "mesa_util_driconf", - srcs = [ - "src/util/00-mesa-defaults.conf", - ], -) - -py_binary( - name = "mesa_util_driconf_static", - srcs = ["src/util/driconf_static.py"], - imports = [ - "src/util", - ], - main = "src/util/driconf_static.py", - deps = [ - "@mako", - ], -) - -genrule( - name = "mesa_util_driconf_static_header", - srcs = [ - ":mesa_util_driconf", - ], - outs = [ - "driconf_static.h", - ], - cmd = "python3 $(location mesa_util_driconf_static) $(location :mesa_util_driconf) $(location driconf_static.h)", - tools = [ - "mesa_util_driconf_static", - ], -) - -cc_library( - name = "mesa_util", - srcs = [ - "src/util/anon_file.c", - "src/util/bitscan.c", - "src/util/blob.c", - "src/util/build_id.c", - "src/util/cnd_monotonic.c", - "src/util/compress.c", - "src/util/crc32.c", - "src/util/dag.c", - "src/util/disk_cache.c", - "src/util/disk_cache_os.c", - "src/util/double.c", - "src/util/fast_idiv_by_const.c", - "src/util/fossilize_db.c", - "src/util/futex.c", - "src/util/half_float.c", - "src/util/hash_table.c", - "src/util/log.c", - "src/util/memstream.c", - "src/util/mesa-blake3.c", - "src/util/mesa-sha1.c", - "src/util/mesa_cache_db.c", - "src/util/mesa_cache_db_multipart.c", - "src/util/os_file.c", - "src/util/os_memory_fd.c", - "src/util/os_misc.c", - "src/util/os_socket.c", - "src/util/os_time.c", - "src/util/perf/u_trace.c", - "src/util/ralloc.c", - "src/util/rand_xor.c", - "src/util/rb_tree.c", - "src/util/register_allocate.c", - "src/util/rgtc.c", - "src/util/rwlock.c", - "src/util/set.c", - "src/util/sha1/sha1.c", - "src/util/simple_mtx.c", - "src/util/slab.c", - "src/util/softfloat.c", - "src/util/sparse_array.c", - "src/util/string_buffer.c", - "src/util/strtod.c", - "src/util/thread_sched.c", - "src/util/u_atomic.c", - "src/util/u_call_once.c", - "src/util/u_cpu_detect.c", - "src/util/u_debug.c", - "src/util/u_debug_memory.c", - "src/util/u_dl.c", - "src/util/u_dynarray.c", - "src/util/u_hash_table.c", - "src/util/u_idalloc.c", - "src/util/u_math.c", - "src/util/u_mm.c", - "src/util/u_printf.c", - "src/util/u_process.c", - "src/util/u_qsort.cpp", - "src/util/u_queue.c", - "src/util/u_thread.c", - "src/util/u_vector.c", - "src/util/u_worklist.c", - "src/util/vl_zscan_data.c", - "src/util/vma.c", - "src/util/xmlconfig.c", - ], - hdrs = [ - "include/c99_compat.h", - "include/no_extern_c.h", - ":mesa_util_driconf_static_header", - ] + glob([ - "src/util/**/*.h", - ]), - copts = MESA_DEFAULT_COPTS, - includes = [ - "include", - "src", - "src/util", - ], - deps = [ - ":mesa_util_blake", - ":mesa_util_c11", - "@libdrm", - "@zlib", - ], -) - -cc_library( - name = "mesa_util_blake", - srcs = [ - "src/util/blake3/blake3.c", - "src/util/blake3/blake3_dispatch.c", - "src/util/blake3/blake3_impl.h", - "src/util/blake3/blake3_portable.c", - ], - hdrs = [ - "src/util/blake3/blake3.h", - ], - copts = MESA_DEFAULT_COPTS + [ - "-DBLAKE3_NO_SSE2", - "-DBLAKE3_NO_SSE41", - "-DBLAKE3_NO_AVX2", - "-DBLAKE3_NO_AVX512", - ], - strip_include_prefix = "src", -) - -cc_library( - name = "mesa_compiler", - srcs = [ - "src/compiler/glsl_types.c", - "src/compiler/shader_enums.c", - ":builtin_types_impl", - ], - hdrs = [ - "src/compiler/glsl_types.h", - "src/compiler/shader_enums.h", - "src/compiler/shader_info.h", - ":builtin_types_header", - ], - copts = MESA_DEFAULT_COPTS, - includes = [ - "src/compiler", - ], - strip_include_prefix = "src", - deps = [ - ":mesa_util", - ":mesa_util_format", - ], -) - -cc_library( - name = "mesa_compiler_glsl_list", - hdrs = [ - "src/compiler/glsl/list.h", - ], - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "src", - deps = [ - ":mesa_util", - ], -) - -cc_library( - name = "mesa_compiler_nir", +cc_library( + name = "nir", srcs = [ "src/compiler/nir/nir.c", "src/compiler/nir/nir_builder.c", "src/compiler/nir/nir_builtin_builder.c", + "src/compiler/nir/nir_clip_cull_distance_io_utils.c", "src/compiler/nir/nir_clone.c", "src/compiler/nir/nir_control_flow.c", + "src/compiler/nir/nir_convert_address_format.c", "src/compiler/nir/nir_deref.c", "src/compiler/nir/nir_divergence_analysis.c", "src/compiler/nir/nir_dominance.c", + "src/compiler/nir/nir_dominance_lca.c", + "src/compiler/nir/nir_downgrade_pls_vars.c", "src/compiler/nir/nir_fixup_is_exported.c", "src/compiler/nir/nir_format_convert.c", "src/compiler/nir/nir_from_ssa.c", "src/compiler/nir/nir_functions.c", "src/compiler/nir/nir_gather_info.c", + "src/compiler/nir/nir_gather_output_deps.c", + "src/compiler/nir/nir_gather_tcs_info.c", "src/compiler/nir/nir_gather_types.c", "src/compiler/nir/nir_gather_xfb_info.c", "src/compiler/nir/nir_gs_count_vertices.c", + "src/compiler/nir/nir_inline_sysval.c", "src/compiler/nir/nir_inline_uniforms.c", "src/compiler/nir/nir_instr_set.c", + "src/compiler/nir/nir_io_add_xfb_info.c", "src/compiler/nir/nir_legacy.c", "src/compiler/nir/nir_linking_helpers.c", "src/compiler/nir/nir_liveness.c", "src/compiler/nir/nir_loop_analyze.c", + "src/compiler/nir/nir_lower_abort.c", + "src/compiler/nir/nir_lower_alpha.c", "src/compiler/nir/nir_lower_alu.c", "src/compiler/nir/nir_lower_alu_width.c", + "src/compiler/nir/nir_lower_amul.c", "src/compiler/nir/nir_lower_array_deref_of_vec.c", + "src/compiler/nir/nir_lower_atomics.c", + "src/compiler/nir/nir_lower_atomics_to_ssbo.c", "src/compiler/nir/nir_lower_bit_size.c", + "src/compiler/nir/nir_lower_bitmap.c", + "src/compiler/nir/nir_lower_blend.c", "src/compiler/nir/nir_lower_bool_to_float.c", "src/compiler/nir/nir_lower_bool_to_int32.c", + "src/compiler/nir/nir_lower_calls_to_builtins.c", + "src/compiler/nir/nir_lower_cl_images.c", + "src/compiler/nir/nir_lower_clamp_color_outputs.c", "src/compiler/nir/nir_lower_clip.c", - "src/compiler/nir/nir_lower_clip_cull_distance_arrays.c", + "src/compiler/nir/nir_lower_clip_disable.c", + "src/compiler/nir/nir_lower_clip_halfz.c", + "src/compiler/nir/nir_lower_const_arrays_to_uniforms.c", "src/compiler/nir/nir_lower_continue_constructs.c", "src/compiler/nir/nir_lower_convert_alu_types.c", + "src/compiler/nir/nir_lower_cooperative_matrix.c", "src/compiler/nir/nir_lower_discard_if.c", "src/compiler/nir/nir_lower_double_ops.c", + "src/compiler/nir/nir_lower_explicit_io.c", + "src/compiler/nir/nir_lower_fb_read.c", + "src/compiler/nir/nir_lower_flatshade.c", + "src/compiler/nir/nir_lower_floats.c", "src/compiler/nir/nir_lower_flrp.c", "src/compiler/nir/nir_lower_fp16_conv.c", + "src/compiler/nir/nir_lower_frag_coord_to_pixel_coord.c", "src/compiler/nir/nir_lower_fragcolor.c", + "src/compiler/nir/nir_lower_fragcoord_wtrans.c", "src/compiler/nir/nir_lower_frexp.c", "src/compiler/nir/nir_lower_global_vars_to_local.c", "src/compiler/nir/nir_lower_goto_ifs.c", "src/compiler/nir/nir_lower_gs_intrinsics.c", + "src/compiler/nir/nir_lower_halt_to_return.c", + "src/compiler/nir/nir_lower_helper_writes.c", "src/compiler/nir/nir_lower_idiv.c", "src/compiler/nir/nir_lower_image.c", - "src/compiler/nir/nir_lower_indirect_derefs.c", + "src/compiler/nir/nir_lower_image_atomics_to_global.c", + "src/compiler/nir/nir_lower_indirect_derefs_to_if_else_trees.c", "src/compiler/nir/nir_lower_input_attachments.c", "src/compiler/nir/nir_lower_int64.c", "src/compiler/nir/nir_lower_int_to_float.c", "src/compiler/nir/nir_lower_interpolation.c", "src/compiler/nir/nir_lower_io.c", - "src/compiler/nir/nir_lower_io_arrays_to_elements.c", + "src/compiler/nir/nir_lower_io_array_vars_to_elements.c", + "src/compiler/nir/nir_lower_io_indirect_loads.c", "src/compiler/nir/nir_lower_io_to_scalar.c", - "src/compiler/nir/nir_lower_io_to_temporaries.c", - "src/compiler/nir/nir_lower_io_to_vector.c", + "src/compiler/nir/nir_lower_io_vars_to_scalar.c", + "src/compiler/nir/nir_lower_io_vars_to_temporaries.c", "src/compiler/nir/nir_lower_is_helper_invocation.c", "src/compiler/nir/nir_lower_load_const_to_scalar.c", "src/compiler/nir/nir_lower_locals_to_regs.c", "src/compiler/nir/nir_lower_mediump.c", + "src/compiler/nir/nir_lower_mem_access_bit_sizes.c", + "src/compiler/nir/nir_lower_memcpy.c", + "src/compiler/nir/nir_lower_memory_model.c", "src/compiler/nir/nir_lower_multiview.c", "src/compiler/nir/nir_lower_non_uniform_access.c", "src/compiler/nir/nir_lower_packing.c", + "src/compiler/nir/nir_lower_passthrough_edgeflags.c", "src/compiler/nir/nir_lower_patch_vertices.c", "src/compiler/nir/nir_lower_phis_to_scalar.c", + "src/compiler/nir/nir_lower_pntc_ytransform.c", + "src/compiler/nir/nir_lower_point_size.c", + "src/compiler/nir/nir_lower_point_smooth.c", + "src/compiler/nir/nir_lower_poly_line_smooth.c", + "src/compiler/nir/nir_lower_printf.c", + "src/compiler/nir/nir_lower_readonly_images_to_tex.c", "src/compiler/nir/nir_lower_reg_intrinsics_to_ssa.c", "src/compiler/nir/nir_lower_returns.c", + "src/compiler/nir/nir_lower_robust_access.c", + "src/compiler/nir/nir_lower_sample_shading.c", "src/compiler/nir/nir_lower_samplers.c", "src/compiler/nir/nir_lower_scratch.c", + "src/compiler/nir/nir_lower_scratch_to_var.c", "src/compiler/nir/nir_lower_shader_calls.c", "src/compiler/nir/nir_lower_single_sampled.c", + "src/compiler/nir/nir_lower_ssbo.c", "src/compiler/nir/nir_lower_subgroups.c", "src/compiler/nir/nir_lower_system_values.c", "src/compiler/nir/nir_lower_sysvals_to_varyings.c", "src/compiler/nir/nir_lower_task_shader.c", + "src/compiler/nir/nir_lower_terminate_to_demote.c", + "src/compiler/nir/nir_lower_tess_coord_z.c", "src/compiler/nir/nir_lower_tex.c", + "src/compiler/nir/nir_lower_tex_shadow.c", + "src/compiler/nir/nir_lower_texcoord_replace.c", + "src/compiler/nir/nir_lower_texcoord_replace_late.c", "src/compiler/nir/nir_lower_two_sided_color.c", "src/compiler/nir/nir_lower_ubo_vec4.c", + "src/compiler/nir/nir_lower_undef_to_zero.c", "src/compiler/nir/nir_lower_uniforms_to_ubo.c", "src/compiler/nir/nir_lower_var_copies.c", "src/compiler/nir/nir_lower_variable_initializers.c", "src/compiler/nir/nir_lower_vars_to_ssa.c", + "src/compiler/nir/nir_lower_vec3_to_vec4.c", "src/compiler/nir/nir_lower_vec_to_regs.c", "src/compiler/nir/nir_lower_view_index_to_device_index.c", + "src/compiler/nir/nir_lower_viewport_transform.c", + "src/compiler/nir/nir_lower_workgroup_size.c", "src/compiler/nir/nir_lower_wpos_center.c", + "src/compiler/nir/nir_lower_wpos_ytransform.c", + "src/compiler/nir/nir_lower_wrmasks.c", + "src/compiler/nir/nir_lower_xfb_to_stores.c", "src/compiler/nir/nir_metadata.c", + "src/compiler/nir/nir_mod_analysis.c", + "src/compiler/nir/nir_move_output_stores_to_end.c", "src/compiler/nir/nir_move_vec_src_uses_to_dest.c", "src/compiler/nir/nir_normalize_cubemap_coords.c", + "src/compiler/nir/nir_normalize_sin_cos.c", "src/compiler/nir/nir_opt_access.c", + "src/compiler/nir/nir_opt_algebraic.c", "src/compiler/nir/nir_opt_barriers.c", + "src/compiler/nir/nir_opt_barycentric.c", + "src/compiler/nir/nir_opt_call.c", + "src/compiler/nir/nir_opt_clip_cull_const.c", "src/compiler/nir/nir_opt_combine_stores.c", "src/compiler/nir/nir_opt_comparison_pre.c", - "src/compiler/nir/nir_opt_conditional_discard.c", "src/compiler/nir/nir_opt_constant_folding.c", "src/compiler/nir/nir_opt_copy_prop_vars.c", "src/compiler/nir/nir_opt_copy_propagate.c", @@ -1092,50 +714,89 @@ cc_library( "src/compiler/nir/nir_opt_dead_cf.c", "src/compiler/nir/nir_opt_dead_write_vars.c", "src/compiler/nir/nir_opt_find_array_copies.c", + "src/compiler/nir/nir_opt_fp_math_ctrl.c", + "src/compiler/nir/nir_opt_frag_coord_to_pixel_coord.c", + "src/compiler/nir/nir_opt_fragdepth.c", "src/compiler/nir/nir_opt_gcm.c", + "src/compiler/nir/nir_opt_generate_bfi.c", + "src/compiler/nir/nir_opt_group_loads.c", "src/compiler/nir/nir_opt_idiv_const.c", "src/compiler/nir/nir_opt_if.c", "src/compiler/nir/nir_opt_intrinsics.c", "src/compiler/nir/nir_opt_large_constants.c", + "src/compiler/nir/nir_opt_licm.c", + "src/compiler/nir/nir_opt_load_skip_helpers.c", "src/compiler/nir/nir_opt_load_store_vectorize.c", "src/compiler/nir/nir_opt_loop.c", "src/compiler/nir/nir_opt_loop_unroll.c", "src/compiler/nir/nir_opt_memcpy.c", "src/compiler/nir/nir_opt_move.c", + "src/compiler/nir/nir_opt_move_discards_to_top.c", + "src/compiler/nir/nir_opt_move_to_top.c", + "src/compiler/nir/nir_opt_mqsad.c", "src/compiler/nir/nir_opt_non_uniform_access.c", "src/compiler/nir/nir_opt_offsets.c", "src/compiler/nir/nir_opt_peephole_select.c", "src/compiler/nir/nir_opt_phi_precision.c", + "src/compiler/nir/nir_opt_phi_to_bool.c", + "src/compiler/nir/nir_opt_preamble.c", "src/compiler/nir/nir_opt_ray_queries.c", + "src/compiler/nir/nir_opt_reassociate.c", + "src/compiler/nir/nir_opt_reassociate_bfi.c", "src/compiler/nir/nir_opt_rematerialize_compares.c", "src/compiler/nir/nir_opt_remove_phis.c", + "src/compiler/nir/nir_opt_shared_vars_to_subgroup.c", "src/compiler/nir/nir_opt_shrink_stores.c", "src/compiler/nir/nir_opt_shrink_vectors.c", "src/compiler/nir/nir_opt_sink.c", "src/compiler/nir/nir_opt_undef.c", "src/compiler/nir/nir_opt_uniform_atomics.c", + "src/compiler/nir/nir_opt_uniform_subgroup.c", + "src/compiler/nir/nir_opt_uub.c", + "src/compiler/nir/nir_opt_varyings.c", "src/compiler/nir/nir_opt_vectorize.c", + "src/compiler/nir/nir_opt_vectorize_io.c", + "src/compiler/nir/nir_opt_vectorize_io_vars.c", + "src/compiler/nir/nir_passthrough_gs.c", + "src/compiler/nir/nir_passthrough_tcs.c", "src/compiler/nir/nir_phi_builder.c", "src/compiler/nir/nir_print.c", "src/compiler/nir/nir_propagate_invariant.c", "src/compiler/nir/nir_range_analysis.c", + "src/compiler/nir/nir_recompute_io_bases.c", "src/compiler/nir/nir_remove_dead_variables.c", + "src/compiler/nir/nir_remove_outputs.c", + "src/compiler/nir/nir_remove_tex_shadow.c", "src/compiler/nir/nir_repair_ssa.c", + "src/compiler/nir/nir_scale_fdiv.c", + "src/compiler/nir/nir_schedule.c", "src/compiler/nir/nir_search.c", + "src/compiler/nir/nir_separate_merged_clip_cull_io.c", "src/compiler/nir/nir_serialize.c", + "src/compiler/nir/nir_shader_bisect.c", "src/compiler/nir/nir_split_64bit_vec3_and_vec4.c", + "src/compiler/nir/nir_split_conversions.c", "src/compiler/nir/nir_split_per_member_structs.c", "src/compiler/nir/nir_split_var_copies.c", "src/compiler/nir/nir_split_vars.c", "src/compiler/nir/nir_sweep.c", "src/compiler/nir/nir_to_lcssa.c", "src/compiler/nir/nir_trivialize_registers.c", + "src/compiler/nir/nir_unlower_io_to_vars.c", + "src/compiler/nir/nir_use_dominance.c", "src/compiler/nir/nir_validate.c", "src/compiler/nir/nir_worklist.c", - ":nir_constant_expressions_impl", - ":nir_intrinsics_impl", - ":nir_opcodes_impl", - ":nir_opt_algebraic_impl", + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_constant_expressions_c", + ":gen_nir_intrinsic_c", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_c", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", ], hdrs = [ "src/compiler/nir/nir.h", @@ -1145,136 +806,427 @@ cc_library( "src/compiler/nir/nir_control_flow.h", "src/compiler/nir/nir_control_flow_private.h", "src/compiler/nir/nir_conversion_builder.h", - "src/compiler/nir/nir_defines.h", "src/compiler/nir/nir_deref.h", "src/compiler/nir/nir_format_convert.h", - "src/compiler/nir/nir_inline_helpers.h", "src/compiler/nir/nir_instr_set.h", "src/compiler/nir/nir_legacy.h", "src/compiler/nir/nir_loop_analyze.h", - "src/compiler/nir/nir_lower_blend.h", "src/compiler/nir/nir_phi_builder.h", - "src/compiler/nir/nir_precompiled.h", "src/compiler/nir/nir_range_analysis.h", "src/compiler/nir/nir_schedule.h", "src/compiler/nir/nir_search.h", "src/compiler/nir/nir_search_helpers.h", "src/compiler/nir/nir_serialize.h", + "src/compiler/nir/nir_shader_compiler_options.h", + "src/compiler/nir/nir_softfloat.h", + "src/compiler/nir/nir_tcs_info.h", "src/compiler/nir/nir_vla.h", "src/compiler/nir/nir_worklist.h", "src/compiler/nir/nir_xfb_info.h", - "src/compiler/nir/tests/nir_opt_varyings_test.h", - "src/compiler/nir/tests/nir_test.h", - ":nir_builder_opcodes_header", - ":nir_intrinsics_header", - ":nir_intrinsics_indices_header", - ":nir_opcodes_header", - ], - copts = MESA_DEFAULT_COPTS, - includes = [ - "src/compiler/nir", - ], - strip_include_prefix = "src/compiler", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, deps = [ - ":mesa_compiler", - ":mesa_compiler_glsl_list", - ":mesa_include_c99", - ":mesa_include_vulkan", + ":blake3", + ":compiler", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":mesa_util", + ":mesa_util_c11", + "@libdrm", + "@zlib", ], ) py_binary( - name = "spirv_info_gen", - srcs = ["src/compiler/spirv/spirv_info_gen.py"], - imports = [ - "src/compiler/spirv", + name = "nir_builder_opcodes_h", + srcs = [ + "src/compiler/nir/nir_builder_opcodes_h.py", + "src/compiler/nir/nir_intrinsics.py", + "src/compiler/nir/nir_opcodes.py", ], - main = "src/compiler/spirv/spirv_info_gen.py", - deps = [ - "@mako", + imports = ["src/compiler/nir"], + main = "src/compiler/nir/nir_builder_opcodes_h.py", + deps = ["@mako"], +) + +py_binary( + name = "nir_opcodes_c", + srcs = [ + "src/compiler/nir/nir_intrinsics.py", + "src/compiler/nir/nir_opcodes.py", + "src/compiler/nir/nir_opcodes_c.py", ], + imports = ["src/compiler/nir"], + main = "src/compiler/nir/nir_opcodes_c.py", + deps = ["@mako"], ) genrule( - name = "spirv_info_header", - srcs = ["src/compiler/spirv/spirv.core.grammar.json"], - outs = [ - "src/compiler/spirv/spirv_info.c", - "src/compiler/spirv/spirv_info.h", - ], - cmd = "python3 $(location spirv_info_gen) " + - "--json $(location src/compiler/spirv/spirv.core.grammar.json) " + - "--out-h $(location src/compiler/spirv/spirv_info.h) " + - "--out-c $(location src/compiler/spirv/spirv_info.c)", - tools = ["spirv_info_gen"], + name = "gen_nir_intrinsic_c", + srcs = ["src/compiler/nir/nir_intrinsics.py"], + outs = ["src/compiler/nir/nir_intrinsics.c"], + cmd = "$(location :nir_intrinsics_c) --out $(location src/compiler/nir/nir_intrinsics.c)", + tools = [":nir_intrinsics_c"], ) py_binary( - name = "vtn_gather_types_gen", - srcs = ["src/compiler/spirv/vtn_gather_types_c.py"], - imports = [ - "src/compiler/spirv", + name = "nir_intrinsics_indices_h", + srcs = [ + "src/compiler/nir/nir_intrinsics.py", + "src/compiler/nir/nir_intrinsics_indices_h.py", ], - main = "src/compiler/spirv/vtn_gather_types_c.py", - deps = [ - "@mako", + imports = ["src/compiler/nir"], + main = "src/compiler/nir/nir_intrinsics_indices_h.py", + deps = ["@mako"], +) + +py_binary( + name = "nir_opt_algebraic", + srcs = [ + "src/compiler/nir/nir_algebraic.py", + "src/compiler/nir/nir_opcodes.py", + "src/compiler/nir/nir_opt_algebraic.py", ], + imports = ["src/compiler/nir"], + main = "src/compiler/nir/nir_opt_algebraic.py", + deps = ["@mako"], ) genrule( - name = "vtn_gather_types_impl", + name = "gen_nir_intrinsics_h", + srcs = ["src/compiler/nir/nir_intrinsics.py"], + outs = ["src/compiler/nir/nir_intrinsics.h"], + cmd = "$(location :nir_intrinsics_h) --out $(location src/compiler/nir/nir_intrinsics.h)", + tools = [":nir_intrinsics_h"], +) + +py_binary( + name = "nir_intrinsics_c", srcs = [ - "src/compiler/spirv/spirv.core.grammar.json", - ], - outs = [ - "src/compiler/spirv/vtn_gather_types.c", + "src/compiler/nir/nir_intrinsics.py", + "src/compiler/nir/nir_intrinsics_c.py", ], - cmd = "python3 $(location :vtn_gather_types_gen) $(location src/compiler/spirv/spirv.core.grammar.json) $(location src/compiler/spirv/vtn_gather_types.c)", - tools = [":vtn_gather_types_gen"], + imports = ["src/compiler/nir"], + main = "src/compiler/nir/nir_intrinsics_c.py", + deps = ["@mako"], +) + +genrule( + name = "gen_vtn_generator_ids_h", + srcs = ["src/compiler/spirv/spir-v.xml"], + outs = ["src/compiler/spirv/vtn_generator_ids.h"], + cmd = "$(location :vtn_generator_ids_h) $(location src/compiler/spirv/spir-v.xml) $(location src/compiler/spirv/vtn_generator_ids.h)", + tools = [":vtn_generator_ids_h"], +) + +cc_library( + name = "include_directory_src_compiler_spirv", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/compiler/spirv/."], + textual_hdrs = glob( + ["src/compiler/spirv/**/*.h"], + allow_empty = True, + ) + [ + ":gen_spirv_info", + ":gen_vtn_generator_ids_h", + ], + visibility = ["//visibility:public"], ) py_binary( - name = "vtn_generator_ids_gen", + name = "vtn_generator_ids_h", srcs = ["src/compiler/spirv/vtn_generator_ids_h.py"], - imports = [ - "src/compiler/spirv", - ], + imports = ["src/compiler/spirv"], main = "src/compiler/spirv/vtn_generator_ids_h.py", + deps = ["@mako"], +) + +cc_binary( + name = "spirv2nir", + srcs = [ + "src/compiler/spirv/spirv2nir.c", + "src/compiler/spirv/spirv_info.h", + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ":gen_vtn_generator_ids_h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], deps = [ - "@mako", + ":blake3", + ":compiler", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_compiler_spirv", + ":mesa_util", + ":mesa_util_c11", + ":nir", + ":vtn", + "@libdrm", + "@zlib", ], ) genrule( - name = "gen_vtn_generator_ids_header", - srcs = [ - "src/compiler/spirv/spir-v.xml", - ], + name = "gen_spirv_info", + srcs = ["src/compiler/spirv/spirv.core.grammar.json"], outs = [ - "src/compiler/spirv/vtn_generator_ids.h", + "src/compiler/spirv/spirv_info.h", + "src/compiler/spirv/spirv_info.c", ], - cmd = "python3 $(location vtn_generator_ids_gen) $(location src/compiler/spirv/spir-v.xml) $(location src/compiler/spirv/vtn_generator_ids.h)", - tools = ["vtn_generator_ids_gen"], + cmd = "$(location :spirv_info_gen) --json $(location src/compiler/spirv/spirv.core.grammar.json) --out-h $(location src/compiler/spirv/spirv_info.h) --out-c $(location src/compiler/spirv/spirv_info.c)", + tools = [":spirv_info_gen"], +) + +py_binary( + name = "vtn_gather_types_c", + srcs = ["src/compiler/spirv/vtn_gather_types_c.py"], + imports = ["src/compiler/spirv"], + main = "src/compiler/spirv/vtn_gather_types_c.py", + deps = ["@mako"], ) cc_library( - name = "mesa_compiler_spirv", + name = "vtn", srcs = [ - "src/compiler/spirv/spirv_info.c", + "src/compiler/spirv/gl_spirv.c", "src/compiler/spirv/spirv_to_nir.c", "src/compiler/spirv/vtn_alu.c", "src/compiler/spirv/vtn_amd.c", "src/compiler/spirv/vtn_cfg.c", "src/compiler/spirv/vtn_cmat.c", "src/compiler/spirv/vtn_debug.c", - "src/compiler/spirv/vtn_gather_types.c", - "src/compiler/spirv/vtn_generator_ids.h", "src/compiler/spirv/vtn_glsl450.c", "src/compiler/spirv/vtn_opencl.c", - "src/compiler/spirv/vtn_private.h", "src/compiler/spirv/vtn_structured_cfg.c", "src/compiler/spirv/vtn_subgroup.c", "src/compiler/spirv/vtn_variables.c", + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_spirv_info", + ":gen_u_format_gen_h", + ":gen_vtn_gather_types_c", + ":gen_vtn_generator_ids_h", ], hdrs = [ "src/compiler/spirv/GLSL.ext.AMD.h", @@ -1283,259 +1235,233 @@ cc_library( "src/compiler/spirv/nir_spirv.h", "src/compiler/spirv/spirv.h", "src/compiler/spirv/spirv_info.h", + "src/compiler/spirv/vtn_private.h", ], - copts = MESA_DEFAULT_COPTS, - includes = [ - "src/compiler/spirv", - ], - strip_include_prefix = "src", - deps = [ - ":mesa_compiler", - ":mesa_compiler_nir", - ":mesa_include_vulkan", - ], -) - -cc_library( - name = "mesa_vulkan_util", - srcs = [ - "src/vulkan/util/vk_alloc.c", - "src/vulkan/util/vk_format.c", - "src/vulkan/util/vk_util.c", - "vk_enum_to_str.c", - ":vk_dispatch_table_impl", - ":vk_extensions_impl", - ], - hdrs = [ - "vk_enum_defines.h", - "vk_enum_to_str.h", - ":vk_dispatch_table_header", - ":vk_extensions_header", - ":vk_struct_type_cast_header", - ] + glob([ - "src/vulkan/util/*.h", - ]), - copts = MESA_DEFAULT_COPTS, - includes = [ - "src/vulkan/util", - ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, deps = [ - ":mesa_compiler", - ":mesa_compiler_nir", - ":mesa_compiler_spirv", - ":mesa_include_vulkan", + ":blake3", + ":compiler", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_compiler_spirv", ":mesa_util", - ":mesa_util_format", + ":mesa_util_c11", + ":nir", + "@libdrm", + "@zlib", ], ) -cc_library( - name = "mesa_gallium_drivers_llvmpipe", - srcs = [ - "src/gallium/drivers/llvmpipe/lp_bld_alpha.c", - "src/gallium/drivers/llvmpipe/lp_bld_blend.c", - "src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c", - "src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c", - "src/gallium/drivers/llvmpipe/lp_bld_depth.c", - "src/gallium/drivers/llvmpipe/lp_bld_interp.c", - "src/gallium/drivers/llvmpipe/lp_clear.c", - "src/gallium/drivers/llvmpipe/lp_context.c", - "src/gallium/drivers/llvmpipe/lp_cs_tpool.c", - "src/gallium/drivers/llvmpipe/lp_draw_arrays.c", - "src/gallium/drivers/llvmpipe/lp_fence.c", - "src/gallium/drivers/llvmpipe/lp_flush.c", - "src/gallium/drivers/llvmpipe/lp_jit.c", - "src/gallium/drivers/llvmpipe/lp_linear.c", - "src/gallium/drivers/llvmpipe/lp_linear_fastpath.c", - "src/gallium/drivers/llvmpipe/lp_linear_interp.c", - "src/gallium/drivers/llvmpipe/lp_linear_sampler.c", - "src/gallium/drivers/llvmpipe/lp_memory.c", - "src/gallium/drivers/llvmpipe/lp_perf.c", - "src/gallium/drivers/llvmpipe/lp_query.c", - "src/gallium/drivers/llvmpipe/lp_rast.c", - "src/gallium/drivers/llvmpipe/lp_rast_debug.c", - "src/gallium/drivers/llvmpipe/lp_rast_linear.c", - "src/gallium/drivers/llvmpipe/lp_rast_linear_fallback.c", - "src/gallium/drivers/llvmpipe/lp_rast_rect.c", - "src/gallium/drivers/llvmpipe/lp_rast_tri.c", - "src/gallium/drivers/llvmpipe/lp_scene.c", - "src/gallium/drivers/llvmpipe/lp_scene_queue.c", - "src/gallium/drivers/llvmpipe/lp_screen.c", - "src/gallium/drivers/llvmpipe/lp_setup.c", - "src/gallium/drivers/llvmpipe/lp_setup_analysis.c", - "src/gallium/drivers/llvmpipe/lp_setup_line.c", - "src/gallium/drivers/llvmpipe/lp_setup_point.c", - "src/gallium/drivers/llvmpipe/lp_setup_rect.c", - "src/gallium/drivers/llvmpipe/lp_setup_tri.c", - "src/gallium/drivers/llvmpipe/lp_setup_vbuf.c", - "src/gallium/drivers/llvmpipe/lp_state_blend.c", - "src/gallium/drivers/llvmpipe/lp_state_clip.c", - "src/gallium/drivers/llvmpipe/lp_state_cs.c", - "src/gallium/drivers/llvmpipe/lp_state_derived.c", - "src/gallium/drivers/llvmpipe/lp_state_fs.c", - "src/gallium/drivers/llvmpipe/lp_state_fs_analysis.c", - "src/gallium/drivers/llvmpipe/lp_state_fs_fastpath.c", - "src/gallium/drivers/llvmpipe/lp_state_fs_linear.c", - "src/gallium/drivers/llvmpipe/lp_state_fs_linear_llvm.c", - "src/gallium/drivers/llvmpipe/lp_state_gs.c", - "src/gallium/drivers/llvmpipe/lp_state_rasterizer.c", - "src/gallium/drivers/llvmpipe/lp_state_sampler.c", - "src/gallium/drivers/llvmpipe/lp_state_setup.c", - "src/gallium/drivers/llvmpipe/lp_state_so.c", - "src/gallium/drivers/llvmpipe/lp_state_surface.c", - "src/gallium/drivers/llvmpipe/lp_state_tess.c", - "src/gallium/drivers/llvmpipe/lp_state_vertex.c", - "src/gallium/drivers/llvmpipe/lp_state_vs.c", - "src/gallium/drivers/llvmpipe/lp_surface.c", - "src/gallium/drivers/llvmpipe/lp_tex_sample.c", - "src/gallium/drivers/llvmpipe/lp_texture.c", - "src/gallium/drivers/llvmpipe/lp_texture_handle.c", - ], - hdrs = [ - "src/gallium/drivers/llvmpipe/lp_bld_alpha.h", - "src/gallium/drivers/llvmpipe/lp_bld_blend.h", - "src/gallium/drivers/llvmpipe/lp_bld_depth.h", - "src/gallium/drivers/llvmpipe/lp_bld_interp.h", - "src/gallium/drivers/llvmpipe/lp_clear.h", - "src/gallium/drivers/llvmpipe/lp_context.h", - "src/gallium/drivers/llvmpipe/lp_cs_tpool.h", - "src/gallium/drivers/llvmpipe/lp_debug.h", - "src/gallium/drivers/llvmpipe/lp_fence.h", - "src/gallium/drivers/llvmpipe/lp_flush.h", - "src/gallium/drivers/llvmpipe/lp_jit.h", - "src/gallium/drivers/llvmpipe/lp_limits.h", - "src/gallium/drivers/llvmpipe/lp_linear_priv.h", - "src/gallium/drivers/llvmpipe/lp_linear_sampler_tmp.h", - "src/gallium/drivers/llvmpipe/lp_memory.h", - "src/gallium/drivers/llvmpipe/lp_perf.h", - "src/gallium/drivers/llvmpipe/lp_public.h", - "src/gallium/drivers/llvmpipe/lp_query.h", - "src/gallium/drivers/llvmpipe/lp_rast.h", - "src/gallium/drivers/llvmpipe/lp_rast_priv.h", - "src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h", - "src/gallium/drivers/llvmpipe/lp_scene.h", - "src/gallium/drivers/llvmpipe/lp_scene_queue.h", - "src/gallium/drivers/llvmpipe/lp_screen.h", - "src/gallium/drivers/llvmpipe/lp_setup.h", - "src/gallium/drivers/llvmpipe/lp_setup_context.h", - "src/gallium/drivers/llvmpipe/lp_state.h", - "src/gallium/drivers/llvmpipe/lp_state_cs.h", - "src/gallium/drivers/llvmpipe/lp_state_fs.h", - "src/gallium/drivers/llvmpipe/lp_state_setup.h", - "src/gallium/drivers/llvmpipe/lp_surface.h", - "src/gallium/drivers/llvmpipe/lp_test.h", - "src/gallium/drivers/llvmpipe/lp_tex_sample.h", - "src/gallium/drivers/llvmpipe/lp_texture.h", - "src/gallium/drivers/llvmpipe/lp_texture_handle.h", - ], - copts = MESA_DEFAULT_COPTS, - includes = [ - "src/gallium/drivers", - "src/gallium/drivers/llvmpipe", - ], - strip_include_prefix = "src", - deps = [ - ":mesa_commit", - ":mesa_drm", - ":mesa_gallium", - ":mesa_util", - ], +genrule( + name = "gen_vtn_gather_types_c", + srcs = ["src/compiler/spirv/spirv.core.grammar.json"], + outs = ["src/compiler/spirv/vtn_gather_types.c"], + cmd = "$(location :vtn_gather_types_c) $(location src/compiler/spirv/spirv.core.grammar.json) $(location src/compiler/spirv/vtn_gather_types.c)", + tools = [":vtn_gather_types_c"], ) py_binary( - name = "enums2names_py", - srcs = [ - "src/gallium/auxiliary/driver_trace/enums2names.py", - ], - imports = [ - "src/gallium/auxiliary/driver_trace", - ], - main = "src/gallium/auxiliary/driver_trace/enums2names.py", - deps = [ - "@mako", - ], + name = "spirv_info_gen", + srcs = ["src/compiler/spirv/spirv_info_gen.py"], + imports = ["src/compiler/spirv"], + main = "src/compiler/spirv/spirv_info_gen.py", + deps = ["@mako"], ) -genrule( - name = "gen_tr_util", - srcs = [ - "src/gallium/include/pipe/p_video_enums.h", - "src/gallium/include/pipe/p_defines.h", - "src/util/blend.h", - ], - outs = [ - "src/gallium/auxiliary/tr_util.c", - "src/gallium/auxiliary/tr_util.h", - ], - cmd = "python3 $(location :enums2names_py) $(location src/gallium/include/pipe/p_defines.h) $(location src/gallium/include/pipe/p_video_enums.h) $(location src/util/blend.h) -C $(location src/gallium/auxiliary/tr_util.c) -H $(location src/gallium/auxiliary/tr_util.h) -I tr_util.h", - tools = [ - ":enums2names_py", - ], +cc_library( + name = "include_directory_src_gallium_drivers", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/drivers"], + textual_hdrs = glob( + ["src/gallium/drivers/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], ) -py_binary( - name = "u_tracepoints_py", - srcs = [ - "src/gallium/auxiliary/util/u_tracepoints.py", - "src/util/perf/u_trace.py", - ], - imports = [ - "src/gallium/auxiliary/util", - "src/util/perf", - ], - main = "src/gallium/auxiliary/util/u_tracepoints.py", - deps = [ - "@mako", - ], +cc_library( + name = "include_directory_src_gallium_include", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/include"], + textual_hdrs = glob( + ["src/gallium/include/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], ) -genrule( - name = "gen_u_tracepoints_c", - outs = [ - "src/gallium/auxiliary/u_tracepoints.c", - ], - cmd = "python3 $(location u_tracepoints_py) -p external/mesa3d/src/util/perf -C $(location src/gallium/auxiliary/u_tracepoints.c)", - tools = [ - ":u_tracepoints_py", - ], +cc_library( + name = "include_directory_src_gallium_winsys", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/winsys"], + textual_hdrs = glob( + ["src/gallium/winsys/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], ) -genrule( - name = "gen_u_tracepoints_h", - outs = [ - "src/gallium/auxiliary/u_tracepoints.h", - ], - cmd = "python3 $(location u_tracepoints_py) -p external/mesa3d/src/util/perf -H $(location src/gallium/auxiliary/u_tracepoints.h)", - tools = [ - "u_tracepoints_py", - ], +cc_library( + name = "include_directory_src_gallium_auxiliary", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/auxiliary/."], + textual_hdrs = glob( + ["src/gallium/auxiliary/**/*.h"], + allow_empty = True, + ) + [ + ":gen_tr_util__ch_", + ":gen_u_tracepoints_h", + ], + visibility = ["//visibility:public"], + deps = [":include_directory_src_gallium_auxiliary_pipe_loader"], ) py_binary( - name = "u_indices_gen", - srcs = [ - "src/gallium/auxiliary/indices/u_indices_gen.py", - ], - imports = [ - "src/gallium/auxiliary/indices", - "src/util/perf", - ], - main = "src/gallium/auxiliary/indices/u_indices_gen.py", -) - -genrule( - name = "gen_u_indices", - outs = [ - "src/gallium/auxiliary/u_indices_gen.c", - ], - cmd = "python3 $(location :u_indices_gen) $(location src/gallium/auxiliary/u_indices_gen.c)", - tools = [ - ":u_indices_gen", - ], + name = "u_unfilled_gen", + srcs = ["src/gallium/auxiliary/indices/u_unfilled_gen.py"], + imports = ["src/gallium/auxiliary"], + main = "src/gallium/auxiliary/indices/u_unfilled_gen.py", ) cc_library( - name = "mesa_gallium", + name = "gallium", srcs = [ "src/gallium/auxiliary/cso_cache/cso_cache.c", "src/gallium/auxiliary/cso_cache/cso_context.c", @@ -1620,6 +1546,7 @@ cc_library( "src/gallium/auxiliary/gallivm/lp_bld_misc.cpp", "src/gallium/auxiliary/gallivm/lp_bld_nir.c", "src/gallium/auxiliary/gallivm/lp_bld_nir_aos.c", + "src/gallium/auxiliary/gallivm/lp_bld_nir_lower.c", "src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c", "src/gallium/auxiliary/gallivm/lp_bld_pack.c", "src/gallium/auxiliary/gallivm/lp_bld_passmgr.c", @@ -1655,14 +1582,8 @@ cc_library( "src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c", "src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c", "src/gallium/auxiliary/pipebuffer/pb_cache.c", - "src/gallium/auxiliary/pipebuffer/pb_slab.c", "src/gallium/auxiliary/pipebuffer/pb_validate.c", - "src/gallium/auxiliary/postprocess/pp_celshade.c", - "src/gallium/auxiliary/postprocess/pp_colors.c", - "src/gallium/auxiliary/postprocess/pp_init.c", - "src/gallium/auxiliary/postprocess/pp_mlaa.c", - "src/gallium/auxiliary/postprocess/pp_program.c", - "src/gallium/auxiliary/postprocess/pp_run.c", + "src/gallium/auxiliary/renderonly/renderonly.c", "src/gallium/auxiliary/rtasm/rtasm_execmem.c", "src/gallium/auxiliary/rtasm/rtasm_x86sse.c", "src/gallium/auxiliary/tessellator/p_tessellator.cpp", @@ -1675,7 +1596,6 @@ cc_library( "src/gallium/auxiliary/tgsi/tgsi_from_mesa.c", "src/gallium/auxiliary/tgsi/tgsi_info.c", "src/gallium/auxiliary/tgsi/tgsi_iterate.c", - "src/gallium/auxiliary/tgsi/tgsi_lowering.c", "src/gallium/auxiliary/tgsi/tgsi_parse.c", "src/gallium/auxiliary/tgsi/tgsi_point_sprite.c", "src/gallium/auxiliary/tgsi/tgsi_sanity.c", @@ -1687,18 +1607,13 @@ cc_library( "src/gallium/auxiliary/tgsi/tgsi_ureg.c", "src/gallium/auxiliary/tgsi/tgsi_util.c", "src/gallium/auxiliary/tgsi/tgsi_vpos.c", - "src/gallium/auxiliary/tr_util.c", "src/gallium/auxiliary/translate/translate.c", "src/gallium/auxiliary/translate/translate_cache.c", "src/gallium/auxiliary/translate/translate_generic.c", "src/gallium/auxiliary/translate/translate_sse.c", - "src/gallium/auxiliary/u_indices_gen.c", - "src/gallium/auxiliary/u_tracepoints.c", "src/gallium/auxiliary/util/u_async_debug.c", "src/gallium/auxiliary/util/u_bitmask.c", "src/gallium/auxiliary/util/u_blitter.c", - "src/gallium/auxiliary/util/u_cache.c", - "src/gallium/auxiliary/util/u_compute.c", "src/gallium/auxiliary/util/u_debug_describe.c", "src/gallium/auxiliary/util/u_debug_flush.c", "src/gallium/auxiliary/util/u_debug_image.c", @@ -1736,6 +1651,21 @@ cc_library( "src/gallium/auxiliary/util/u_upload_mgr.c", "src/gallium/auxiliary/util/u_vbuf.c", "src/gallium/auxiliary/util/u_vertex_state_cache.c", + ":gen_builtin_types_h", + ":gen_draw_nir_lower_opcodes_c", + ":gen_ir_expression_operation_h", + ":gen_lp_bld_nir_no_integer_algebraic_c", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_tr_util__ch_", + ":gen_u_format_gen_h", + ":gen_u_indices_gen_c", + ":gen_u_tracepoints_c", + ":gen_u_tracepoints_h", + ":gen_u_unfilled_gen_c", ], hdrs = [ "src/gallium/auxiliary/cso_cache/cso_cache.h", @@ -1792,7 +1722,6 @@ cc_library( "src/gallium/auxiliary/gallivm/lp_bld_init.h", "src/gallium/auxiliary/gallivm/lp_bld_intr.h", "src/gallium/auxiliary/gallivm/lp_bld_ir_common.h", - "src/gallium/auxiliary/gallivm/lp_bld_jit_sample.h", "src/gallium/auxiliary/gallivm/lp_bld_jit_types.h", "src/gallium/auxiliary/gallivm/lp_bld_limits.h", "src/gallium/auxiliary/gallivm/lp_bld_logic.h", @@ -1812,47 +1741,33 @@ cc_library( "src/gallium/auxiliary/hud/font.h", "src/gallium/auxiliary/hud/hud_context.h", "src/gallium/auxiliary/hud/hud_private.h", + "src/gallium/auxiliary/indices/u_indices.c", "src/gallium/auxiliary/indices/u_indices.h", "src/gallium/auxiliary/indices/u_indices_priv.h", "src/gallium/auxiliary/indices/u_primconvert.h", + "src/gallium/auxiliary/indices/u_unfilled_indices.c", "src/gallium/auxiliary/nir/nir_draw_helpers.h", "src/gallium/auxiliary/nir/nir_to_tgsi.h", "src/gallium/auxiliary/nir/nir_to_tgsi_info.h", - "src/gallium/auxiliary/nir/pipe_nir.h", "src/gallium/auxiliary/nir/tgsi_to_nir.h", "src/gallium/auxiliary/pipebuffer/pb_buffer.h", "src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h", "src/gallium/auxiliary/pipebuffer/pb_bufmgr.h", "src/gallium/auxiliary/pipebuffer/pb_cache.h", - "src/gallium/auxiliary/pipebuffer/pb_slab.h", "src/gallium/auxiliary/pipebuffer/pb_validate.h", - "src/gallium/auxiliary/postprocess/filters.h", - "src/gallium/auxiliary/postprocess/postprocess.h", - "src/gallium/auxiliary/postprocess/pp_celshade.h", - "src/gallium/auxiliary/postprocess/pp_colors.h", - "src/gallium/auxiliary/postprocess/pp_filters.h", - "src/gallium/auxiliary/postprocess/pp_mlaa.h", - "src/gallium/auxiliary/postprocess/pp_mlaa_areamap.h", - "src/gallium/auxiliary/postprocess/pp_private.h", + "src/gallium/auxiliary/renderonly/renderonly.h", "src/gallium/auxiliary/rtasm/rtasm_execmem.h", "src/gallium/auxiliary/rtasm/rtasm_x86sse.h", - "src/gallium/auxiliary/target-helpers/drm_helper.h", - "src/gallium/auxiliary/target-helpers/drm_helper_public.h", - "src/gallium/auxiliary/target-helpers/inline_debug_helper.h", - "src/gallium/auxiliary/target-helpers/sw_helper.h", - "src/gallium/auxiliary/target-helpers/sw_helper_public.h", "src/gallium/auxiliary/tessellator/p_tessellator.h", "src/gallium/auxiliary/tessellator/tessellator.hpp", "src/gallium/auxiliary/tgsi/tgsi_aa_point.h", "src/gallium/auxiliary/tgsi/tgsi_build.h", "src/gallium/auxiliary/tgsi/tgsi_dump.h", - "src/gallium/auxiliary/tgsi/tgsi_dynamic_indexing.h", "src/gallium/auxiliary/tgsi/tgsi_exec.h", "src/gallium/auxiliary/tgsi/tgsi_from_mesa.h", "src/gallium/auxiliary/tgsi/tgsi_info.h", "src/gallium/auxiliary/tgsi/tgsi_info_opcodes.h", "src/gallium/auxiliary/tgsi/tgsi_iterate.h", - "src/gallium/auxiliary/tgsi/tgsi_lowering.h", "src/gallium/auxiliary/tgsi/tgsi_opcode_tmp.h", "src/gallium/auxiliary/tgsi/tgsi_parse.h", "src/gallium/auxiliary/tgsi/tgsi_point_sprite.h", @@ -1864,18 +1779,13 @@ cc_library( "src/gallium/auxiliary/tgsi/tgsi_two_side.h", "src/gallium/auxiliary/tgsi/tgsi_ureg.h", "src/gallium/auxiliary/tgsi/tgsi_util.h", - "src/gallium/auxiliary/tgsi/tgsi_vpos.h", - "src/gallium/auxiliary/tr_util.h", "src/gallium/auxiliary/translate/translate.h", "src/gallium/auxiliary/translate/translate_cache.h", - "src/gallium/auxiliary/u_tracepoints.h", "src/gallium/auxiliary/util/u_async_debug.h", "src/gallium/auxiliary/util/u_bitcast.h", "src/gallium/auxiliary/util/u_bitmask.h", "src/gallium/auxiliary/util/u_blend.h", "src/gallium/auxiliary/util/u_blitter.h", - "src/gallium/auxiliary/util/u_cache.h", - "src/gallium/auxiliary/util/u_compute.h", "src/gallium/auxiliary/util/u_debug_cb.h", "src/gallium/auxiliary/util/u_debug_describe.h", "src/gallium/auxiliary/util/u_debug_flush.h", @@ -1886,7 +1796,6 @@ cc_library( "src/gallium/auxiliary/util/u_driconf.h", "src/gallium/auxiliary/util/u_dual_blend.h", "src/gallium/auxiliary/util/u_dump.h", - "src/gallium/auxiliary/util/u_file.h", "src/gallium/auxiliary/util/u_framebuffer.h", "src/gallium/auxiliary/util/u_gen_mipmap.h", "src/gallium/auxiliary/util/u_handle_table.h", @@ -1924,582 +1833,1099 @@ cc_library( "src/gallium/auxiliary/util/u_vertex_state_cache.h", "src/gallium/auxiliary/util/u_video.h", "src/gallium/auxiliary/util/u_viewport.h", - "src/gallium/auxiliary/vl/vl_bicubic_filter.h", - "src/gallium/auxiliary/vl/vl_codec.h", - "src/gallium/auxiliary/vl/vl_compositor.h", - "src/gallium/auxiliary/vl/vl_compositor_cs.h", - "src/gallium/auxiliary/vl/vl_compositor_gfx.h", - "src/gallium/auxiliary/vl/vl_csc.h", - "src/gallium/auxiliary/vl/vl_decoder.h", - "src/gallium/auxiliary/vl/vl_defines.h", - "src/gallium/auxiliary/vl/vl_deint_filter.h", - "src/gallium/auxiliary/vl/vl_idct.h", - "src/gallium/auxiliary/vl/vl_matrix_filter.h", - "src/gallium/auxiliary/vl/vl_mc.h", - "src/gallium/auxiliary/vl/vl_median_filter.h", - "src/gallium/auxiliary/vl/vl_mpeg12_bitstream.h", - "src/gallium/auxiliary/vl/vl_mpeg12_decoder.h", - "src/gallium/auxiliary/vl/vl_probs_table.h", - "src/gallium/auxiliary/vl/vl_types.h", - "src/gallium/auxiliary/vl/vl_vertex_buffers.h", - "src/gallium/auxiliary/vl/vl_video_buffer.h", - "src/gallium/auxiliary/vl/vl_winsys.h", - "src/gallium/auxiliary/vl/vl_zscan.h", - "src/gallium/include/frontend/api.h", - "src/gallium/include/frontend/drisw_api.h", - "src/gallium/include/frontend/drm_driver.h", - "src/gallium/include/frontend/opencl_interop.h", - "src/gallium/include/frontend/sw_driver.h", - "src/gallium/include/frontend/sw_winsys.h", - "src/gallium/include/frontend/vdpau_dmabuf.h", - "src/gallium/include/frontend/vdpau_funcs.h", - "src/gallium/include/frontend/vdpau_interop.h", - "src/gallium/include/frontend/winsys_handle.h", - "src/gallium/include/frontend/xlibsw_api.h", - "src/gallium/include/mesa_interface.h", - "src/gallium/include/pipe/p_context.h", - "src/gallium/include/pipe/p_defines.h", - "src/gallium/include/pipe/p_screen.h", - "src/gallium/include/pipe/p_shader_tokens.h", - "src/gallium/include/pipe/p_state.h", - "src/gallium/include/pipe/p_video_codec.h", - "src/gallium/include/pipe/p_video_enums.h", - "src/gallium/include/pipe/p_video_state.h", - "src/gallium/include/winsys/radeon_winsys.h", - "src/gallium/winsys/sw/dri/dri_sw_winsys.h", - "src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.h", - ], - copts = MESA_DEFAULT_COPTS, - includes = [ - "src/gallium/auxiliary", - "src/gallium/auxiliary/indices", - "src/gallium/auxiliary/tessellator", - "src/gallium/auxiliary/util", - "src/gallium/include", - "src/gallium/winsys", - ], - strip_include_prefix = "src/gallium", - textual_hdrs = [ - "src/gallium/auxiliary/indices/u_indices.c", # This is used as a kind of inl file... ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, deps = [ - ":mesa_compiler", - ":mesa_compiler_nir", - ":mesa_drm", + ":blake3", + ":compiler", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_auxiliary_util", + ":include_directory_src_gallium_include", + ":include_directory_src_loader", ":mesa_util", + ":mesa_util_c11", + ":nir", "@libdrm", "@swiftshader//:swiftshader_llvm", + "@zlib", ], ) -cc_library( - name = "mesa_pci_ids", - hdrs = [ - "include/pci_ids/crocus_pci_ids.h", - "include/pci_ids/i830_pci_ids.h", - "include/pci_ids/i915_pci_ids.h", - "include/pci_ids/iris_pci_ids.h", - "include/pci_ids/r300_pci_ids.h", - "include/pci_ids/r600_pci_ids.h", - "include/pci_ids/radeonsi_pci_ids.h", - "include/pci_ids/virtio_gpu_pci_ids.h", - "include/pci_ids/vmwgfx_pci_ids.h", - ], - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "include", +genrule( + name = "gen_u_tracepoints_c", + srcs = ["src/util/perf/u_trace.py"], + outs = ["src/gallium/auxiliary/u_tracepoints.c"], + cmd = "$(location :u_tracepoints) -p $$(dirname \"$(location src/util/perf/u_trace.py)\") -C $(location src/gallium/auxiliary/u_tracepoints.c)", + tools = [":u_tracepoints"], ) cc_library( - name = "mesa_virtio", - hdrs = [ - "src/virtio/virtio-gpu/drm_hw.h", - "src/virtio/virtio-gpu/venus_hw.h", - "src/virtio/virtio-gpu/virgl_hw.h", - "src/virtio/virtio-gpu/virgl_protocol.h", - "src/virtio/virtio-gpu/virgl_video_hw.h", - "src/virtio/virtio-gpu/virglrenderer_hw.h", + name = "galliumvlwinsys", + srcs = [ + "src/gallium/auxiliary/vl/vl_winsys_drm.c", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + hdrs = ["src/gallium/auxiliary/vl/vl_winsys.h"], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_drivers_zink", + ":include_directory_src_gallium_include", + ":include_directory_src_loader", + ":mesa_util", + ":mesa_util_c11", + "@libdrm", + "@zlib", ], - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "src", ) -cc_library( - name = "mesa_loader", +genrule( + name = "gen_u_unfilled_gen_c", + srcs = [], + outs = ["src/gallium/auxiliary/u_unfilled_gen.c"], + cmd = "$(location :u_unfilled_gen) $(location src/gallium/auxiliary/u_unfilled_gen.c)", + tools = [":u_unfilled_gen"], +) + +py_binary( + name = "lp_bld_nir_no_integer_algebraic", srcs = [ - "src/loader/loader.c", - "src/loader/loader_dri_helper.c", - "src/loader/pci_id_driver_map.h", - ], - hdrs = [ - "src/loader/loader.h", - "src/loader/loader_dri_helper.h", - ], - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "src/loader", - deps = [ - ":mesa_commit", - ":mesa_gallium", - ":mesa_pci_ids", + "src/compiler/nir/nir_algebraic.py", + "src/compiler/nir/nir_opcodes.py", + "src/gallium/auxiliary/gallivm/lp_bld_nir_no_integer_algebraic.py", ], + imports = ["src/gallium/auxiliary"], + main = "src/gallium/auxiliary/gallivm/lp_bld_nir_no_integer_algebraic.py", + deps = ["@mako"], ) -cc_library( - name = "mesa_gallium_winsys_sw_null", +py_binary( + name = "u_tracepoints", srcs = [ - "src/gallium/winsys/sw/null/null_sw_winsys.c", - ], - hdrs = [ - "src/gallium/winsys/sw/null/null_sw_winsys.h", - ], - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "src/gallium/winsys/sw/null", - deps = [ - ":mesa_gallium", + "src/gallium/auxiliary/util/u_tracepoints.py", + "src/util/perf/u_trace.py", ], + imports = ["src/gallium/auxiliary"], + main = "src/gallium/auxiliary/util/u_tracepoints.py", + deps = ["@mako"], ) -cc_library( - name = "mesa_gallium_winsys_sw_wrapper", +genrule( + name = "gen_tr_util__ch_", srcs = [ - "src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c", - ], - hdrs = [ - "src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.h", + "src/gallium/include/pipe/p_defines.h", + "src/gallium/include/pipe/p_video_enums.h", + "src/util/blend.h", ], - copts = MESA_DEFAULT_COPTS, - strip_include_prefix = "src/gallium/winsys/sw/wrapper", - deps = [ - ":mesa_gallium", + outs = [ + "src/gallium/auxiliary/tr_util.c", + "src/gallium/auxiliary/tr_util.h", ], + cmd = "$(location :enums2names) $(location src/gallium/include/pipe/p_defines.h) $(location src/gallium/include/pipe/p_video_enums.h) $(location src/util/blend.h) -C $(location src/gallium/auxiliary/tr_util.c) -H $(location src/gallium/auxiliary/tr_util.h)", + tools = [":enums2names"], ) cc_library( - name = "mesa_pipe_loader", + name = "galliumvl", srcs = [ - "src/gallium/auxiliary/pipe-loader/driinfo_gallium.h", - "src/gallium/auxiliary/pipe-loader/pipe_loader.c", - "src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c", - "src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h", - "src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c", + "src/gallium/auxiliary/vl/vl_codec.c", + "src/gallium/auxiliary/vl/vl_compositor.c", + "src/gallium/auxiliary/vl/vl_compositor_cs.c", + "src/gallium/auxiliary/vl/vl_compositor_gfx.c", + "src/gallium/auxiliary/vl/vl_compositor_proc.c", + "src/gallium/auxiliary/vl/vl_csc.c", + "src/gallium/auxiliary/vl/vl_deint_filter.c", + "src/gallium/auxiliary/vl/vl_deint_filter_cs.c", + "src/gallium/auxiliary/vl/vl_mpeg12_bitstream.c", + "src/gallium/auxiliary/vl/vl_proc.c", + "src/gallium/auxiliary/vl/vl_vertex_buffers.c", + "src/gallium/auxiliary/vl/vl_video_buffer.c", + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", ], hdrs = [ - "src/gallium/auxiliary/pipe-loader/pipe_loader.h", - ], - copts = MESA_DEFAULT_COPTS + [ - "-DGALLIUM_STATIC_TARGETS=1", - ], - includes = [ - "src/gallium/auxiliary/pipe-loader", + "src/gallium/auxiliary/vl/vl_codec.h", + "src/gallium/auxiliary/vl/vl_compositor.h", + "src/gallium/auxiliary/vl/vl_compositor_cs.h", + "src/gallium/auxiliary/vl/vl_compositor_gfx.h", + "src/gallium/auxiliary/vl/vl_compositor_proc.h", + "src/gallium/auxiliary/vl/vl_csc.h", + "src/gallium/auxiliary/vl/vl_defines.h", + "src/gallium/auxiliary/vl/vl_deint_filter.h", + "src/gallium/auxiliary/vl/vl_deint_filter_cs.h", + "src/gallium/auxiliary/vl/vl_mpeg12_bitstream.h", + "src/gallium/auxiliary/vl/vl_proc.h", + "src/gallium/auxiliary/vl/vl_types.h", + "src/gallium/auxiliary/vl/vl_vertex_buffers.h", + "src/gallium/auxiliary/vl/vl_video_buffer.h", ], - strip_include_prefix = "src/gallium/auxiliary", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, deps = [ - ":mesa_drm", - ":mesa_gallium", - ":mesa_gallium_winsys_sw_null", - ":mesa_gallium_winsys_sw_wrapper", - ":mesa_loader", + ":blake3", + ":compiler", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_include", ":mesa_util", - ":mesa_virtio", + ":mesa_util_c11", + ":nir", + "@libdrm", + "@zlib", ], ) -py_binary( - name = "vk_icd_gen", +genrule( + name = "gen_lp_bld_nir_no_integer_algebraic_c", srcs = [ - "src/vulkan/util/vk_icd_gen.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_icd_gen.py", - deps = [ - "@mako", + "src/compiler/nir/nir_algebraic.py", + "src/compiler/nir/nir_opcodes.py", ], + outs = ["src/gallium/auxiliary/lp_bld_nir_no_integer_algebraic.c"], + cmd = "$(location :lp_bld_nir_no_integer_algebraic) -p $$(dirname \"$(location src/compiler/nir/nir_algebraic.py)\") > $(location src/gallium/auxiliary/lp_bld_nir_no_integer_algebraic.c)", + tools = [":lp_bld_nir_no_integer_algebraic"], +) + +cc_library( + name = "include_directory_src_gallium_auxiliary_util", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/auxiliary/util"], + textual_hdrs = glob( + ["src/gallium/auxiliary/util/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], + deps = [":include_directory_src_gallium_auxiliary_pipe_loader"], ) py_binary( - name = "vk_cmd_queue_gen", + name = "draw_nir_lower_opcodes", srcs = [ - "src/vulkan/util/vk_cmd_queue_gen.py", - "src/vulkan/util/vk_entrypoints.py", - "src/vulkan/util/vk_extensions.py", - ], - imports = [ - "src/vulkan/util", - ], - main = "src/vulkan/util/vk_cmd_queue_gen.py", - deps = [ - "@mako", + "src/compiler/nir/nir_algebraic.py", + "src/compiler/nir/nir_opcodes.py", + "src/gallium/auxiliary/draw/draw_nir_lower_opcodes.py", ], + imports = ["src/gallium/auxiliary"], + main = "src/gallium/auxiliary/draw/draw_nir_lower_opcodes.py", + deps = ["@mako"], ) genrule( - name = "gen_wsi_common_entrypoints", + name = "gen_draw_nir_lower_opcodes_c", srcs = [ - "src/vulkan/registry/vk.xml", - ], - outs = [ - "src/vulkan/wsi/wsi_common_entrypoints.c", - "src/vulkan/wsi/wsi_common_entrypoints.h", + "src/compiler/nir/nir_algebraic.py", + "src/compiler/nir/nir_opcodes.py", ], - cmd = "python3 $(location :vk_entrypoints_gen) --xml " + - "$(location src/vulkan/registry/vk.xml) --proto --weak " + - "--out-c $(location src/vulkan/wsi/wsi_common_entrypoints.c) " + - "--out-h $(location src/vulkan/wsi/wsi_common_entrypoints.h) " + - "--prefix wsi --beta false", - tools = [":vk_entrypoints_gen"], + outs = ["src/gallium/auxiliary/draw_nir_lower_opcodes.c"], + cmd = "$(location :draw_nir_lower_opcodes) -p $$(dirname \"$(location src/compiler/nir/nir_algebraic.py)\") > $(location src/gallium/auxiliary/draw_nir_lower_opcodes.c)", + tools = [":draw_nir_lower_opcodes"], ) genrule( - name = "gen_vk_cmd_queue", - srcs = ["src/vulkan/registry/vk.xml"], - outs = [ - "src/vulkan/runtime/vk_cmd_queue.c", - "src/vulkan/runtime/vk_cmd_queue.h", - ], - cmd = "python3 $(location :vk_cmd_queue_gen) " + - "--xml $(location src/vulkan/registry/vk.xml) " + - "--out-c $(location src/vulkan/runtime/vk_cmd_queue.c) " + - "--out-h $(location src/vulkan/runtime/vk_cmd_queue.h) " + - "--beta false", - tools = [":vk_cmd_queue_gen"], + name = "gen_u_tracepoints_h", + srcs = ["src/util/perf/u_trace.py"], + outs = ["src/gallium/auxiliary/u_tracepoints.h"], + cmd = "$(location :u_tracepoints) -p $$(dirname \"$(location src/util/perf/u_trace.py)\") -H $(location src/gallium/auxiliary/u_tracepoints.h)", + tools = [":u_tracepoints"], ) -genrule( - name = "gen_vk_common_entrypoints", - srcs = ["src/vulkan/registry/vk.xml"], - outs = [ - "src/vulkan/runtime/temp/vk_common_entrypoints.c", - "src/vulkan/runtime/temp/vk_common_entrypoints.h", - ], - cmd = "python3 $(location :vk_entrypoints_gen) " + - "--xml $(location src/vulkan/registry/vk.xml) --proto --weak " + - "--out-c $(location src/vulkan/runtime/temp/vk_common_entrypoints.c) " + - "--out-h $(location src/vulkan/runtime/temp/vk_common_entrypoints.h) " + - " --prefix vk_common --beta false", - tools = [":vk_entrypoints_gen"], +py_binary( + name = "u_indices_gen", + srcs = ["src/gallium/auxiliary/indices/u_indices_gen.py"], + imports = ["src/gallium/auxiliary"], + main = "src/gallium/auxiliary/indices/u_indices_gen.py", ) -genrule( - name = "gen_modified_vk_common_entrypoints_header", +cc_library( + name = "galliumvl_stub", srcs = [ - "src/vulkan/runtime/temp/vk_common_entrypoints.c", - "src/vulkan/runtime/temp/vk_common_entrypoints.h", - ], - outs = [ - "src/vulkan/runtime/vk_common_entrypoints.c", - "src/vulkan/runtime/vk_common_entrypoints.h", + "src/gallium/auxiliary/vl/vl_stubs.c", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_include", + ":mesa_util", + ":mesa_util_c11", + "@libdrm", + "@zlib", ], - cmd = "sed 's/vk_common_DeviceWaitIdle(VkDevice device) VK_ENTRY_WEAK VK_ENTRY_HIDDEN/vk_common_DeviceWaitIdle(VkDevice device) VK_ENTRY_WEAK/g;' $(location :src/vulkan/runtime/temp/vk_common_entrypoints.h) > $(location :src/vulkan/runtime/vk_common_entrypoints.h); " + - "cp $(location src/vulkan/runtime/temp/vk_common_entrypoints.c) $(location src/vulkan/runtime/vk_common_entrypoints.c)", ) genrule( - name = "gen_vk_cmd_enqueue_entrypoints", - srcs = ["src/vulkan/registry/vk.xml"], - outs = [ - "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.c", - "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h", - ], - cmd = "python3 $(location :vk_entrypoints_gen) " + - "--xml $(location src/vulkan/registry/vk.xml) --proto --weak " + - "--out-c $(location src/vulkan/runtime/vk_cmd_enqueue_entrypoints.c) " + - "--out-h $(location src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h) " + - "--prefix vk_cmd_enqueue " + - "--prefix vk_cmd_enqueue_unless_primary " + - "--beta false", - tools = [":vk_entrypoints_gen"], + name = "gen_u_indices_gen_c", + srcs = [], + outs = ["src/gallium/auxiliary/u_indices_gen.c"], + cmd = "$(location :u_indices_gen) $(location src/gallium/auxiliary/u_indices_gen.c)", + tools = [":u_indices_gen"], ) -genrule( - name = "gen_vk_dispatch_trampolines", - srcs = ["src/vulkan/registry/vk.xml"], - outs = [ - "src/vulkan/runtime/vk_dispatch_trampolines.c", - "src/vulkan/runtime/vk_dispatch_trampolines.h", - ], - cmd = "python3 $(location :vk_dispatch_trampolines_gen) " + - "--xml $(location src/vulkan/registry/vk.xml) " + - "--out-c $(location src/vulkan/runtime/vk_dispatch_trampolines.c) " + - "--out-h $(location src/vulkan/runtime/vk_dispatch_trampolines.h) " + - "--beta false", - tools = [":vk_dispatch_trampolines_gen"], +py_binary( + name = "enums2names", + srcs = ["src/gallium/auxiliary/driver_trace/enums2names.py"], + imports = ["src/gallium/auxiliary"], + main = "src/gallium/auxiliary/driver_trace/enums2names.py", ) -genrule( - name = "gen_vk_physical_device_features", - srcs = ["src/vulkan/registry/vk.xml"], - outs = [ - "src/vulkan/runtime/vk_physical_device_features.c", - "src/vulkan/runtime/vk_physical_device_features.h", - ], - cmd = "python3 $(location :vk_physical_device_features_gen) " + - "--xml $(location src/vulkan/registry/vk.xml) " + - "--out-h $(location src/vulkan/runtime/vk_physical_device_features.h) " + - "--out-c $(location src/vulkan/runtime/vk_physical_device_features.c) " + - "--beta false", - tools = [":vk_physical_device_features_gen"], +cc_library( + name = "include_directory_src_gallium_auxiliary_pipe_loader", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/auxiliary/pipe-loader/."], + textual_hdrs = glob( + ["src/gallium/auxiliary/pipe-loader/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], ) -genrule( - name = "gen_vk_physical_device_properties", - srcs = ["src/vulkan/registry/vk.xml"], - outs = [ - "src/vulkan/runtime/vk_physical_device_properties.c", - "src/vulkan/runtime/vk_physical_device_properties.h", +cc_library( + name = "pipe_loader_static", + srcs = [ + "src/gallium/auxiliary/pipe-loader/pipe_loader.c", + "src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c", + "src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", ], - cmd = "python3 $(location :vk_physical_device_properties_gen) " + - "--xml $(location src/vulkan/registry/vk.xml) " + - "--out-h $(location src/vulkan/runtime/vk_physical_device_properties.h) " + - "--out-c $(location src/vulkan/runtime/vk_physical_device_properties.c) " + - "--beta false", - tools = [":vk_physical_device_properties_gen"], -) - -genrule( - name = "gen_vk_format_info", - srcs = ["src/vulkan/registry/vk.xml"], - outs = [ - "src/vulkan/runtime/vk_format_info.c", - "src/vulkan/runtime/vk_format_info.h", + hdrs = [ + "src/gallium/auxiliary/pipe-loader/driinfo_gallium.h", + "src/gallium/auxiliary/pipe-loader/pipe_loader.h", + "src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":gallium", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_auxiliary_pipe_loader", + ":include_directory_src_gallium_drivers", + ":include_directory_src_gallium_include", + ":include_directory_src_gallium_winsys", + ":include_directory_src_loader", + ":loader", + ":mesa_util", + ":mesa_util_c11", + ":ws_null", + ":wsw", + ":xmlconfig", + "@libdrm", + "@zlib", ], - cmd = "python3 $(location :vk_format_info_gen) " + - "--xml $(location src/vulkan/registry/vk.xml) " + - "--out-h $(location src/vulkan/runtime/vk_format_info.h) " + - "--out-c $(location src/vulkan/runtime/vk_format_info.c) ", - tools = [":vk_format_info_gen"], -) - -genrule( - name = "gen_vk_physical_device_spirv_caps", - srcs = ["src/vulkan/registry/vk.xml"], - outs = ["src/vulkan/runtime/vk_physical_device_spirv_caps.c"], - cmd = "python3 $(location :vk_physical_device_spirv_caps_gen) " + - "--xml $(location src/vulkan/registry/vk.xml) " + - "--out-c $(location src/vulkan/runtime/vk_physical_device_spirv_caps.c) " + - "--beta false", - tools = [":vk_physical_device_spirv_caps_gen"], -) - -genrule( - name = "gen_vk_synchronization_helpers_gen", - srcs = ["src/vulkan/registry/vk.xml"], - outs = ["src/vulkan/runtime/vk_synchronization_helpers.c"], - cmd = "python3 $(location :vk_synchronization_helpers_gen) " + - "--xml $(location src/vulkan/registry/vk.xml) " + - "--out-c $(location src/vulkan/runtime/vk_synchronization_helpers.c) " + - "--beta false", - tools = [":vk_synchronization_helpers_gen"], ) cc_library( - name = "mesa_vulkan_runtime", + name = "llvmpipe", srcs = [ - "src/vulkan/runtime/radix_sort/common/util.c", - "src/vulkan/runtime/radix_sort/common/vk/barrier.c", - "src/vulkan/runtime/radix_sort/radix_sort_u64.c", - "src/vulkan/runtime/radix_sort/radix_sort_vk.c", - "src/vulkan/runtime/rmv/vk_rmv_common.c", - "src/vulkan/runtime/rmv/vk_rmv_exporter.c", - "src/vulkan/runtime/vk_acceleration_structure.c", - "src/vulkan/runtime/vk_blend.c", - "src/vulkan/runtime/vk_buffer.c", - "src/vulkan/runtime/vk_buffer_view.c", - "src/vulkan/runtime/vk_cmd_copy.c", - "src/vulkan/runtime/vk_cmd_enqueue.c", - "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.c", - "src/vulkan/runtime/vk_cmd_queue.c", - "src/vulkan/runtime/vk_command_buffer.c", - "src/vulkan/runtime/vk_command_pool.c", - "src/vulkan/runtime/vk_common_entrypoints.c", - "src/vulkan/runtime/vk_debug_report.c", - "src/vulkan/runtime/vk_debug_utils.c", - "src/vulkan/runtime/vk_deferred_operation.c", - "src/vulkan/runtime/vk_descriptor_set_layout.c", - "src/vulkan/runtime/vk_descriptor_update_template.c", - "src/vulkan/runtime/vk_descriptors.c", - "src/vulkan/runtime/vk_device.c", - "src/vulkan/runtime/vk_device_generated_commands.c", - "src/vulkan/runtime/vk_device_memory.c", - "src/vulkan/runtime/vk_dispatch_trampolines.c", - "src/vulkan/runtime/vk_fence.c", - "src/vulkan/runtime/vk_format_info.c", - "src/vulkan/runtime/vk_framebuffer.c", - "src/vulkan/runtime/vk_graphics_state.c", - "src/vulkan/runtime/vk_image.c", - "src/vulkan/runtime/vk_instance.c", - "src/vulkan/runtime/vk_log.c", - "src/vulkan/runtime/vk_meta.c", - "src/vulkan/runtime/vk_meta_draw_rects.c", - "src/vulkan/runtime/vk_meta_object_list.c", - "src/vulkan/runtime/vk_nir.c", - "src/vulkan/runtime/vk_nir_convert_ycbcr.c", - "src/vulkan/runtime/vk_object.c", - "src/vulkan/runtime/vk_physical_device.c", - "src/vulkan/runtime/vk_physical_device_features.c", - "src/vulkan/runtime/vk_physical_device_properties.c", - "src/vulkan/runtime/vk_physical_device_spirv_caps.c", - "src/vulkan/runtime/vk_pipeline.c", - "src/vulkan/runtime/vk_pipeline_cache.c", - "src/vulkan/runtime/vk_pipeline_layout.c", - "src/vulkan/runtime/vk_query_pool.c", - "src/vulkan/runtime/vk_queue.c", - "src/vulkan/runtime/vk_render_pass.c", - "src/vulkan/runtime/vk_sampler.c", - "src/vulkan/runtime/vk_semaphore.c", - "src/vulkan/runtime/vk_shader.c", - "src/vulkan/runtime/vk_shader_module.c", - "src/vulkan/runtime/vk_standard_sample_locations.c", - "src/vulkan/runtime/vk_sync.c", - "src/vulkan/runtime/vk_sync_binary.c", - "src/vulkan/runtime/vk_sync_dummy.c", - "src/vulkan/runtime/vk_sync_timeline.c", - "src/vulkan/runtime/vk_synchronization.c", - "src/vulkan/runtime/vk_synchronization_helpers.c", - "src/vulkan/runtime/vk_video.c", - "src/vulkan/runtime/vk_ycbcr_conversion.c", - "src/vulkan/wsi/wsi_common.c", - "src/vulkan/wsi/wsi_common_drm.c", - "src/vulkan/wsi/wsi_common_entrypoints.c", - "src/vulkan/wsi/wsi_common_headless.c", + "src/gallium/drivers/llvmpipe/lp_bld_alpha.c", + "src/gallium/drivers/llvmpipe/lp_bld_blend.c", + "src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c", + "src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c", + "src/gallium/drivers/llvmpipe/lp_bld_depth.c", + "src/gallium/drivers/llvmpipe/lp_bld_interp.c", + "src/gallium/drivers/llvmpipe/lp_clear.c", + "src/gallium/drivers/llvmpipe/lp_context.c", + "src/gallium/drivers/llvmpipe/lp_cs_tpool.c", + "src/gallium/drivers/llvmpipe/lp_draw_arrays.c", + "src/gallium/drivers/llvmpipe/lp_fence.c", + "src/gallium/drivers/llvmpipe/lp_flush.c", + "src/gallium/drivers/llvmpipe/lp_jit.c", + "src/gallium/drivers/llvmpipe/lp_linear.c", + "src/gallium/drivers/llvmpipe/lp_linear_fastpath.c", + "src/gallium/drivers/llvmpipe/lp_linear_interp.c", + "src/gallium/drivers/llvmpipe/lp_linear_sampler.c", + "src/gallium/drivers/llvmpipe/lp_memory.c", + "src/gallium/drivers/llvmpipe/lp_perf.c", + "src/gallium/drivers/llvmpipe/lp_query.c", + "src/gallium/drivers/llvmpipe/lp_rast.c", + "src/gallium/drivers/llvmpipe/lp_rast_debug.c", + "src/gallium/drivers/llvmpipe/lp_rast_linear.c", + "src/gallium/drivers/llvmpipe/lp_rast_linear_fallback.c", + "src/gallium/drivers/llvmpipe/lp_rast_rect.c", + "src/gallium/drivers/llvmpipe/lp_rast_tri.c", + "src/gallium/drivers/llvmpipe/lp_scene.c", + "src/gallium/drivers/llvmpipe/lp_scene_queue.c", + "src/gallium/drivers/llvmpipe/lp_screen.c", + "src/gallium/drivers/llvmpipe/lp_setup.c", + "src/gallium/drivers/llvmpipe/lp_setup_analysis.c", + "src/gallium/drivers/llvmpipe/lp_setup_line.c", + "src/gallium/drivers/llvmpipe/lp_setup_point.c", + "src/gallium/drivers/llvmpipe/lp_setup_rect.c", + "src/gallium/drivers/llvmpipe/lp_setup_tri.c", + "src/gallium/drivers/llvmpipe/lp_setup_vbuf.c", + "src/gallium/drivers/llvmpipe/lp_state_blend.c", + "src/gallium/drivers/llvmpipe/lp_state_clip.c", + "src/gallium/drivers/llvmpipe/lp_state_cs.c", + "src/gallium/drivers/llvmpipe/lp_state_derived.c", + "src/gallium/drivers/llvmpipe/lp_state_fs.c", + "src/gallium/drivers/llvmpipe/lp_state_fs_analysis.c", + "src/gallium/drivers/llvmpipe/lp_state_fs_fastpath.c", + "src/gallium/drivers/llvmpipe/lp_state_fs_linear.c", + "src/gallium/drivers/llvmpipe/lp_state_fs_linear_llvm.c", + "src/gallium/drivers/llvmpipe/lp_state_gs.c", + "src/gallium/drivers/llvmpipe/lp_state_rasterizer.c", + "src/gallium/drivers/llvmpipe/lp_state_sampler.c", + "src/gallium/drivers/llvmpipe/lp_state_setup.c", + "src/gallium/drivers/llvmpipe/lp_state_so.c", + "src/gallium/drivers/llvmpipe/lp_state_surface.c", + "src/gallium/drivers/llvmpipe/lp_state_tess.c", + "src/gallium/drivers/llvmpipe/lp_state_vertex.c", + "src/gallium/drivers/llvmpipe/lp_state_vs.c", + "src/gallium/drivers/llvmpipe/lp_surface.c", + "src/gallium/drivers/llvmpipe/lp_tex_sample.c", + "src/gallium/drivers/llvmpipe/lp_texture.c", + "src/gallium/drivers/llvmpipe/lp_texture_handle.c", + ":gen_builtin_types_h", + ":gen_git_sha1_h", + ":gen_ir_expression_operation_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", ], hdrs = [ - "src/vulkan/runtime/astc_spv.h", - "src/vulkan/runtime/bvh/lbvh_generate_ir.spv.h", - "src/vulkan/runtime/bvh/lbvh_main.spv.h", - "src/vulkan/runtime/bvh/leaf.spv.h", - "src/vulkan/runtime/bvh/leaf_always_active.spv.h", - "src/vulkan/runtime/bvh/morton.spv.h", - "src/vulkan/runtime/bvh/ploc_internal.spv.h", - "src/vulkan/runtime/bvh/vk_build_helpers.h", - "src/vulkan/runtime/bvh/vk_build_interface.h", - "src/vulkan/runtime/bvh/vk_bvh.h", - "src/vulkan/runtime/radix_sort/common/macros.h", - "src/vulkan/runtime/radix_sort/common/util.h", - "src/vulkan/runtime/radix_sort/common/vk/barrier.h", - "src/vulkan/runtime/radix_sort/radix_sort_u64.h", - "src/vulkan/runtime/radix_sort/radix_sort_vk.h", - "src/vulkan/runtime/radix_sort/radix_sort_vk_devaddr.h", - "src/vulkan/runtime/radix_sort/radix_sort_vk_ext.h", - "src/vulkan/runtime/radix_sort/shaders/bufref.h", - "src/vulkan/runtime/radix_sort/shaders/config.h", - "src/vulkan/runtime/radix_sort/shaders/fill.comp.spv.h", - "src/vulkan/runtime/radix_sort/shaders/histogram.comp.spv.h", - "src/vulkan/runtime/radix_sort/shaders/init.comp.spv.h", - "src/vulkan/runtime/radix_sort/shaders/prefix.comp.spv.h", - "src/vulkan/runtime/radix_sort/shaders/prefix.h", - "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", - "src/vulkan/runtime/radix_sort/shaders/push.h", - "src/vulkan/runtime/radix_sort/shaders/scatter_0_even.comp.spv.h", - "src/vulkan/runtime/radix_sort/shaders/scatter_0_odd.comp.spv.h", - "src/vulkan/runtime/radix_sort/shaders/scatter_1_even.comp.spv.h", - "src/vulkan/runtime/radix_sort/shaders/scatter_1_odd.comp.spv.h", - "src/vulkan/runtime/radix_sort/target.h", - "src/vulkan/runtime/rmv/vk_rmv_common.h", - "src/vulkan/runtime/rmv/vk_rmv_tokens.h", - "src/vulkan/runtime/vk_acceleration_structure.h", - "src/vulkan/runtime/vk_android.h", - "src/vulkan/runtime/vk_blend.h", - "src/vulkan/runtime/vk_buffer.h", - "src/vulkan/runtime/vk_buffer_view.h", - "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h", - "src/vulkan/runtime/vk_cmd_queue.h", - "src/vulkan/runtime/vk_command_buffer.h", - "src/vulkan/runtime/vk_command_pool.h", - "src/vulkan/runtime/vk_common_entrypoints.h", - "src/vulkan/runtime/vk_debug_report.h", - "src/vulkan/runtime/vk_debug_utils.h", - "src/vulkan/runtime/vk_deferred_operation.h", - "src/vulkan/runtime/vk_descriptor_set_layout.h", - "src/vulkan/runtime/vk_descriptor_update_template.h", - "src/vulkan/runtime/vk_descriptors.h", - "src/vulkan/runtime/vk_device.h", - "src/vulkan/runtime/vk_device_generated_commands.h", - "src/vulkan/runtime/vk_device_memory.h", - "src/vulkan/runtime/vk_dispatch_trampolines.h", - "src/vulkan/runtime/vk_drm_syncobj.h", - "src/vulkan/runtime/vk_fence.h", - "src/vulkan/runtime/vk_format_info.h", - "src/vulkan/runtime/vk_framebuffer.h", - "src/vulkan/runtime/vk_graphics_state.h", - "src/vulkan/runtime/vk_image.h", - "src/vulkan/runtime/vk_instance.h", - "src/vulkan/runtime/vk_limits.h", - "src/vulkan/runtime/vk_log.h", - "src/vulkan/runtime/vk_meta.h", - "src/vulkan/runtime/vk_meta_object_list.h", - "src/vulkan/runtime/vk_meta_private.h", - "src/vulkan/runtime/vk_nir.h", - "src/vulkan/runtime/vk_nir_convert_ycbcr.h", - "src/vulkan/runtime/vk_object.h", - "src/vulkan/runtime/vk_physical_device.h", - "src/vulkan/runtime/vk_physical_device_features.h", - "src/vulkan/runtime/vk_physical_device_properties.h", - "src/vulkan/runtime/vk_pipeline.h", - "src/vulkan/runtime/vk_pipeline_cache.h", - "src/vulkan/runtime/vk_pipeline_layout.h", - "src/vulkan/runtime/vk_query_pool.h", - "src/vulkan/runtime/vk_queue.h", - "src/vulkan/runtime/vk_render_pass.h", - "src/vulkan/runtime/vk_sampler.h", - "src/vulkan/runtime/vk_semaphore.h", - "src/vulkan/runtime/vk_shader.h", - "src/vulkan/runtime/vk_shader_module.h", - "src/vulkan/runtime/vk_standard_sample_locations.h", - "src/vulkan/runtime/vk_sync.h", - "src/vulkan/runtime/vk_sync_binary.h", - "src/vulkan/runtime/vk_sync_dummy.h", - "src/vulkan/runtime/vk_sync_timeline.h", - "src/vulkan/runtime/vk_synchronization.h", - "src/vulkan/runtime/vk_texcompress_astc.h", - "src/vulkan/runtime/vk_texcompress_etc2.h", - "src/vulkan/runtime/vk_video.h", - "src/vulkan/runtime/vk_ycbcr_conversion.h", - "src/vulkan/wsi/wsi_common.h", - "src/vulkan/wsi/wsi_common_display.h", - "src/vulkan/wsi/wsi_common_drm.h", - "src/vulkan/wsi/wsi_common_entrypoints.h", - "src/vulkan/wsi/wsi_common_metal_layer.h", - "src/vulkan/wsi/wsi_common_private.h", - "src/vulkan/wsi/wsi_common_queue.h", - ], - copts = MESA_DEFAULT_COPTS, - includes = [ - "src/vulkan/runtime", - "src/vulkan/wsi", + "src/gallium/drivers/llvmpipe/lp_bld_alpha.h", + "src/gallium/drivers/llvmpipe/lp_bld_blend.h", + "src/gallium/drivers/llvmpipe/lp_bld_depth.h", + "src/gallium/drivers/llvmpipe/lp_bld_interp.h", + "src/gallium/drivers/llvmpipe/lp_clear.h", + "src/gallium/drivers/llvmpipe/lp_context.h", + "src/gallium/drivers/llvmpipe/lp_cs_tpool.h", + "src/gallium/drivers/llvmpipe/lp_debug.h", + "src/gallium/drivers/llvmpipe/lp_fence.h", + "src/gallium/drivers/llvmpipe/lp_flush.h", + "src/gallium/drivers/llvmpipe/lp_jit.h", + "src/gallium/drivers/llvmpipe/lp_limits.h", + "src/gallium/drivers/llvmpipe/lp_linear_sampler_tmp.h", + "src/gallium/drivers/llvmpipe/lp_memory.h", + "src/gallium/drivers/llvmpipe/lp_perf.h", + "src/gallium/drivers/llvmpipe/lp_public.h", + "src/gallium/drivers/llvmpipe/lp_query.h", + "src/gallium/drivers/llvmpipe/lp_rast.h", + "src/gallium/drivers/llvmpipe/lp_rast_priv.h", + "src/gallium/drivers/llvmpipe/lp_rast_tri_tmp.h", + "src/gallium/drivers/llvmpipe/lp_scene.h", + "src/gallium/drivers/llvmpipe/lp_scene_queue.h", + "src/gallium/drivers/llvmpipe/lp_screen.h", + "src/gallium/drivers/llvmpipe/lp_setup.h", + "src/gallium/drivers/llvmpipe/lp_setup_context.h", + "src/gallium/drivers/llvmpipe/lp_state.h", + "src/gallium/drivers/llvmpipe/lp_state_cs.h", + "src/gallium/drivers/llvmpipe/lp_state_fs.h", + "src/gallium/drivers/llvmpipe/lp_state_setup.h", + "src/gallium/drivers/llvmpipe/lp_surface.h", + "src/gallium/drivers/llvmpipe/lp_tex_sample.h", + "src/gallium/drivers/llvmpipe/lp_texture.h", + "src/gallium/drivers/llvmpipe/lp_texture_handle.h", ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIUM_LLVMPIPE", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, deps = [ - ":mesa_compiler", - ":mesa_drm", + ":blake3", + ":gallium", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_drivers_llvmpipe", + ":include_directory_src_gallium_include", ":mesa_util", ":mesa_util_c11", - ":mesa_util_format", - ":mesa_vulkan_util", "@libdrm", + "@swiftshader//:swiftshader_llvm", + "@zlib", ], - alwayslink = 1, ) cc_library( - name = "vk_lavapipe_impl", + name = "include_directory_src_gallium_drivers_llvmpipe", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/drivers/llvmpipe/."], + textual_hdrs = glob( + ["src/gallium/drivers/llvmpipe/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +cc_library( + name = "include_directory_src_gallium_drivers_zink", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/drivers/zink/."], + textual_hdrs = glob( + ["src/gallium/drivers/zink/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +cc_library( + name = "lavapipe_st", srcs = [ + "src/compiler/spirv/spirv_info.h", "src/gallium/frontends/lavapipe/lvp_acceleration_structure.c", "src/gallium/frontends/lavapipe/lvp_cmd_buffer.c", "src/gallium/frontends/lavapipe/lvp_descriptor_set.c", "src/gallium/frontends/lavapipe/lvp_device.c", "src/gallium/frontends/lavapipe/lvp_device_generated_commands.c", - "src/gallium/frontends/lavapipe/lvp_entrypoints.c", - "src/gallium/frontends/lavapipe/lvp_entrypoints.h", "src/gallium/frontends/lavapipe/lvp_execute.c", "src/gallium/frontends/lavapipe/lvp_formats.c", "src/gallium/frontends/lavapipe/lvp_image.c", - "src/gallium/frontends/lavapipe/lvp_inline_uniforms.c", - "src/gallium/frontends/lavapipe/lvp_lower_exec_graph.c", - "src/gallium/frontends/lavapipe/lvp_lower_input_attachments.c", - "src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c", - "src/gallium/frontends/lavapipe/lvp_nir_lower_ray_queries.c", - "src/gallium/frontends/lavapipe/lvp_nir_lower_sparse_residency.c", - "src/gallium/frontends/lavapipe/lvp_nir_ray_tracing.c", "src/gallium/frontends/lavapipe/lvp_pipe_sync.c", "src/gallium/frontends/lavapipe/lvp_pipeline.c", "src/gallium/frontends/lavapipe/lvp_pipeline_cache.c", @@ -2507,58 +2933,3846 @@ cc_library( "src/gallium/frontends/lavapipe/lvp_ray_tracing_pipeline.c", "src/gallium/frontends/lavapipe/lvp_util.c", "src/gallium/frontends/lavapipe/lvp_wsi.c", - "src/gallium/targets/lavapipe/lavapipe_target.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_lower_cooperative_matrix.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_lower_descriptor_heaps.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_lower_exec_graph.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_lower_input_attachments.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_lower_pipeline_layout.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_lower_push_constants.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_lower_ray_queries.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_lower_sparse_residency.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_opt_robustness.c", + "src/gallium/frontends/lavapipe/nir/lvp_nir_ray_tracing.c", + "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h", + "src/vulkan/runtime/vk_cmd_queue.h", + "src/vulkan/runtime/vk_common_entrypoints.h", + "src/vulkan/runtime/vk_physical_device_features.h", + "src/vulkan/runtime/vk_physical_device_properties.h", + "src/vulkan/util/vk_dispatch_table.h", + "src/vulkan/util/vk_enum_defines.h", + "src/vulkan/util/vk_enum_to_str.h", + "src/vulkan/util/vk_extensions.h", + "src/vulkan/util/vk_struct_type_cast.h", + "src/vulkan/wsi/wsi_common_entrypoints.h", + ":gen_builtin_types_h", + ":gen_git_sha1_h", + ":gen_ir_expression_operation_h", + ":gen_lvp_drirc", + ":gen_lvp_entrypoints", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "VK_USE_PLATFORM_DISPLAY_KHR", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":compiler", + ":gallium", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_drivers_llvmpipe", + ":include_directory_src_gallium_frontends_lavapipe", + ":include_directory_src_gallium_include", + ":include_directory_src_vulkan_runtime", + ":include_directory_src_vulkan_runtime_bvh", + ":include_directory_src_vulkan_util", + ":include_directory_src_vulkan_wsi", + ":mesa_util", + ":mesa_util_c11", + ":nir", + ":pipe_loader_static", + ":vulkan_instance", + ":vulkan_lite_runtime", + ":vulkan_runtime", + ":vulkan_util", + ":vulkan_wsi", + "@libdrm", + "@swiftshader//:swiftshader_llvm", + "@zlib", ], - hdrs = [ - ] + glob([ - "src/gallium/include/**/*.h", - "src/gallium/drivers/llvmpipe/**/*.h", - "src/gallium/frontends/lavapipe/**/*.h", - ]), - copts = MESA_DEFAULT_COPTS + [ - "-DGALLIUM_LLVMPIPE", - "-DLVP_USE_WSI_PLATFORM", - ], - includes = [ - "src/gallium/drivers/llvmpipe", - "src/gallium/frontends/lavapipe", - "src/gallium/include", - ], - linkopts = [ - # Mesa always adds Bsymbolic when available (see 'ld_args_bsymbolic' in Meson build). Duplicate that - # behavior here. '--gc-sections' has stronger justification: this lets drivers drop - # shared code unused by that specific driver (particularly relevant for Vulkan drivers). - "-Wl,-Bsymbolic", - "-Wl,--gc-sections", + alwayslink = True, +) + +genrule( + name = "gen_lvp_entrypoints", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_entrypoints_gen.py", + "src/vulkan/util/vk_extensions.py", + ], + outs = [ + "src/gallium/frontends/lavapipe/lvp_entrypoints.h", + "src/gallium/frontends/lavapipe/lvp_entrypoints.c", + ], + cmd = "$(location :vk_entrypoints_gen) --xml $(location src/vulkan/registry/vk.xml) --proto --weak --out-h $(location src/gallium/frontends/lavapipe/lvp_entrypoints.h) --out-c $(location src/gallium/frontends/lavapipe/lvp_entrypoints.c) --prefix lvp --beta false", + tools = [":vk_entrypoints_gen"], +) + +genrule( + name = "gen_lvp_drirc", + srcs = [ + "src/gallium/frontends/lavapipe/00-lavapipe-defaults.conf", + "src/util/drirc_gen.py", + ], + outs = [ + "src/gallium/frontends/lavapipe/lvp_drirc.c", + "src/gallium/frontends/lavapipe/lvp_drirc.h", + ], + cmd = "$(location :lvp_drirc_gen) --import-path $$(dirname $(location src/util/drirc_gen.py)) --drirc-src $(location src/gallium/frontends/lavapipe/lvp_drirc.c) --drirc-hdr $(location src/gallium/frontends/lavapipe/lvp_drirc.h) --validate $(location src/gallium/frontends/lavapipe/00-lavapipe-defaults.conf)", + tools = [":lvp_drirc_gen"], +) + +cc_library( + name = "include_directory_src_gallium_frontends_lavapipe", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/frontends/lavapipe/."], + textual_hdrs = glob( + ["src/gallium/frontends/lavapipe/**/*.h"], + allow_empty = True, + ) + [ + ":gen_lvp_drirc", + ":gen_lvp_entrypoints", + ], + visibility = ["//visibility:public"], +) + +py_binary( + name = "lvp_drirc_gen", + srcs = [ + "src/gallium/frontends/lavapipe/lvp_drirc_gen.py", + "src/util/drirc_gen.py", + ], + imports = ["src/gallium/frontends/lavapipe"], + main = "src/gallium/frontends/lavapipe/lvp_drirc_gen.py", + deps = ["@mako"], +) + +cc_library( + name = "vulkan_lvp_lib", + srcs = [ + "src/gallium/targets/lavapipe/lavapipe_target.c", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIUM_LLVMPIPE", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", ], deps = [ - ":mesa_commit", - ":mesa_compiler", - ":mesa_compiler_nir", - ":mesa_drm", - ":mesa_gallium", - ":mesa_gallium_drivers_llvmpipe", - ":mesa_pipe_loader", + ":blake3", + ":gallium", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_drivers", + ":include_directory_src_gallium_include", + ":include_directory_src_gallium_targets_lavapipe", + ":include_directory_src_gallium_winsys", + ":lavapipe_st", + ":llvmpipe", ":mesa_util", ":mesa_util_c11", - ":mesa_util_format", - ":mesa_vulkan_runtime", - ":mesa_vulkan_util", + ":pipe_loader_static", + ":ws_null", + ":wsw", + "@libdrm", + "@swiftshader//:swiftshader_llvm", + "@zlib", ], ) -cc_shared_library( - name = "vk_lavapipe", - additional_linker_inputs = [ - "src/vulkan/vulkan.sym", +genrule( + name = "gen_lvp_icd", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_icd_gen.py", ], + outs = ["src/gallium/targets/lavapipe/lvp_icd.json"], + cmd = "$(location :vk_icd_gen) --api-version 1.4 --xml $(location src/vulkan/registry/vk.xml) --sizeof-pointer 8 --icd-lib-path /usr/local/lib --icd-filename libvulkan_lvp.so --out $(location src/gallium/targets/lavapipe/lvp_icd.json)", + tools = [":vk_icd_gen"], +) + +cc_library( + name = "include_directory_src_gallium_targets_lavapipe", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/targets/lavapipe/."], + textual_hdrs = glob( + ["src/gallium/targets/lavapipe/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +cc_shared_library( + name = "vulkan_lvp", + additional_linker_inputs = ["src/vulkan/vulkan.sym"], user_link_flags = [ - "-Wl,-Bsymbolic", - "-Wl,--gc-sections", "-Wl,--version-script=$(location src/vulkan/vulkan.sym)", - "-Wl,--undefined-version", + "-Wl,--gc-sections", + "-Wl,--no-undefined", + ], + deps = [ + ":lavapipe_st", + ":vulkan_lvp_lib", + ], +) + +cc_library( + name = "ws_null", + srcs = [ + "src/gallium/winsys/sw/null/null_sw_winsys.c", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + hdrs = ["src/gallium/winsys/sw/null/null_sw_winsys.h"], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_include", + ":include_directory_src_gallium_winsys_sw_null", + ":mesa_util", + ":mesa_util_c11", + "@libdrm", + "@zlib", + ], +) + +cc_library( + name = "include_directory_src_gallium_winsys_sw_null", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/winsys/sw/null/."], + textual_hdrs = glob( + ["src/gallium/winsys/sw/null/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +cc_library( + name = "wsw", + srcs = [ + "src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + hdrs = ["src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.h"], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_gallium_auxiliary", + ":include_directory_src_gallium_include", + ":include_directory_src_gallium_winsys_sw_wrapper", + ":mesa_util", + ":mesa_util_c11", + "@libdrm", + "@zlib", ], +) + +cc_library( + name = "include_directory_src_gallium_winsys_sw_wrapper", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/gallium/winsys/sw/wrapper/."], + textual_hdrs = glob( + ["src/gallium/winsys/sw/wrapper/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +cc_library( + name = "include_directory_src_loader", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/loader/."], + textual_hdrs = glob( + ["src/loader/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +cc_library( + name = "loader", + srcs = [ + "src/loader/loader.c", + "src/loader/loader_dri_helper.c", + ":gen_git_sha1_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_DRICONF", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, deps = [ - ":vk_lavapipe_impl", + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_gallium_include", + ":include_directory_src_loader", + ":mesa_util", + ":mesa_util_c11", + "@libdrm", + "@zlib", + ], +) + +cc_library( + name = "mesa_util", + srcs = [ + "src/util/anon_file.c", + "src/util/bitscan.c", + "src/util/blob.c", + "src/util/build_id.c", + "src/util/cnd_monotonic.c", + "src/util/compress.c", + "src/util/crc32.c", + "src/util/dag.c", + "src/util/disk_cache.c", + "src/util/disk_cache_os.c", + "src/util/double.c", + "src/util/fast_idiv_by_const.c", + "src/util/float8.c", + "src/util/format/u_format.c", + "src/util/format/u_format_bptc.c", + "src/util/format/u_format_etc.c", + "src/util/format/u_format_fxt1.c", + "src/util/format/u_format_latc.c", + "src/util/format/u_format_other.c", + "src/util/format/u_format_rgtc.c", + "src/util/format/u_format_s3tc.c", + "src/util/format/u_format_tests.c", + "src/util/format/u_format_unpack_neon.c", + "src/util/format/u_format_yuv.c", + "src/util/format/u_format_zs.c", + "src/util/fossilize_db.c", + "src/util/futex.c", + "src/util/half_float.c", + "src/util/hash_table.c", + "src/util/helpers.c", + "src/util/log.c", + "src/util/lut.c", + "src/util/memstream.c", + "src/util/mesa-blake3.c", + "src/util/mesa_cache_db.c", + "src/util/mesa_cache_db_multipart.c", + "src/util/os_file.c", + "src/util/os_file_notify.c", + "src/util/os_memory_fd.c", + "src/util/os_misc.c", + "src/util/os_socket.c", + "src/util/os_time.c", + "src/util/pb_slab.c", + "src/util/perf/u_trace.c", + "src/util/ralloc.c", + "src/util/rand_xor.c", + "src/util/range_minimum_query.c", + "src/util/rb_tree.c", + "src/util/register_allocate.c", + "src/util/rgtc.c", + "src/util/rwlock.c", + "src/util/set.c", + "src/util/simple_mtx.c", + "src/util/slab.c", + "src/util/softfloat.c", + "src/util/sparse_array.c", + "src/util/string_buffer.c", + "src/util/strndup.c", + "src/util/strtod.c", + "src/util/texcompress_astc.cpp", + "src/util/texcompress_astc_luts.cpp", + "src/util/texcompress_astc_luts_wrap.cpp", + "src/util/thread_sched.c", + "src/util/u_atomic.c", + "src/util/u_call_once.c", + "src/util/u_cpu_detect.c", + "src/util/u_debug.c", + "src/util/u_debug_memory.c", + "src/util/u_debug_stack.c", + "src/util/u_debug_symbol.c", + "src/util/u_dl.c", + "src/util/u_dynarray.c", + "src/util/u_hash_table.c", + "src/util/u_idalloc.c", + "src/util/u_math.c", + "src/util/u_mm.c", + "src/util/u_printf.c", + "src/util/u_process.c", + "src/util/u_qsort.cpp", + "src/util/u_queue.c", + "src/util/u_range_remap.c", + "src/util/u_shader_variant_cache.c", + "src/util/u_string.c", + "src/util/u_sync_provider.c", + "src/util/u_thread.c", + "src/util/u_vector.c", + "src/util/u_worklist.c", + "src/util/vl_zscan_data.c", + "src/util/vma.c", + ":gen_format_srgb", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ":gen_u_format_pack_h", + ":gen_u_format_table_c", + ] + select({ + "@platforms//cpu:arm64": ["src/util/cache_ops_aarch64.c"], + "@platforms//cpu:x86_64": [], + }), + hdrs = [ + "src/util/anon_file.h", + "src/util/bigmath.h", + "src/util/bitscan.h", + "src/util/bitset.h", + "src/util/blend.h", + "src/util/blob.h", + "src/util/box.h", + "src/util/build_id.h", + "src/util/cache_ops.h", + "src/util/cnd_monotonic.h", + "src/util/compiler.h", + "src/util/compress.h", + "src/util/crc32.h", + "src/util/disk_cache.h", + "src/util/disk_cache_os.h", + "src/util/double.h", + "src/util/enum_operators.h", + "src/util/fast_idiv_by_const.h", + "src/util/format_r11g11b10f.h", + "src/util/format_rgb9e5.h", + "src/util/format_srgb.h", + "src/util/fossilize_db.h", + "src/util/futex.h", + "src/util/glheader.h", + "src/util/half_float.h", + "src/util/hash_table.h", + "src/util/helpers.h", + "src/util/hex.h", + "src/util/list.h", + "src/util/macros.h", + "src/util/memstream.h", + "src/util/mesa-blake3.h", + "src/util/mesa_cache_db.h", + "src/util/mesa_cache_db_multipart.h", + "src/util/os_drm.h", + "src/util/os_misc.h", + "src/util/os_socket.h", + "src/util/os_time.h", + "src/util/pb_slab.h", + "src/util/perf/u_trace.h", + "src/util/perf/u_trace_priv.h", + "src/util/ptralloc.h", + "src/util/ralloc.h", + "src/util/rand_xor.h", + "src/util/range_minimum_query.h", + "src/util/rb_tree.h", + "src/util/register_allocate.h", + "src/util/rgtc.h", + "src/util/rounding.h", + "src/util/rwlock.h", + "src/util/set.h", + "src/util/simple_mtx.h", + "src/util/slab.h", + "src/util/softfloat.h", + "src/util/sparse_array.h", + "src/util/stack_array.h", + "src/util/string_buffer.h", + "src/util/strndup.h", + "src/util/strtod.h", + "src/util/texcompress_astc.h", + "src/util/texcompress_astc_luts.h", + "src/util/texcompress_astc_luts_wrap.h", + "src/util/thread_sched.h", + "src/util/timespec.h", + "src/util/u_atomic.h", + "src/util/u_call_once.h", + "src/util/u_cpu_detect.h", + "src/util/u_debug.h", + "src/util/u_debug_symbol.h", + "src/util/u_dl.h", + "src/util/u_dynarray.h", + "src/util/u_endian.h", + "src/util/u_hash_table.h", + "src/util/u_idalloc.h", + "src/util/u_math.h", + "src/util/u_memset.h", + "src/util/u_mm.h", + "src/util/u_overflow.h", + "src/util/u_pack_color.h", + "src/util/u_pointer.h", + "src/util/u_printf.h", + "src/util/u_process.h", + "src/util/u_qsort.h", + "src/util/u_queue.h", + "src/util/u_range_remap.h", + "src/util/u_shader_variant_cache.h", + "src/util/u_string.h", + "src/util/u_sync_provider.h", + "src/util/u_thread.h", + "src/util/u_tristate.h", + "src/util/u_vector.h", + "src/util/u_worklist.h", + "src/util/vl_rbsp.h", + "src/util/vl_vlc.h", + "src/util/vl_zscan_data.h", + "src/util/vma.h", + "src/util/xxhash.h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_util", + ":include_directory_src_util_blake3", + ":include_directory_src_util_format", + ":mesa_util_c11", + ":mesa_util_simd", + "@libdrm", + "@zlib", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": [":mesa_util_clflush"], + }), +) + +genrule( + name = "gen_shader_stats_h", + srcs = [ + "src/util/shader_stats.rnc", + "src/util/shader_stats.xml", + ], + outs = ["src/util/shader_stats.h"], + cmd = "$(location :process_shader_stats) $(location src/util/shader_stats.rnc) $(location src/util/shader_stats.xml) > $(location src/util/shader_stats.h)", + tools = [":process_shader_stats"], +) + +cc_library( + name = "parson", + srcs = ["src/util/parson.c"], + hdrs = ["src/util/parson.h"], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":include_directory_src_util", + ":include_directory_src_util_blake3", + ":include_directory_src_util_format", + ], +) + +cc_library( + name = "xmlconfig", + srcs = [ + "src/util/xmlconfig.c", + ":gen_driconf_static_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + hdrs = ["src/util/xmlconfig.h"], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DATADIR=\\\"/usr/local/share\\\"", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "SYSCONFDIR=\\\"/usr/local/etc\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "WITH_XMLCONFIG=0", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_util", + ":include_directory_src_util_blake3", + ":include_directory_src_util_format", + ":mesa_util", + ":mesa_util_c11", + "@libdrm", + "@zlib", + ], +) + +genrule( + name = "gen_format_srgb", + srcs = [], + outs = ["src/util/format_srgb.c"], + cmd = "$(location :format_srgb) > $(location src/util/format_srgb.c)", + tools = [":format_srgb"], +) + +cc_library( + name = "mesa_util_simd", + srcs = ["src/util/streaming-load-memcpy.c"], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["-msse4.1"], + }), + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_util", + ":include_directory_src_util_blake3", + ":include_directory_src_util_format", + ], +) + +py_binary( + name = "format_srgb", + srcs = ["src/util/format_srgb.py"], + imports = ["src/util"], + main = "src/util/format_srgb.py", +) + +genrule( + name = "gen_driconf_static_h", + srcs = [ + "src/gallium/frontends/lavapipe/00-lavapipe-defaults.conf", + "src/util/00-mesa-defaults.conf", + ], + outs = ["src/util/driconf_static.h"], + cmd = "$(location :driconf_static) $(location src/util/00-mesa-defaults.conf) $(location src/gallium/frontends/lavapipe/00-lavapipe-defaults.conf) $(location src/util/driconf_static.h)", + tools = [":driconf_static"], +) + +cc_library( + name = "mesa_util_clflush", + srcs = select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["src/util/cache_ops_x86.c"], + }), + copts = select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + }), + defines = select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "USE_SSE41", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ], + }), + features = select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": [ + "-layering_check", + "-parse_headers", + ], + }), + linkstatic = select({ + "@platforms//cpu:arm64": False, + "@platforms//cpu:x86_64": True, + }), + deps = select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": [ + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_util", + ":include_directory_src_util_blake3", + ":include_directory_src_util_format", + ], + }), +) + +cc_library( + name = "include_directory_src_util", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/util/."], + textual_hdrs = glob( + ["src/util/**/*.h"], + allow_empty = True, + ) + [ + ":gen_driconf_static_h", + ":gen_shader_stats_h", + ], + visibility = ["//visibility:public"], + deps = [ + ":include_directory_src_util_blake3", + ":include_directory_src_util_format", + ], +) + +py_binary( + name = "driconf_static", + srcs = ["src/util/driconf_static.py"], + imports = ["src/util"], + main = "src/util/driconf_static.py", + deps = ["@mako"], +) + +py_binary( + name = "process_shader_stats", + srcs = ["src/util/process_shader_stats.py"], + imports = ["src/util"], + main = "src/util/process_shader_stats.py", + deps = ["@mako"], +) + +cc_library( + name = "blake3", + srcs = [ + "src/util/blake3/blake3.c", + "src/util/blake3/blake3_dispatch.c", + "src/util/blake3/blake3_portable.c", + ] + select({ + "@platforms//cpu:arm64": ["src/util/blake3/blake3_neon.c"], + "@platforms//cpu:x86_64": [ + "src/util/blake3/blake3_avx2_x86-64_unix.S", + "src/util/blake3/blake3_avx512_x86-64_unix.S", + "src/util/blake3/blake3_sse2_x86-64_unix.S", + "src/util/blake3/blake3_sse41_x86-64_unix.S", + ], + }), + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [":include_directory_src_util_blake3"], +) + +cc_library( + name = "include_directory_src_util_blake3", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/util/blake3/."], + textual_hdrs = glob( + ["src/util/blake3/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +py_binary( + name = "u_format_table", + srcs = [ + "src/util/format/u_format_pack.py", + "src/util/format/u_format_parse.py", + "src/util/format/u_format_table.py", + ], + imports = ["src/util/format"], + main = "src/util/format/u_format_table.py", + deps = ["@pyyaml//:yaml"], +) + +genrule( + name = "gen_u_format_table_c", + srcs = [ + "src/util/format/u_format.yaml", + "src/util/format/u_format_pack.py", + "src/util/format/u_format_parse.py", + ], + outs = ["src/util/format/u_format_table.c"], + cmd = "$(location :u_format_table) $(location src/util/format/u_format.yaml) > $(location src/util/format/u_format_table.c)", + tools = [":u_format_table"], +) + +genrule( + name = "gen_u_format_gen_h", + srcs = [ + "src/util/format/u_format.yaml", + "src/util/format/u_format_pack.py", + "src/util/format/u_format_parse.py", + ], + outs = ["src/util/format/u_format_gen.h"], + cmd = "$(location :u_format_table) $(location src/util/format/u_format.yaml) --enums > $(location src/util/format/u_format_gen.h)", + tools = [":u_format_table"], +) + +cc_library( + name = "include_directory_src_util_format", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/util/format/."], + textual_hdrs = glob( + ["src/util/format/**/*.h"], + allow_empty = True, + ) + [ + ":gen_u_format_gen_h", + ":gen_u_format_pack_h", + ], + visibility = ["//visibility:public"], +) + +genrule( + name = "gen_u_format_pack_h", + srcs = [ + "src/util/format/u_format.yaml", + "src/util/format/u_format_pack.py", + "src/util/format/u_format_parse.py", + ], + outs = ["src/util/format/u_format_pack.h"], + cmd = "$(location :u_format_table) $(location src/util/format/u_format.yaml) --header > $(location src/util/format/u_format_pack.h)", + tools = [":u_format_table"], +) + +genrule( + name = "gen_vulkan_api_def", + srcs = [ + "bin/gen_vs_module_defs.py", + "src/vulkan/vulkan_api.def.in", + ], + outs = ["src/vulkan/vulkan_api.def"], + cmd = select({ + "@platforms//cpu:arm64": "$(location :gen_vs_module_defs) --in_file $(location src/vulkan/vulkan_api.def.in) --out_file $(location src/vulkan/vulkan_api.def) --compiler_abi gcc --compiler_id clang --cpu_family aarch64", + "@platforms//cpu:x86_64": "$(location :gen_vs_module_defs) --in_file $(location src/vulkan/vulkan_api.def.in) --out_file $(location src/vulkan/vulkan_api.def) --compiler_abi gcc --compiler_id clang --cpu_family x86_64", + }), + tools = [":gen_vs_module_defs"], +) + +cc_library( + name = "include_directory_src_vulkan", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/vulkan/."], + textual_hdrs = glob( + ["src/vulkan/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], + deps = [ + ":include_directory_src_vulkan_runtime", + ":include_directory_src_vulkan_util", + ":include_directory_src_vulkan_wsi", + ], +) + +genrule( + name = "gen_vk_dispatch_trampolines", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_dispatch_trampolines_gen.py", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_extensions.py", + ], + outs = [ + "src/vulkan/runtime/vk_dispatch_trampolines.c", + "src/vulkan/runtime/vk_dispatch_trampolines.h", + ], + cmd = "$(location :vk_dispatch_trampolines_gen) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/runtime/vk_dispatch_trampolines.c) --out-h $(location src/vulkan/runtime/vk_dispatch_trampolines.h) --beta false", + tools = [":vk_dispatch_trampolines_gen"], +) + +genrule( + name = "gen_vk_physical_device_properties", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_physical_device_properties_gen.py", + ], + outs = [ + "src/vulkan/runtime/vk_physical_device_properties.c", + "src/vulkan/runtime/vk_physical_device_properties.h", + ], + cmd = "$(location :vk_physical_device_properties_gen) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/runtime/vk_physical_device_properties.c) --out-h $(location src/vulkan/runtime/vk_physical_device_properties.h) --beta false", + tools = [":vk_physical_device_properties_gen"], +) + +genrule( + name = "gen_vk_synchronization_helpers", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_synchronization_helpers_gen.py", + ], + outs = ["src/vulkan/runtime/vk_synchronization_helpers.c"], + cmd = "$(location :vk_synchronization_helpers_gen) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/runtime/vk_synchronization_helpers.c) --beta false", + tools = [":vk_synchronization_helpers_gen"], +) + +py_binary( + name = "vk_format_info_gen", + srcs = ["src/vulkan/runtime/vk_format_info_gen.py"], + imports = ["src/vulkan/runtime"], + main = "src/vulkan/runtime/vk_format_info_gen.py", + deps = ["@mako"], +) + +cc_library( + name = "vulkan_instance", + srcs = [ + "src/compiler/spirv/spirv_info.h", + "src/vulkan/runtime/vk_instance.c", + "src/vulkan/util/vk_dispatch_table.h", + "src/vulkan/util/vk_enum_defines.h", + "src/vulkan/util/vk_enum_to_str.h", + "src/vulkan/util/vk_extensions.h", + "src/vulkan/util/vk_struct_type_cast.h", + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + hdrs = [ + "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h", + "src/vulkan/runtime/vk_cmd_queue.h", + "src/vulkan/runtime/vk_common_entrypoints.h", + "src/vulkan/runtime/vk_dispatch_trampolines.h", + "src/vulkan/runtime/vk_format_info.h", + "src/vulkan/runtime/vk_physical_device_features.h", + "src/vulkan/runtime/vk_physical_device_properties.h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "VK_LITE_RUNTIME_INSTANCE=0", + "VK_USE_PLATFORM_DISPLAY_KHR", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":compiler", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_vulkan_runtime", + ":include_directory_src_vulkan_runtime_bvh", + ":include_directory_src_vulkan_runtime_radix_sort", + ":include_directory_src_vulkan_runtime_radix_sort_shaders", + ":include_directory_src_vulkan_util", + ":mesa_util", + ":mesa_util_c11", + ":nir", + ":vtn", + ":vulkan_util", + "@libdrm", + "@zlib", + ], + alwayslink = True, +) + +cc_library( + name = "vulkan_runtime", + srcs = [ + "src/compiler/spirv/spirv_info.h", + "src/vulkan/runtime/radix_sort/common/macros.h", + "src/vulkan/runtime/radix_sort/common/util.c", + "src/vulkan/runtime/radix_sort/common/util.h", + "src/vulkan/runtime/radix_sort/common/vk/barrier.c", + "src/vulkan/runtime/radix_sort/common/vk/barrier.h", + "src/vulkan/runtime/radix_sort/radix_sort_u64.c", + "src/vulkan/runtime/radix_sort/radix_sort_u64.h", + "src/vulkan/runtime/radix_sort/radix_sort_u96.c", + "src/vulkan/runtime/radix_sort/radix_sort_vk.c", + "src/vulkan/runtime/radix_sort/radix_sort_vk.h", + "src/vulkan/runtime/radix_sort/radix_sort_vk_devaddr.h", + "src/vulkan/runtime/radix_sort/radix_sort_vk_ext.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/target.h", + "src/vulkan/runtime/vk_acceleration_structure.c", + "src/vulkan/runtime/vk_meta.c", + "src/vulkan/runtime/vk_meta_blit_resolve.c", + "src/vulkan/runtime/vk_meta_clear.c", + "src/vulkan/runtime/vk_meta_copy_fill_update.c", + "src/vulkan/runtime/vk_meta_draw_rects.c", + "src/vulkan/runtime/vk_nir.c", + "src/vulkan/runtime/vk_nir_convert_ycbcr.c", + "src/vulkan/runtime/vk_nir_lower_descriptor_heaps.c", + "src/vulkan/runtime/vk_pipeline.c", + "src/vulkan/runtime/vk_pipeline_cache.c", + "src/vulkan/runtime/vk_shader.c", + "src/vulkan/runtime/vk_shader_module.c", + "src/vulkan/runtime/vk_texcompress_astc.c", + "src/vulkan/runtime/vk_texcompress_etc2.c", + "src/vulkan/util/vk_dispatch_table.h", + "src/vulkan/util/vk_enum_defines.h", + "src/vulkan/util/vk_enum_to_str.h", + "src/vulkan/util/vk_extensions.h", + "src/vulkan/util/vk_struct_type_cast.h", + ":gen_astc_spv_h", + ":gen_builtin_types_h", + ":gen_fill_spv_h", + ":gen_hploc_internal_spv_h", + ":gen_id_prefix_sum_spv_h", + ":gen_ir_expression_operation_h", + ":gen_lbvh_generate_ir_spv_h", + ":gen_lbvh_main_spv_h", + ":gen_leaf_spv_h", + ":gen_morton_spv_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_pair_triangles_spv_h", + ":gen_ploc_internal_spv_h", + ":gen_shader_stats_h", + ":gen_u64_histogram_spv_h", + ":gen_u64_init_spv_h", + ":gen_u64_prefix_spv_h", + ":gen_u64_scatter_0_even_spv_h", + ":gen_u64_scatter_0_odd_spv_h", + ":gen_u64_scatter_1_even_spv_h", + ":gen_u64_scatter_1_odd_spv_h", + ":gen_u96_histogram_spv_h", + ":gen_u96_init_spv_h", + ":gen_u96_prefix_spv_h", + ":gen_u96_scatter_0_even_spv_h", + ":gen_u96_scatter_0_odd_spv_h", + ":gen_u96_scatter_1_even_spv_h", + ":gen_u96_scatter_1_odd_spv_h", + ":gen_u96_scatter_2_even_spv_h", + ":gen_u96_scatter_2_odd_spv_h", + ":gen_u_format_gen_h", + ], + hdrs = [ + "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h", + "src/vulkan/runtime/vk_cmd_queue.h", + "src/vulkan/runtime/vk_common_entrypoints.h", + "src/vulkan/runtime/vk_dispatch_trampolines.h", + "src/vulkan/runtime/vk_format_info.h", + "src/vulkan/runtime/vk_physical_device_features.h", + "src/vulkan/runtime/vk_physical_device_properties.h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "VK_USE_PLATFORM_DISPLAY_KHR", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":compiler", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_vulkan_runtime", + ":include_directory_src_vulkan_runtime_bvh", + ":include_directory_src_vulkan_runtime_radix_sort", + ":include_directory_src_vulkan_runtime_radix_sort_shaders", + ":include_directory_src_vulkan_util", + ":mesa_util", + ":mesa_util_c11", + ":nir", + ":vtn", + ":vulkan_util", + "@libdrm", + "@zlib", + ], + alwayslink = True, +) + +genrule( + name = "gen_vk_cmd_queue", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_cmd_queue_gen.py", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_extensions.py", + ], + outs = [ + "src/vulkan/runtime/vk_cmd_queue.c", + "src/vulkan/runtime/vk_cmd_queue.h", + ], + cmd = "$(location :vk_cmd_queue_gen) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/runtime/vk_cmd_queue.c) --out-h $(location src/vulkan/runtime/vk_cmd_queue.h) --beta false", + tools = [":vk_cmd_queue_gen"], +) + +cc_library( + name = "include_directory_src_vulkan_runtime", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/vulkan/runtime/."], + textual_hdrs = glob( + ["src/vulkan/runtime/**/*.h"], + allow_empty = True, + ) + [ + ":gen_vk_common_entrypoints", + ":gen_vk_cmd_queue", + ":gen_vk_cmd_enqueue_entrypoints", + ":gen_vk_dispatch_trampolines", + ":gen_vk_physical_device_features", + ":gen_vk_physical_device_properties", + ":gen_vk_format_info", + ":gen_astc_spv_h", + ], + visibility = ["//visibility:public"], + deps = [":include_directory_src_vulkan_runtime_bvh"], +) + +genrule( + name = "gen_vk_common_entrypoints", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_entrypoints_gen.py", + "src/vulkan/util/vk_extensions.py", + ], + outs = [ + "src/vulkan/runtime/vk_common_entrypoints.h", + "src/vulkan/runtime/vk_common_entrypoints.c", + ], + cmd = "$(location :vk_entrypoints_gen) --xml $(location src/vulkan/registry/vk.xml) --proto --weak --out-h $(location src/vulkan/runtime/vk_common_entrypoints.h) --out-c $(location src/vulkan/runtime/vk_common_entrypoints.c) --prefix vk_common --beta false", + tools = [":vk_entrypoints_gen"], +) + +genrule( + name = "gen_vk_format_info", + srcs = ["src/vulkan/registry/vk.xml"], + outs = [ + "src/vulkan/runtime/vk_format_info.c", + "src/vulkan/runtime/vk_format_info.h", + ], + cmd = "$(location :vk_format_info_gen) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/runtime/vk_format_info.c) --out-h $(location src/vulkan/runtime/vk_format_info.h)", + tools = [":vk_format_info_gen"], +) + +cc_library( + name = "vulkan_lite_instance", + srcs = [ + "src/compiler/spirv/spirv_info.h", + "src/vulkan/runtime/vk_instance.c", + "src/vulkan/util/vk_dispatch_table.h", + "src/vulkan/util/vk_enum_defines.h", + "src/vulkan/util/vk_enum_to_str.h", + "src/vulkan/util/vk_extensions.h", + "src/vulkan/util/vk_struct_type_cast.h", + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ], + hdrs = [ + "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h", + "src/vulkan/runtime/vk_cmd_queue.h", + "src/vulkan/runtime/vk_common_entrypoints.h", + "src/vulkan/runtime/vk_dispatch_trampolines.h", + "src/vulkan/runtime/vk_format_info.h", + "src/vulkan/runtime/vk_physical_device_features.h", + "src/vulkan/runtime/vk_physical_device_properties.h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "VK_LITE_RUNTIME_INSTANCE=1", + "VK_USE_PLATFORM_DISPLAY_KHR", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_vulkan_runtime", + ":include_directory_src_vulkan_runtime_bvh", + ":include_directory_src_vulkan_runtime_radix_sort", + ":include_directory_src_vulkan_runtime_radix_sort_shaders", + ":include_directory_src_vulkan_util", + ":mesa_util", + ":mesa_util_c11", + ":vulkan_util", + "@libdrm", + "@zlib", + ], + alwayslink = True, +) + +genrule( + name = "gen_astc_spv_h", + srcs = ["src/compiler/glsl/astc_decoder.glsl"], + outs = ["src/vulkan/runtime/astc_spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V -S comp -x -o $(location src/vulkan/runtime/astc_spv.h) $(location src/compiler/glsl/astc_decoder.glsl) --quiet --depfile @DEPFILE@ -I.", + tools = ["@glslang//:glslangValidator"], +) + +cc_library( + name = "vulkan_lite_runtime", + srcs = [ + "src/compiler/spirv/spirv_info.h", + "src/vulkan/runtime/rmv/vk_rmv_common.c", + "src/vulkan/runtime/rmv/vk_rmv_exporter.c", + "src/vulkan/runtime/vk_blend.c", + "src/vulkan/runtime/vk_buffer.c", + "src/vulkan/runtime/vk_buffer_view.c", + "src/vulkan/runtime/vk_cmd_copy.c", + "src/vulkan/runtime/vk_cmd_enqueue.c", + "src/vulkan/runtime/vk_command_buffer.c", + "src/vulkan/runtime/vk_command_pool.c", + "src/vulkan/runtime/vk_debug_report.c", + "src/vulkan/runtime/vk_debug_utils.c", + "src/vulkan/runtime/vk_deferred_operation.c", + "src/vulkan/runtime/vk_descriptor_set_layout.c", + "src/vulkan/runtime/vk_descriptor_update_template.c", + "src/vulkan/runtime/vk_descriptors.c", + "src/vulkan/runtime/vk_device.c", + "src/vulkan/runtime/vk_device_generated_commands.c", + "src/vulkan/runtime/vk_device_memory.c", + "src/vulkan/runtime/vk_drm_syncobj.c", + "src/vulkan/runtime/vk_fence.c", + "src/vulkan/runtime/vk_framebuffer.c", + "src/vulkan/runtime/vk_graphics_state.c", + "src/vulkan/runtime/vk_image.c", + "src/vulkan/runtime/vk_log.c", + "src/vulkan/runtime/vk_meta_object_list.c", + "src/vulkan/runtime/vk_object.c", + "src/vulkan/runtime/vk_physical_device.c", + "src/vulkan/runtime/vk_pipeline_layout.c", + "src/vulkan/runtime/vk_query_pool.c", + "src/vulkan/runtime/vk_queue.c", + "src/vulkan/runtime/vk_render_pass.c", + "src/vulkan/runtime/vk_sampler.c", + "src/vulkan/runtime/vk_semaphore.c", + "src/vulkan/runtime/vk_standard_sample_locations.c", + "src/vulkan/runtime/vk_sync.c", + "src/vulkan/runtime/vk_sync_binary.c", + "src/vulkan/runtime/vk_sync_dummy.c", + "src/vulkan/runtime/vk_sync_timeline.c", + "src/vulkan/runtime/vk_synchronization.c", + "src/vulkan/runtime/vk_video.c", + "src/vulkan/runtime/vk_ycbcr_conversion.c", + "src/vulkan/util/vk_dispatch_table.h", + "src/vulkan/util/vk_enum_defines.h", + "src/vulkan/util/vk_enum_to_str.h", + "src/vulkan/util/vk_extensions.h", + "src/vulkan/util/vk_struct_type_cast.h", + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ":gen_vk_cmd_enqueue_entrypoints", + ":gen_vk_cmd_queue", + ":gen_vk_common_entrypoints", + ":gen_vk_dispatch_trampolines", + ":gen_vk_format_info", + ":gen_vk_physical_device_features", + ":gen_vk_physical_device_properties", + ":gen_vk_physical_device_spirv_caps", + ":gen_vk_synchronization_helpers", + ], + hdrs = [ + "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h", + "src/vulkan/runtime/vk_cmd_queue.h", + "src/vulkan/runtime/vk_common_entrypoints.h", + "src/vulkan/runtime/vk_dispatch_trampolines.h", + "src/vulkan/runtime/vk_format_info.h", + "src/vulkan/runtime/vk_physical_device_features.h", + "src/vulkan/runtime/vk_physical_device_properties.h", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "MESA_VK_LOG=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "VK_USE_PLATFORM_DISPLAY_KHR", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_vulkan_runtime", + ":include_directory_src_vulkan_runtime_bvh", + ":include_directory_src_vulkan_runtime_radix_sort", + ":include_directory_src_vulkan_runtime_radix_sort_shaders", + ":include_directory_src_vulkan_util", + ":include_directory_src_vulkan_wsi", + ":mesa_util", + ":mesa_util_c11", + ":vulkan_util", + "@libdrm", + "@zlib", + ], + alwayslink = True, +) + +genrule( + name = "gen_vk_physical_device_spirv_caps", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_physical_device_features_gen.py", + "src/vulkan/util/vk_physical_device_spirv_caps_gen.py", + ], + outs = ["src/vulkan/runtime/vk_physical_device_spirv_caps.c"], + cmd = "$(location :vk_physical_device_spirv_caps_gen) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/runtime/vk_physical_device_spirv_caps.c) --beta false", + tools = [":vk_physical_device_spirv_caps_gen"], +) + +genrule( + name = "gen_vk_physical_device_features", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_physical_device_features_gen.py", + ], + outs = [ + "src/vulkan/runtime/vk_physical_device_features.c", + "src/vulkan/runtime/vk_physical_device_features.h", + ], + cmd = "$(location :vk_physical_device_features_gen) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/runtime/vk_physical_device_features.c) --out-h $(location src/vulkan/runtime/vk_physical_device_features.h) --beta false", + tools = [":vk_physical_device_features_gen"], +) + +genrule( + name = "gen_vk_cmd_enqueue_entrypoints", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_entrypoints_gen.py", + "src/vulkan/util/vk_extensions.py", + ], + outs = [ + "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h", + "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.c", + ], + cmd = "$(location :vk_entrypoints_gen) --xml $(location src/vulkan/registry/vk.xml) --proto --weak --out-h $(location src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h) --out-c $(location src/vulkan/runtime/vk_cmd_enqueue_entrypoints.c) --prefix vk_cmd_enqueue --prefix vk_cmd_enqueue_unless_primary --beta false", + tools = [":vk_entrypoints_gen"], +) + +genrule( + name = "gen_pair_triangles_spv_h", + srcs = [ + "src/compiler/spirv/spirv_internal_exts.h", + "src/vulkan/runtime/bvh/leaf.h", + "src/vulkan/runtime/bvh/pair_triangles.comp", + "src/vulkan/runtime/bvh/pair_triangles.h", + "src/vulkan/runtime/bvh/vk_bvh_defines.h", + "src/vulkan/runtime/bvh/vk_bvh_helpers.h", + "src/vulkan/runtime/bvh/vk_debug.h", + ], + outs = ["src/vulkan/runtime/bvh/pair_triangles.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V -Isrc/vulkan/runtime/bvh -Isrc/compiler/spirv --target-env spirv1.5 -x -o $(location src/vulkan/runtime/bvh/pair_triangles.spv.h) $(location src/vulkan/runtime/bvh/pair_triangles.comp) --quiet '-P#extension GL_GOOGLE_include_directive : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require' '-P#extension GL_EXT_scalar_block_layout : require' '-P#extension GL_EXT_buffer_reference : require' '-P#extension GL_EXT_buffer_reference2 : require' '-P#extension GL_KHR_memory_scope_semantics : require' '-P#extension GL_KHR_shader_subgroup_arithmetic : require' '-P#extension GL_KHR_shader_subgroup_basic : require' '-P#extension GL_KHR_shader_subgroup_shuffle : require' '-P#extension GL_KHR_shader_subgroup_ballot : require' '-P#extension GL_KHR_shader_subgroup_clustered : require' '-P#extension GL_KHR_shader_subgroup_vote : require' '-P#extension GL_EXT_shader_atomic_int64 : require' '-P#extension GL_EXT_spirv_intrinsics : require' -I.", + tools = ["@glslang//:glslangValidator"], +) + +cc_library( + name = "include_directory_src_vulkan_runtime_bvh", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/vulkan/runtime/bvh/."], + textual_hdrs = glob( + ["src/vulkan/runtime/bvh/**/*.h"], + allow_empty = True, + ) + [ + ":gen_id_prefix_sum_spv_h", + ":gen_lbvh_generate_ir_spv_h", + ":gen_lbvh_main_spv_h", + ":gen_leaf_spv_h", + ":gen_morton_spv_h", + ":gen_pair_triangles_spv_h", + ":gen_ploc_internal_spv_h", + ":gen_hploc_internal_spv_h", + ], + visibility = ["//visibility:public"], +) + +genrule( + name = "gen_leaf_spv_h", + srcs = [ + "src/compiler/spirv/spirv_internal_exts.h", + "src/vulkan/runtime/bvh/leaf.comp", + "src/vulkan/runtime/bvh/leaf.h", + "src/vulkan/runtime/bvh/pair_triangles.h", + "src/vulkan/runtime/bvh/vk_bvh_defines.h", + "src/vulkan/runtime/bvh/vk_bvh_helpers.h", + "src/vulkan/runtime/bvh/vk_debug.h", + ], + outs = ["src/vulkan/runtime/bvh/leaf.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V -Isrc/vulkan/runtime/bvh -Isrc/compiler/spirv --target-env spirv1.5 -x -o $(location src/vulkan/runtime/bvh/leaf.spv.h) $(location src/vulkan/runtime/bvh/leaf.comp) --quiet '-P#extension GL_GOOGLE_include_directive : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require' '-P#extension GL_EXT_scalar_block_layout : require' '-P#extension GL_EXT_buffer_reference : require' '-P#extension GL_EXT_buffer_reference2 : require' '-P#extension GL_KHR_memory_scope_semantics : require' '-P#extension GL_KHR_shader_subgroup_arithmetic : require' '-P#extension GL_KHR_shader_subgroup_basic : require' '-P#extension GL_KHR_shader_subgroup_shuffle : require' '-P#extension GL_KHR_shader_subgroup_ballot : require' '-P#extension GL_KHR_shader_subgroup_clustered : require' '-P#extension GL_KHR_shader_subgroup_vote : require' '-P#extension GL_EXT_shader_atomic_int64 : require' '-P#extension GL_EXT_spirv_intrinsics : require' -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_id_prefix_sum_spv_h", + srcs = [ + "src/compiler/spirv/spirv_internal_exts.h", + "src/vulkan/runtime/bvh/id_prefix_sum.comp", + "src/vulkan/runtime/bvh/leaf.h", + "src/vulkan/runtime/bvh/pair_triangles.h", + "src/vulkan/runtime/bvh/vk_bvh_defines.h", + "src/vulkan/runtime/bvh/vk_bvh_helpers.h", + "src/vulkan/runtime/bvh/vk_debug.h", + ], + outs = ["src/vulkan/runtime/bvh/id_prefix_sum.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V -Isrc/vulkan/runtime/bvh -Isrc/compiler/spirv --target-env spirv1.5 -x -o $(location src/vulkan/runtime/bvh/id_prefix_sum.spv.h) $(location src/vulkan/runtime/bvh/id_prefix_sum.comp) --quiet '-P#extension GL_GOOGLE_include_directive : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require' '-P#extension GL_EXT_scalar_block_layout : require' '-P#extension GL_EXT_buffer_reference : require' '-P#extension GL_EXT_buffer_reference2 : require' '-P#extension GL_KHR_memory_scope_semantics : require' '-P#extension GL_KHR_shader_subgroup_arithmetic : require' '-P#extension GL_KHR_shader_subgroup_basic : require' '-P#extension GL_KHR_shader_subgroup_shuffle : require' '-P#extension GL_KHR_shader_subgroup_ballot : require' '-P#extension GL_KHR_shader_subgroup_clustered : require' '-P#extension GL_KHR_shader_subgroup_vote : require' '-P#extension GL_EXT_shader_atomic_int64 : require' '-P#extension GL_EXT_spirv_intrinsics : require' -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_morton_spv_h", + srcs = [ + "src/compiler/spirv/spirv_internal_exts.h", + "src/vulkan/runtime/bvh/leaf.h", + "src/vulkan/runtime/bvh/morton.comp", + "src/vulkan/runtime/bvh/pair_triangles.h", + "src/vulkan/runtime/bvh/vk_bvh_defines.h", + "src/vulkan/runtime/bvh/vk_bvh_helpers.h", + "src/vulkan/runtime/bvh/vk_debug.h", + ], + outs = ["src/vulkan/runtime/bvh/morton.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V -Isrc/vulkan/runtime/bvh -Isrc/compiler/spirv --target-env spirv1.5 -x -o $(location src/vulkan/runtime/bvh/morton.spv.h) $(location src/vulkan/runtime/bvh/morton.comp) --quiet '-P#extension GL_GOOGLE_include_directive : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require' '-P#extension GL_EXT_scalar_block_layout : require' '-P#extension GL_EXT_buffer_reference : require' '-P#extension GL_EXT_buffer_reference2 : require' '-P#extension GL_KHR_memory_scope_semantics : require' '-P#extension GL_KHR_shader_subgroup_arithmetic : require' '-P#extension GL_KHR_shader_subgroup_basic : require' '-P#extension GL_KHR_shader_subgroup_shuffle : require' '-P#extension GL_KHR_shader_subgroup_ballot : require' '-P#extension GL_KHR_shader_subgroup_clustered : require' '-P#extension GL_KHR_shader_subgroup_vote : require' '-P#extension GL_EXT_shader_atomic_int64 : require' '-P#extension GL_EXT_spirv_intrinsics : require' -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_hploc_internal_spv_h", + srcs = [ + "src/compiler/spirv/spirv_internal_exts.h", + "src/vulkan/runtime/bvh/hploc_internal.comp", + "src/vulkan/runtime/bvh/leaf.h", + "src/vulkan/runtime/bvh/pair_triangles.h", + "src/vulkan/runtime/bvh/vk_bvh_defines.h", + "src/vulkan/runtime/bvh/vk_bvh_helpers.h", + "src/vulkan/runtime/bvh/vk_debug.h", + ], + outs = ["src/vulkan/runtime/bvh/hploc_internal.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V -Isrc/vulkan/runtime/bvh -Isrc/compiler/spirv --target-env spirv1.5 -x -o $(location src/vulkan/runtime/bvh/hploc_internal.spv.h) $(location src/vulkan/runtime/bvh/hploc_internal.comp) --quiet '-P#extension GL_GOOGLE_include_directive : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require' '-P#extension GL_EXT_scalar_block_layout : require' '-P#extension GL_EXT_buffer_reference : require' '-P#extension GL_EXT_buffer_reference2 : require' '-P#extension GL_KHR_memory_scope_semantics : require' '-P#extension GL_KHR_shader_subgroup_arithmetic : require' '-P#extension GL_KHR_shader_subgroup_basic : require' '-P#extension GL_KHR_shader_subgroup_shuffle : require' '-P#extension GL_KHR_shader_subgroup_ballot : require' '-P#extension GL_KHR_shader_subgroup_clustered : require' '-P#extension GL_KHR_shader_subgroup_vote : require' '-P#extension GL_EXT_shader_atomic_int64 : require' '-P#extension GL_EXT_spirv_intrinsics : require' -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_lbvh_generate_ir_spv_h", + srcs = [ + "src/compiler/spirv/spirv_internal_exts.h", + "src/vulkan/runtime/bvh/lbvh_generate_ir.comp", + "src/vulkan/runtime/bvh/leaf.h", + "src/vulkan/runtime/bvh/pair_triangles.h", + "src/vulkan/runtime/bvh/vk_bvh_defines.h", + "src/vulkan/runtime/bvh/vk_bvh_helpers.h", + "src/vulkan/runtime/bvh/vk_debug.h", + ], + outs = ["src/vulkan/runtime/bvh/lbvh_generate_ir.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V -Isrc/vulkan/runtime/bvh -Isrc/compiler/spirv --target-env spirv1.5 -x -o $(location src/vulkan/runtime/bvh/lbvh_generate_ir.spv.h) $(location src/vulkan/runtime/bvh/lbvh_generate_ir.comp) --quiet '-P#extension GL_GOOGLE_include_directive : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require' '-P#extension GL_EXT_scalar_block_layout : require' '-P#extension GL_EXT_buffer_reference : require' '-P#extension GL_EXT_buffer_reference2 : require' '-P#extension GL_KHR_memory_scope_semantics : require' '-P#extension GL_KHR_shader_subgroup_arithmetic : require' '-P#extension GL_KHR_shader_subgroup_basic : require' '-P#extension GL_KHR_shader_subgroup_shuffle : require' '-P#extension GL_KHR_shader_subgroup_ballot : require' '-P#extension GL_KHR_shader_subgroup_clustered : require' '-P#extension GL_KHR_shader_subgroup_vote : require' '-P#extension GL_EXT_shader_atomic_int64 : require' '-P#extension GL_EXT_spirv_intrinsics : require' -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_lbvh_main_spv_h", + srcs = [ + "src/compiler/spirv/spirv_internal_exts.h", + "src/vulkan/runtime/bvh/lbvh_main.comp", + "src/vulkan/runtime/bvh/leaf.h", + "src/vulkan/runtime/bvh/pair_triangles.h", + "src/vulkan/runtime/bvh/vk_bvh_defines.h", + "src/vulkan/runtime/bvh/vk_bvh_helpers.h", + "src/vulkan/runtime/bvh/vk_debug.h", + ], + outs = ["src/vulkan/runtime/bvh/lbvh_main.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V -Isrc/vulkan/runtime/bvh -Isrc/compiler/spirv --target-env spirv1.5 -x -o $(location src/vulkan/runtime/bvh/lbvh_main.spv.h) $(location src/vulkan/runtime/bvh/lbvh_main.comp) --quiet '-P#extension GL_GOOGLE_include_directive : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require' '-P#extension GL_EXT_scalar_block_layout : require' '-P#extension GL_EXT_buffer_reference : require' '-P#extension GL_EXT_buffer_reference2 : require' '-P#extension GL_KHR_memory_scope_semantics : require' '-P#extension GL_KHR_shader_subgroup_arithmetic : require' '-P#extension GL_KHR_shader_subgroup_basic : require' '-P#extension GL_KHR_shader_subgroup_shuffle : require' '-P#extension GL_KHR_shader_subgroup_ballot : require' '-P#extension GL_KHR_shader_subgroup_clustered : require' '-P#extension GL_KHR_shader_subgroup_vote : require' '-P#extension GL_EXT_shader_atomic_int64 : require' '-P#extension GL_EXT_spirv_intrinsics : require' -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_ploc_internal_spv_h", + srcs = [ + "src/compiler/spirv/spirv_internal_exts.h", + "src/vulkan/runtime/bvh/leaf.h", + "src/vulkan/runtime/bvh/pair_triangles.h", + "src/vulkan/runtime/bvh/ploc_internal.comp", + "src/vulkan/runtime/bvh/vk_bvh_defines.h", + "src/vulkan/runtime/bvh/vk_bvh_helpers.h", + "src/vulkan/runtime/bvh/vk_debug.h", + ], + outs = ["src/vulkan/runtime/bvh/ploc_internal.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V -Isrc/vulkan/runtime/bvh -Isrc/compiler/spirv --target-env spirv1.5 -x -o $(location src/vulkan/runtime/bvh/ploc_internal.spv.h) $(location src/vulkan/runtime/bvh/ploc_internal.comp) --quiet '-P#extension GL_GOOGLE_include_directive : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require' '-P#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require' '-P#extension GL_EXT_scalar_block_layout : require' '-P#extension GL_EXT_buffer_reference : require' '-P#extension GL_EXT_buffer_reference2 : require' '-P#extension GL_KHR_memory_scope_semantics : require' '-P#extension GL_KHR_shader_subgroup_arithmetic : require' '-P#extension GL_KHR_shader_subgroup_basic : require' '-P#extension GL_KHR_shader_subgroup_shuffle : require' '-P#extension GL_KHR_shader_subgroup_ballot : require' '-P#extension GL_KHR_shader_subgroup_clustered : require' '-P#extension GL_KHR_shader_subgroup_vote : require' '-P#extension GL_EXT_shader_atomic_int64 : require' '-P#extension GL_EXT_spirv_intrinsics : require' -I.", + tools = ["@glslang//:glslangValidator"], +) + +cc_library( + name = "include_directory_src_vulkan_runtime_radix_sort", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/vulkan/runtime/radix_sort/."], + textual_hdrs = glob( + ["src/vulkan/runtime/radix_sort/**/*.h"], + allow_empty = True, + ), + visibility = ["//visibility:public"], +) + +genrule( + name = "gen_u64_scatter_0_odd_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_0_odd.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u64_scatter_0_odd.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u64_scatter_0_odd.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_0_odd.comp) -DRS_KEYVAL_DWORDS=2 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u96_scatter_2_odd_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_2_odd.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u96_scatter_2_odd.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u96_scatter_2_odd.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_2_odd.comp) -DRS_KEYVAL_DWORDS=3 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_fill_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/fill.comp", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/fill.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/fill.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/fill.comp) --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u64_histogram_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/histogram.comp", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u64_histogram.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u64_histogram.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/histogram.comp) -DRS_KEYVAL_DWORDS=2 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u96_scatter_1_even_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_1_even.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u96_scatter_1_even.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u96_scatter_1_even.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_1_even.comp) -DRS_KEYVAL_DWORDS=3 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u96_scatter_0_odd_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_0_odd.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u96_scatter_0_odd.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u96_scatter_0_odd.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_0_odd.comp) -DRS_KEYVAL_DWORDS=3 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u64_scatter_1_odd_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_1_odd.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u64_scatter_1_odd.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u64_scatter_1_odd.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_1_odd.comp) -DRS_KEYVAL_DWORDS=2 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u96_scatter_1_odd_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_1_odd.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u96_scatter_1_odd.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u96_scatter_1_odd.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_1_odd.comp) -DRS_KEYVAL_DWORDS=3 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u96_scatter_2_even_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_2_even.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u96_scatter_2_even.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u96_scatter_2_even.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_2_even.comp) -DRS_KEYVAL_DWORDS=3 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u64_init_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/init.comp", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u64_init.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u64_init.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/init.comp) -DRS_KEYVAL_DWORDS=2 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u64_prefix_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.comp", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u64_prefix.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u64_prefix.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/prefix.comp) -DRS_KEYVAL_DWORDS=2 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u64_scatter_1_even_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_1_even.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u64_scatter_1_even.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u64_scatter_1_even.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_1_even.comp) -DRS_KEYVAL_DWORDS=2 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +cc_library( + name = "include_directory_src_vulkan_runtime_radix_sort_shaders", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/vulkan/runtime/radix_sort/shaders/."], + textual_hdrs = glob( + ["src/vulkan/runtime/radix_sort/shaders/**/*.h"], + allow_empty = True, + ) + [ + ":gen_u64_init_spv_h", + ":gen_u96_init_spv_h", + ":gen_fill_spv_h", + ":gen_u64_histogram_spv_h", + ":gen_u96_histogram_spv_h", + ":gen_u64_prefix_spv_h", + ":gen_u96_prefix_spv_h", + ":gen_u64_scatter_0_even_spv_h", + ":gen_u96_scatter_0_even_spv_h", + ":gen_u64_scatter_0_odd_spv_h", + ":gen_u96_scatter_0_odd_spv_h", + ":gen_u64_scatter_1_even_spv_h", + ":gen_u96_scatter_1_even_spv_h", + ":gen_u64_scatter_1_odd_spv_h", + ":gen_u96_scatter_1_odd_spv_h", + ":gen_u96_scatter_2_even_spv_h", + ":gen_u96_scatter_2_odd_spv_h", + ], + visibility = ["//visibility:public"], +) + +genrule( + name = "gen_u96_histogram_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/histogram.comp", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u96_histogram.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u96_histogram.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/histogram.comp) -DRS_KEYVAL_DWORDS=3 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u96_init_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/init.comp", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u96_init.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u96_init.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/init.comp) -DRS_KEYVAL_DWORDS=3 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u96_prefix_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.comp", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u96_prefix.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u96_prefix.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/prefix.comp) -DRS_KEYVAL_DWORDS=3 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u64_scatter_0_even_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_0_even.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u64_scatter_0_even.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u64_scatter_0_even.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_0_even.comp) -DRS_KEYVAL_DWORDS=2 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_u96_scatter_0_even_spv_h", + srcs = [ + "src/vulkan/runtime/radix_sort/shaders/bufref.h", + "src/vulkan/runtime/radix_sort/shaders/config.h", + "src/vulkan/runtime/radix_sort/shaders/prefix.h", + "src/vulkan/runtime/radix_sort/shaders/prefix_limits.h", + "src/vulkan/runtime/radix_sort/shaders/push.h", + "src/vulkan/runtime/radix_sort/shaders/scatter.glsl", + "src/vulkan/runtime/radix_sort/shaders/scatter_0_even.comp", + ], + outs = ["src/vulkan/runtime/radix_sort/shaders/u96_scatter_0_even.spv.h"], + cmd = "$(location @glslang//:glslangValidator) -V --target-env spirv1.5 -x -o $(location src/vulkan/runtime/radix_sort/shaders/u96_scatter_0_even.spv.h) $(location src/vulkan/runtime/radix_sort/shaders/scatter_0_even.comp) -DRS_KEYVAL_DWORDS=3 --quiet -I.", + tools = ["@glslang//:glslangValidator"], +) + +genrule( + name = "gen_vk_struct_type_cast", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_extensions.py", + ], + outs = ["src/vulkan/util/vk_struct_type_cast.h"], + cmd = "$(location :vk_struct_type_cast_gen) --xml $(location src/vulkan/registry/vk.xml) --out $(location src/vulkan/util/vk_struct_type_cast.h) --beta false", + tools = [":vk_struct_type_cast_gen"], +) + +py_binary( + name = "vk_synchronization_helpers_gen", + srcs = [ + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_synchronization_helpers_gen.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_synchronization_helpers_gen.py", + deps = ["@mako"], +) + +genrule( + name = "gen_vk_dispatch_table", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_extensions.py", + ], + outs = [ + "src/vulkan/util/vk_dispatch_table.c", + "src/vulkan/util/vk_dispatch_table.h", + ], + cmd = "$(location :vk_dispatch_table_gen) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/util/vk_dispatch_table.c) --out-h $(location src/vulkan/util/vk_dispatch_table.h) --beta false", + tools = [":vk_dispatch_table_gen"], +) + +py_binary( + name = "vk_extensions_gen", + srcs = [ + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_extensions_gen.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_extensions_gen.py", + deps = ["@mako"], +) + +py_binary( + name = "vk_dispatch_trampolines_gen", + srcs = [ + "src/vulkan/util/vk_dispatch_trampolines_gen.py", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_extensions.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_dispatch_trampolines_gen.py", + deps = ["@mako"], +) + +genrule( + name = "gen_vk_enum_to_str", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_extensions.py", + ], + outs = [ + "src/vulkan/util/vk_enum_to_str.c", + "src/vulkan/util/vk_enum_to_str.h", + "src/vulkan/util/vk_enum_defines.h", + ], + cmd = "$(location :gen_enum_to_str) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/util/vk_enum_to_str.c) --out-h $(location src/vulkan/util/vk_enum_to_str.h) --out-d $(location src/vulkan/util/vk_enum_defines.h) --beta false", + tools = [":gen_enum_to_str"], +) + +py_binary( + name = "vk_cmd_queue_gen", + srcs = [ + "src/vulkan/util/vk_cmd_queue_gen.py", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_extensions.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_cmd_queue_gen.py", + deps = ["@mako"], +) + +py_binary( + name = "vk_struct_type_cast_gen", + srcs = [ + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_struct_type_cast_gen.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_struct_type_cast_gen.py", + deps = ["@mako"], +) + +py_binary( + name = "vk_icd_gen", + srcs = ["src/vulkan/util/vk_icd_gen.py"], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_icd_gen.py", +) + +genrule( + name = "gen_vk_extensions", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_extensions.py", + ], + outs = [ + "src/vulkan/util/vk_extensions.c", + "src/vulkan/util/vk_extensions.h", + ], + cmd = "$(location :vk_extensions_gen) --xml $(location src/vulkan/registry/vk.xml) --out-c $(location src/vulkan/util/vk_extensions.c) --out-h $(location src/vulkan/util/vk_extensions.h)", + tools = [":vk_extensions_gen"], +) + +cc_library( + name = "vulkan_util", + srcs = [ + "src/vulkan/util/vk_alloc.c", + "src/vulkan/util/vk_format.c", + "src/vulkan/util/vk_util.c", + ":gen_builtin_types_h", + ":gen_ir_expression_operation_h", + ":gen_nir_builder_opcodes_h", + ":gen_nir_intrinsics_h", + ":gen_nir_intrinsics_indices_h", + ":gen_nir_opcodes_h", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ":gen_vk_dispatch_table", + ":gen_vk_enum_to_str", + ":gen_vk_extensions", + ":gen_vk_struct_type_cast", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "VK_USE_PLATFORM_DISPLAY_KHR", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_compiler", + ":include_directory_src_compiler_nir", + ":include_directory_src_vulkan_util", + ":mesa_util", + ":mesa_util_c11", + "@libdrm", + "@zlib", + ], +) + +py_binary( + name = "vk_physical_device_features_gen", + srcs = [ + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_physical_device_features_gen.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_physical_device_features_gen.py", + deps = ["@mako"], +) + +py_binary( + name = "gen_enum_to_str", + srcs = [ + "src/vulkan/util/gen_enum_to_str.py", + "src/vulkan/util/vk_extensions.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/gen_enum_to_str.py", + deps = ["@mako"], +) + +py_binary( + name = "vk_physical_device_spirv_caps_gen", + srcs = [ + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_physical_device_features_gen.py", + "src/vulkan/util/vk_physical_device_spirv_caps_gen.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_physical_device_spirv_caps_gen.py", + deps = ["@mako"], +) + +cc_library( + name = "include_directory_src_vulkan_util", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/vulkan/util/."], + textual_hdrs = glob( + ["src/vulkan/util/**/*.h"], + allow_empty = True, + ) + [ + ":gen_vk_dispatch_table", + ":gen_vk_enum_to_str", + ":gen_vk_struct_type_cast", + ":gen_vk_extensions", + ], + visibility = ["//visibility:public"], +) + +py_binary( + name = "vk_dispatch_table_gen", + srcs = [ + "src/vulkan/util/vk_dispatch_table_gen.py", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_extensions.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_dispatch_table_gen.py", + deps = ["@mako"], +) + +py_binary( + name = "vk_physical_device_properties_gen", + srcs = [ + "src/vulkan/util/vk_extensions.py", + "src/vulkan/util/vk_physical_device_properties_gen.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_physical_device_properties_gen.py", + deps = ["@mako"], +) + +py_binary( + name = "vk_entrypoints_gen", + srcs = [ + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_entrypoints_gen.py", + "src/vulkan/util/vk_extensions.py", + ], + imports = ["src/vulkan/util"], + main = "src/vulkan/util/vk_entrypoints_gen.py", + deps = ["@mako"], +) + +cc_library( + name = "include_directory_src_vulkan_wsi", + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + features = [ + "-layering_check", + "-parse_headers", + ], + includes = ["src/vulkan/wsi/."], + textual_hdrs = glob( + ["src/vulkan/wsi/**/*.h"], + allow_empty = True, + ) + [":gen_wsi_entrypoints"], + visibility = ["//visibility:public"], +) + +genrule( + name = "gen_wsi_entrypoints", + srcs = [ + "src/vulkan/registry/vk.xml", + "src/vulkan/util/vk_entrypoints.py", + "src/vulkan/util/vk_entrypoints_gen.py", + "src/vulkan/util/vk_extensions.py", + ], + outs = [ + "src/vulkan/wsi/wsi_common_entrypoints.h", + "src/vulkan/wsi/wsi_common_entrypoints.c", + ], + cmd = "$(location :vk_entrypoints_gen) --xml $(location src/vulkan/registry/vk.xml) --proto --weak --out-h $(location src/vulkan/wsi/wsi_common_entrypoints.h) --out-c $(location src/vulkan/wsi/wsi_common_entrypoints.c) --prefix wsi --beta false", + tools = [":vk_entrypoints_gen"], +) + +cc_library( + name = "vulkan_wsi", + srcs = [ + "src/compiler/spirv/spirv_info.h", + "src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h", + "src/vulkan/runtime/vk_cmd_queue.h", + "src/vulkan/runtime/vk_common_entrypoints.h", + "src/vulkan/runtime/vk_physical_device_features.h", + "src/vulkan/runtime/vk_physical_device_properties.h", + "src/vulkan/util/vk_dispatch_table.h", + "src/vulkan/util/vk_enum_defines.h", + "src/vulkan/util/vk_enum_to_str.h", + "src/vulkan/util/vk_extensions.h", + "src/vulkan/util/vk_struct_type_cast.h", + "src/vulkan/wsi/wsi_common.c", + "src/vulkan/wsi/wsi_common_display.c", + "src/vulkan/wsi/wsi_common_drm.c", + "src/vulkan/wsi/wsi_common_headless.c", + ":gen_shader_stats_h", + ":gen_u_format_gen_h", + ":gen_wsi_entrypoints", + ], + copts = [ + "-Wno-string-conversion", + "-Wno-unused-variable", + "-Wno-return-type", + "-Wno-sometimes-uninitialized", + ], + defines = [ + "ALLOW_KCMP", + "AMD_LLVM_AVAILABLE=1", + "DRAW_LLVM_AVAILABLE=1", + "ENABLE_SHADER_CACHE", + "ETIME=ETIMEDOUT", + "GALLIVM_USE_ORCJIT=0", + "GLAPI_EXPORT_PROTO_ENTRY_POINTS=1", + "HAS_SCHED_GETAFFINITY", + "HAS_SCHED_H", + "HAVE_COMPRESSION", + "HAVE_DLADDR", + "HAVE_DLFCN_H", + "HAVE_DL_ITERATE_PHDR", + "HAVE_DRI2", + "HAVE_ENDIAN_H", + "HAVE_FMEMOPEN", + "HAVE_FUNC_ATTRIBUTE_ALIAS", + "HAVE_FUNC_ATTRIBUTE_CONST", + "HAVE_FUNC_ATTRIBUTE_FLATTEN", + "HAVE_FUNC_ATTRIBUTE_MALLOC", + "HAVE_FUNC_ATTRIBUTE_PACKED", + "HAVE_FUNC_ATTRIBUTE_PURE", + "HAVE_FUNC_ATTRIBUTE_UNUSED", + "HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT", + "HAVE_FUNC_ATTRIBUTE_WEAK", + "HAVE_GETRANDOM", + "HAVE_GFX_COMPUTE", + "HAVE_LIBDRM", + "HAVE_MEMFD_CREATE", + "HAVE_MKOSTEMP", + "HAVE_OPENGL=1", + "HAVE_OPENGL_ES_1=1", + "HAVE_OPENGL_ES_2=1", + "HAVE_POSIX_MEMALIGN", + "HAVE_PTHREAD", + "HAVE_PTHREAD_SETAFFINITY", + "HAVE_REALLOCARRAY", + "HAVE_RENDERDOC_INTEGRATION=1", + "HAVE_SECURE_GETENV", + "HAVE_STRTOF", + "HAVE_STRTOK_R", + "HAVE_STRUCT_TIMESPEC", + "HAVE_SYSCONF", + "HAVE_UINT128", + "HAVE_XLOCALE_H", + "HAVE_ZLIB", + "HAVE___BUILTIN_ADD_OVERFLOW", + "HAVE___BUILTIN_BSWAP32", + "HAVE___BUILTIN_BSWAP64", + "HAVE___BUILTIN_CLZ", + "HAVE___BUILTIN_CLZLL", + "HAVE___BUILTIN_CTZ", + "HAVE___BUILTIN_EXPECT", + "HAVE___BUILTIN_FFS", + "HAVE___BUILTIN_FFSLL", + "HAVE___BUILTIN_POPCOUNT", + "HAVE___BUILTIN_POPCOUNTLL", + "HAVE___BUILTIN_TYPES_COMPATIBLE_P", + "HAVE___BUILTIN_UNREACHABLE", + "LLVM_IS_SHARED=1", + "MAJOR_IN_SYSMACROS", + "MESA_DEBUG=0", + "MESA_LLVM_VERSION_STRING=\\\"15.0.0\\\"", + "MESA_SYSTEM_HAS_KMS_DRM=1", + "PACKAGE_VERSION=\\\"26.3.0-devel\\\"", + "THREAD_SANITIZER=0", + "USE_GCC_ATOMIC_BUILTINS", + "USE_LIBGLVND=0", + "VIDEO_CODEC_AV1DEC=1", + "VIDEO_CODEC_AV1ENC=1", + "VIDEO_CODEC_H264DEC=0", + "VIDEO_CODEC_H264ENC=0", + "VIDEO_CODEC_H265DEC=0", + "VIDEO_CODEC_H265ENC=0", + "VIDEO_CODEC_JPEGDEC=1", + "VIDEO_CODEC_MPEG12DEC=1", + "VIDEO_CODEC_VC1DEC=0", + "VIDEO_CODEC_VP9DEC=1", + "VK_USE_PLATFORM_DISPLAY_KHR", + "XXH_FORCE_ALIGN_CHECK=0", + "XXH_FORCE_MEMORY_ACCESS=0", + "_GNU_SOURCE", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ] + select({ + "@platforms//cpu:arm64": [], + "@platforms//cpu:x86_64": ["USE_SSE41"], + }), + features = [ + "-layering_check", + "-parse_headers", + ], + linkstatic = True, + deps = [ + ":blake3", + ":include_directory_include", + ":include_directory_src", + ":include_directory_src_vulkan_runtime", + ":include_directory_src_vulkan_runtime_bvh", + ":include_directory_src_vulkan_util", + ":include_directory_src_vulkan_wsi", + ":mesa_util", + ":mesa_util_c11", + ":xmlconfig", + "@libdrm", + "@zlib", ], + alwayslink = True, ) diff --git a/base/cvd/build_external/mesa/mesa.MODULE.bazel b/base/cvd/build_external/mesa/mesa.MODULE.bazel index a1a2e378a2f..26b1ee631cc 100644 --- a/base/cvd/build_external/mesa/mesa.MODULE.bazel +++ b/base/cvd/build_external/mesa/mesa.MODULE.bazel @@ -3,6 +3,6 @@ git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "g git_repository( name = "mesa", build_file = "@//build_external/mesa:BUILD.mesa.bazel", - commit = "224e91e39836d3ca31f80df2e0379e55c70574f8", + commit = "541c56aa3fd24027ed46ae350287d21dcd56c901", remote = "https://android.googlesource.com/platform/external/mesa3d", ) diff --git a/base/cvd/build_external/mesa/patches/rename_nv.patch b/base/cvd/build_external/mesa/patches/rename_nv.patch new file mode 100644 index 00000000000..e997320e22a --- /dev/null +++ b/base/cvd/build_external/mesa/patches/rename_nv.patch @@ -0,0 +1,8 @@ +--- a/src/vulkan/util/vk_physical_device_features_gen.py ++++ b/src/vulkan/util/vk_physical_device_features_gen.py +@@ -50,4 +50,5 @@ + ('CooperativeMatrixFeaturesNV', 'cooperativeMatrixRobustBufferAccess'): 'cooperativeMatrixRobustBufferAccessNV', + + ('DeviceGeneratedCommandsFeaturesNV', 'deviceGeneratedCommands'): 'deviceGeneratedCommandsNV', ++ ('RayTracingInvocationReorderFeaturesNV', 'rayTracingInvocationReorder'): 'rayTracingInvocationReorderNV', + } diff --git a/base/cvd/build_external/opengl_headers/BUILD.opengl_headers.bazel b/base/cvd/build_external/opengl_headers/BUILD.opengl_headers.bazel index d92e5ecfd0b..0a5f9ade921 100644 --- a/base/cvd/build_external/opengl_headers/BUILD.opengl_headers.bazel +++ b/base/cvd/build_external/opengl_headers/BUILD.opengl_headers.bazel @@ -1,7 +1,7 @@ load("@rules_cc//cc:cc_library.bzl", "cc_library") package( - default_visibility = ["@//:android_cuttlefish"], + default_visibility = ["//visibility:public"], ) cc_library( diff --git a/base/cvd/build_external/spirv_headers/spirv_headers.MODULE.bazel b/base/cvd/build_external/spirv_headers/spirv_headers.MODULE.bazel index 0decd4aa8a8..903dc5654e2 100644 --- a/base/cvd/build_external/spirv_headers/spirv_headers.MODULE.bazel +++ b/base/cvd/build_external/spirv_headers/spirv_headers.MODULE.bazel @@ -2,7 +2,7 @@ git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "g git_repository( name = "spirv_headers", - commit = "4f7b471f1a66b6d06462cd4ba57628cc0cd087d7", + commit = "29981f65241605e08b0ede4cfeb999fe3b723c6a", remote = "https://github.com/KhronosGroup/SPIRV-Headers.git", patches = [ "//build_external/spirv_headers:bazel9.patch", diff --git a/base/cvd/build_external/spirv_tools/spirv_tools.MODULE.bazel b/base/cvd/build_external/spirv_tools/spirv_tools.MODULE.bazel index 63fc8906a62..fa686c649f8 100644 --- a/base/cvd/build_external/spirv_tools/spirv_tools.MODULE.bazel +++ b/base/cvd/build_external/spirv_tools/spirv_tools.MODULE.bazel @@ -2,7 +2,7 @@ git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "g git_repository( name = "spirv_tools", - commit = "dd4b663e13c07fea4fbb3f70c1c91c86731099f7", # v2024.2 + commit = "85f222ec591863853ea603ce190ea508c7255568", remote = "https://github.com/KhronosGroup/SPIRV-Tools.git", patches = [ "//build_external/spirv_tools:bazel9.patch", diff --git a/base/cvd/build_external/vulkan_headers/BUILD.vulkan_headers.bazel b/base/cvd/build_external/vulkan_headers/BUILD.vulkan_headers.bazel index 3c2049020a2..a7e547cc3f2 100644 --- a/base/cvd/build_external/vulkan_headers/BUILD.vulkan_headers.bazel +++ b/base/cvd/build_external/vulkan_headers/BUILD.vulkan_headers.bazel @@ -1,7 +1,7 @@ load("@rules_cc//cc:cc_library.bzl", "cc_library") package( - default_visibility = ["@//:android_cuttlefish"], + default_visibility = ["//visibility:public"], ) cc_library( diff --git a/base/cvd/build_external/vulkan_headers/vulkan_headers.MODULE.bazel b/base/cvd/build_external/vulkan_headers/vulkan_headers.MODULE.bazel index 7b39f6e7226..eea662e9f7f 100644 --- a/base/cvd/build_external/vulkan_headers/vulkan_headers.MODULE.bazel +++ b/base/cvd/build_external/vulkan_headers/vulkan_headers.MODULE.bazel @@ -3,6 +3,6 @@ git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "g git_repository( name = "vulkan_headers", build_file = "@//build_external/vulkan_headers:BUILD.vulkan_headers.bazel", - commit = "0777a3ad88bad5f4b11cfd509458bbc0ddadc773", # v1.4.338 + commit = "8d6039a455a7ecc7d2a592ff97f62db4e59b70bf", # v1.4.356 remote = "https://github.com/KhronosGroup/Vulkan-Headers.git", ) diff --git a/base/cvd/cuttlefish/package/BUILD.bazel b/base/cvd/cuttlefish/package/BUILD.bazel index 4e435a981a6..b2363aa95d7 100644 --- a/base/cvd/cuttlefish/package/BUILD.bazel +++ b/base/cvd/cuttlefish/package/BUILD.bazel @@ -36,7 +36,7 @@ package_files( "bin/aarch64-linux-gnu/libmem_overrides.so": "bin/libmem_overrides.so", "bin/aarch64-linux-gnu/libvk_swiftshader.so": "bin/libvk_swiftshader.so", "bin/x86_64-linux-gnu/gfxstream_graphics_detector": "bin/graphics_detector", - "lib64/vulkan.lvp.so": "bin/libvk_lavapipe.so", + "lib64/vulkan.lvp.so": "bin/libvulkan_lvp.so", "lib64/vulkan.pastel.so": "bin/libvk_swiftshader.so", "bin/prebuilts/libgfxstream_backend.so": "bin/libgfxstream_backend.so", }, @@ -81,7 +81,7 @@ package_files( "bin/kernel_log_monitor": "//cuttlefish/host/commands/kernel_log_monitor", "bin/libmem_overrides.so": "//cuttlefish/host/graphics/mem_overrides:libmem_overrides.so", "bin/libgfxstream_backend.so": "@gfxstream//host:gfxstream_backend", - "bin/libvk_lavapipe.so": "@mesa//:vk_lavapipe", + "bin/libvulkan_lvp.so": "@mesa//:vulkan_lvp", "bin/libvk_swiftshader.so": "@swiftshader//:vk_swiftshader", "bin/log_tee": "//cuttlefish/host/commands/log_tee", "bin/logcat_receiver": "//cuttlefish/host/commands/logcat_receiver",