Here we will download

  • the Official Mesa Repo
  • the Mesa Repo maintained by iXit Team
.

Notice: iXit Team Repo is the Mesa Repo patched with Gallium Nine. Sometimes it is refreshed sometimes not!. Here I will show how I extract lasted patches for Gallium Nine and how I apply those patches to Mesa Official Repo

  1. Download the latest Official Mesa Repo
    git clone git://anongit.freedesktop.org/mesa/mesa Mesa-3D_$(date -I)
  2. Get the latest comment from the latest commit
    root@amdgaming:/opt/Sources/Mesa-3D_2016-01-30# git log|head -n5
    commit 438d421f8bb3f65402701628c3504c0ad04184c0
    Author: Ilia Mirkin 
    Date:   Fri Jan 29 20:28:12 2016 -0500
    
        nvc0: avoid crashing when there are holes in vertex array bindings
    
  3. Download the latest iXit Repo (this one is patched with Gallium Nine!)
    git clone https://github.com/iXit/Mesa-3D.git Mesa-3D_iXit_$(date -I)
    cd Mesa-3D_iXit_$(date -I)
  4. We need to extract the latest patches for Gallium Nine. To do this we need to get the latest commit. We get it using
    root@amdgaming:/opt/Sources/Mesa-3D_iXit_2016-01-30# git log|head -n1
    commit e4ce343e5c8b85ead88717b886c8a46753b5d7c8
    
    Ok. So it will be e4ce343e5c8b85ead88717b886c8a46753b5d7c8
  5. Now question is how many patches have to be generated? Well try a huge number like 60 using the command first
    root@amdgaming:/opt/Sources/Mesa-3D_iXit_2016-01-30# rm -f *patch;git format-patch -60 e4ce343e5c8b85ead88717b886c8a46753b5d7c8
    0001-glsl-double-precision-values-don-t-support-interpola.patch
    0002-radeonsi-Add-option-for-SI-scheduler.patch
    0003-glsl-disallow-implicit-conversions-in-ESSL-shaders.patch
    0004-st-nine-Fix-AlphaCmpCaps.patch
    0005-st-nine-Fix-D3DPMISCCAPS_FOGANDSPECULARALPHA-support.patch
    0006-st-nine-Fix-rounding-issue-with-vs1.1-a0-reg.patch
    ...
    ...
    0057-st-nine-Add-format-checks-to-create_zs_or_rt_surface.patch
    0058-st-nine-SCRATCH-does-support-all-formats.patch
    0059-st-nine-Improve-doc-of-D3DPMISCCAPS_POSTBLENDSRGBCON.patch
    0060-st-nine-Ignore-discard-flag-when-nooverwrite-is-set.patch
    
  6. So it means that we will get the latest patches by removing the 3 first patches listed above. 57 = 60 - 3. So the correct command to extract Gallium Nine patches will be
    rm -f *patch;git format-patch -57 e4ce343e5c8b85ead88717b886c8a46753b5d7c8
  7. So now we can get back to Mesa Official Sources and patch those sources with Gallium Nine
    cd Mesa-3D_$(date -I)
    for file in $(ls /opt/Sources/Mesa-3D_iXit_2016-01-30/*patch);do patch -p1 < $file;done
    and we will get
    patching file src/gallium/state_trackers/nine/adapter9.c
    patching file src/gallium/state_trackers/nine/adapter9.c
    patching file src/gallium/state_trackers/nine/nine_shader.c
    patching file src/gallium/state_trackers/nine/nine_shader.c
    ...
    ...
    patching file src/gallium/state_trackers/nine/texture9.c
    patching file src/gallium/state_trackers/nine/volumetexture9.c
    patching file src/gallium/state_trackers/nine/adapter9.c
    patching file src/gallium/state_trackers/nine/nine_pipe.h
    
  8. Now we can build Mesa