mirror of
https://github.com/elwrcl/intel-hard-graphics.git
synced 2026-10-31 02:48:03 +03:00
Nine Mesa 25.2'de silindi. Bu commit onu 26.2 agacina geri getiriyor:
src/gallium/frontends/nine, src/gallium/targets/d3dadapter9, D3D9 ve
d3dadapter basliklari, meson entegrasyonu ve driconf secenekleri.
Silinmesinden sonra gallium'da degisen ve uyum gerektiren yerler:
- mesa_shader_stage, enum pipe_shader_type'in yerini aldi
- pipe_surface de-pointerize edildi, create_surface kalkti
- u_upload_data/alloc artik referans vermiyor; _ref varyantlarina gecildi
- threaded_context kullanici sabit tamponlarini yuklemiyor (MR 36715),
tc_set_constant_buffer'da assert(!cb->user_buffer) var. SWVP ve
fixed-function yollari icin nine_upload_constant_buffer() eklendi.
- driParseConfigFiles struct API'sine gecti
Ayrica D3D9'un ugradigi ama GL frontend'inin hic gecmedigi uc yolda
surucu hatasi cikti; ucu de burada:
crocus_query.c PIPE_QUERY_GPU_FINISHED ele alinmiyordu
crocus_clear.c clear_render_target gelen pipe_surface'i crocus_surface'e
cast edip ->view okuyordu; Nine kendi surface'ini
uretiyor, format crocus_format_for_usage ile yeniden
turetiliyor
tgsi_to_nir.c TXD'de ddx/ddy bilesen sayisi kirpilmiyordu
Gercek donanimda dogrulandi (8086:0166, crocus, wine 11.0 +
wine-nine-standalone): Max Payne 2, The Witcher EE, Fallout New Vegas,
Warband, L4D1, PAYDAY: The Heist calisiyor.
Co-Authored-By: Claude Opus 5 <[email protected]>
217 lines
6.9 KiB
Nix
217 lines
6.9 KiB
Nix
{
|
||
description = "intel-hard-graphics / clvk development";
|
||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||
|
||
outputs =
|
||
{ self, nixpkgs }:
|
||
let
|
||
system = "x86_64-linux";
|
||
pkgs = import nixpkgs { inherit system; };
|
||
|
||
# HD 4000 (Gen7) PCI ID: 8086:0166
|
||
pciId = "8086:0166";
|
||
defaultClvkBuildDir = "/home/elars/ProjectsHDD/Drivers/clvk/build";
|
||
|
||
commonBuildInputs = with pkgs; [
|
||
llvmPackages_21.clang-unwrapped
|
||
llvmPackages_21.llvm.dev
|
||
llvmPackages_21.libclang
|
||
llvmPackages_21.bintools
|
||
python3Packages.packaging
|
||
python3Packages.pyyaml
|
||
python3Packages.mako
|
||
python3
|
||
cargo
|
||
meson
|
||
ninja
|
||
pkg-config
|
||
spirv-llvm-translator
|
||
spirv-tools
|
||
rust-bindgen
|
||
rustc
|
||
vkmark
|
||
vulkan-headers
|
||
vulkan-loader
|
||
vulkan-tools
|
||
shaderc
|
||
libpciaccess
|
||
opencl-headers
|
||
libclc
|
||
bison
|
||
flex
|
||
libdrm
|
||
libelf
|
||
expat
|
||
zlib
|
||
zstd
|
||
libx11
|
||
ocl-icd
|
||
libxcb
|
||
cmake
|
||
libxext
|
||
libxfixes
|
||
libxrandr
|
||
libxshmfence
|
||
wayland
|
||
wayland-protocols
|
||
wayland-scanner
|
||
xorgproto
|
||
xorg.libXxf86vm
|
||
xorg.xcbutilkeysyms
|
||
(python3.withPackages (
|
||
ps: with ps; [
|
||
pyopencl
|
||
opencv4
|
||
numpy
|
||
]
|
||
))
|
||
clinfo
|
||
strace
|
||
clpeak
|
||
pocl
|
||
gdb
|
||
];
|
||
|
||
commonShellVars = ''
|
||
export LIBRARY_PATH=${pkgs.llvmPackages_21.clang-unwrapped.lib}/lib:$LIBRARY_PATH
|
||
export LIBCLANG_PATH=${pkgs.llvmPackages_21.libclang.lib}/lib
|
||
export BINDGEN_EXTRA_CLANG_ARGS="-I${pkgs.llvmPackages_21.clang-unwrapped}/lib/clang/21/include"
|
||
export C_INCLUDE_PATH=${pkgs.opencl-headers}/include:$C_INCLUDE_PATH
|
||
export LIBRARY_PATH=${pkgs.ocl-icd}/lib:$LIBRARY_PATH
|
||
export LD_LIBRARY_PATH="${pkgs.vulkan-loader}/lib:${pkgs.zlib}/lib:${pkgs.stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH"
|
||
'';
|
||
|
||
# 32-bit (i686) build için: L4D2 gibi 32-bit oyunlarla test amaçlı.
|
||
# clvk/rusticl/OpenCL burada yok — sadece hasvk (vulkan_hasvk) + crocus
|
||
# için gereken Vulkan/GL/WSI kütüphaneleri, i686 varyantlarıyla.
|
||
pkgs32 = pkgs.pkgsi686Linux;
|
||
|
||
i686BuildInputs = with pkgs32; [
|
||
libdrm
|
||
libelf
|
||
libpciaccess
|
||
expat
|
||
zlib
|
||
zstd
|
||
libx11
|
||
libxcb
|
||
libxext
|
||
libxfixes
|
||
libxrandr
|
||
libxshmfence
|
||
wayland
|
||
wayland-protocols
|
||
xorgproto
|
||
xorg.libXxf86vm
|
||
xorg.xcbutilkeysyms
|
||
vulkan-headers
|
||
vulkan-loader
|
||
llvmPackages_21.llvm.dev
|
||
llvmPackages_21.clang-unwrapped
|
||
llvmPackages_21.libclang
|
||
spirv-llvm-translator
|
||
spirv-tools
|
||
libclc
|
||
# crocus + hasvk (with_driver_using_cl) libclc'ye hard-dependency,
|
||
# rusticl/opencl kapalı olsa bile gerekiyor
|
||
|
||
# rusticl 32-bit: meson rustc'yi bir dil olarak istiyor, yoksa
|
||
# "Unknown compiler(s): [['rustc']]" ile yapılandırma düşüyor.
|
||
rustc
|
||
cargo
|
||
rust-bindgen
|
||
];
|
||
|
||
# Build araçları (meson/ninja/python/bison/flex/pkg-config vs.) i686'da
|
||
# da bulunur ama host mimarisinde çalıştırılmaları yeterli; yine de
|
||
# pkgsi686Linux'tan almak pkg-config'in .pc arama yollarını tutarlı
|
||
# tutar. cmake/rust burada gerekmiyor (clvk 32-bit hedefi değil).
|
||
i686NativeBuildInputs = with pkgs32; [
|
||
meson
|
||
ninja
|
||
pkg-config
|
||
python3
|
||
python3Packages.packaging
|
||
python3Packages.pyyaml
|
||
python3Packages.mako
|
||
bison
|
||
flex
|
||
wayland-scanner
|
||
];
|
||
in
|
||
{
|
||
devShells.${system} = {
|
||
# nix develop = intel-hard-graphics shell
|
||
default = pkgs.mkShell {
|
||
buildInputs = commonBuildInputs;
|
||
shellHook = ''
|
||
${commonShellVars}
|
||
export LD_LIBRARY_PATH=$PWD/build/src/gallium/targets/rusticl:$LD_LIBRARY_PATH
|
||
export RUSTICL_ENABLE=crocus
|
||
|
||
mkdir -p $PWD/.icd-vendors
|
||
ln -sf $PWD/build/src/gallium/targets/rusticl/rusticl.icd $PWD/.icd-vendors/rusticl.icd
|
||
ln -sf ${pkgs.pocl}/etc/OpenCL/vendors/pocl.icd $PWD/.icd-vendors/pocl.icd
|
||
export OCL_ICD_VENDORS=$PWD/.icd-vendors
|
||
|
||
echo "=== intel-hard-graphics ==="
|
||
echo "OCL_ICD_VENDORS=$OCL_ICD_VENDORS"
|
||
echo "RUSTICL_ENABLE=$RUSTICL_ENABLE"
|
||
echo ""
|
||
'';
|
||
};
|
||
# nix develop .#clvk = clvk shell
|
||
clvk = pkgs.mkShell {
|
||
buildInputs = commonBuildInputs;
|
||
shellHook = ''
|
||
${commonShellVars}
|
||
|
||
CLVK_BUILD_DIR="''${CLVK_BUILD_DIR:-${defaultClvkBuildDir}}"
|
||
|
||
if [ ! -d "$CLVK_BUILD_DIR" ]; then
|
||
echo "UYARI: clvk build dizini bulunamadi: $CLVK_BUILD_DIR"
|
||
echo "CLVK_BUILD_DIR ortam degiskeniyle dogru yolu ver, ornek:"
|
||
echo " CLVK_BUILD_DIR=/gercek/yol nix develop .#clvk"
|
||
else
|
||
export LD_LIBRARY_PATH="$CLVK_BUILD_DIR:$LD_LIBRARY_PATH"
|
||
fi
|
||
|
||
export MESA_VK_DEVICE_SELECT="${pciId}"
|
||
|
||
echo "=== clvk ==="
|
||
echo "CLVK_BUILD_DIR=$CLVK_BUILD_DIR"
|
||
echo "MESA_VK_DEVICE_SELECT=$MESA_VK_DEVICE_SELECT"
|
||
echo ""
|
||
'';
|
||
};
|
||
# nix develop .#i686 = 32-bit hasvk/crocus build shell (L4D2 testi için)
|
||
i686 = pkgs32.mkShell {
|
||
buildInputs = i686BuildInputs;
|
||
nativeBuildInputs = i686NativeBuildInputs;
|
||
shellHook = ''
|
||
export MESA_VK_DEVICE_SELECT="${pciId}"
|
||
|
||
# meson'un find_library'si clang'i llvm'in libdir'inde ariyor,
|
||
# nixpkgs'te ise clang ayri bir turev. 64-bit shell bunu
|
||
# commonShellVars'ta LIBRARY_PATH ile cozuyor; i686'da eksikti ve
|
||
# rusticl "clangBasic not found" ile yapilandirmayi dusuruyordu.
|
||
export LIBRARY_PATH=${pkgs32.llvmPackages_21.clang-unwrapped.lib}/lib''${LIBRARY_PATH:+:$LIBRARY_PATH}
|
||
|
||
# rust-bindgen (rusticl) libclang'i calisma zamaninda dlopen ediyor
|
||
export LIBCLANG_PATH=${pkgs32.llvmPackages_21.libclang.lib}/lib
|
||
export BINDGEN_EXTRA_CLANG_ARGS="-I${pkgs32.llvmPackages_21.clang-unwrapped}/lib/clang/21/include"
|
||
|
||
echo "=== intel-hard-graphics (i686 / 32-bit) ==="
|
||
echo "CC=$CC"
|
||
echo "meson setup build32 --buildtype=debugoptimized \\"
|
||
echo " -Dgallium-drivers=crocus -Dvulkan-drivers=intel_hasvk \\"
|
||
echo " -Dplatforms=x11 -Degl=disabled -Dglx=disabled -Dgbm=disabled \\"
|
||
echo " -Dopengl=false -Dgles1=disabled -Dgles2=disabled \\"
|
||
echo " -Dgallium-rusticl=false -Dmicrosoft-clc=disabled -Dllvm=enabled"
|
||
echo ""
|
||
'';
|
||
};
|
||
};
|
||
};
|
||
}
|