(no commit message)
[libreriscv.git] / 3d_gpu / mesa.mdwn
index ad72fa81f404fbe66363f64b18ba869d24da2aa2..79d80b4fd8074928505a00df2fc4d4f1aa68d5bb 100644 (file)
@@ -1,4 +1,4 @@
-# MESA Driver sponsored by NLNet
+# MESA Driver sponsored by NLnet
 
 todo http://lists.libre-soc.org/pipermail/libre-soc-dev/2020-August/000246.html
 
@@ -17,6 +17,7 @@ In order to install a `meson` version recent enough to configure `mesa`, add bus
 
 Install `meson` (version 52.0 or later):
 
+    apt-get update -y
     apt-get install -y -t buster-backports meson
 
 Then install the necessary packages by running the following commands as root:
@@ -46,7 +47,7 @@ Then, still as root, run the following to get the necessary dependencies for bui
     apt-get build-dep -y libdrm
     apt-get build-dep -y mesa
 
-Now we are going to build and install `drm` from source as the debian apt versions are not recent enough to build mesa. Run all of these command as a regular user, *DO NOT RUN AS ROOT* it is not necessary.
+Now we are going to build and install `drm` from source as the debian apt versions are not recent enough to build mesa. Run all of these command as a regular user, **DO NOT RUN AS ROOT** it is not necessary.
 
 First, create our working directory `opt` in our user directory. In order to not mess with system `drm` and `mesa` libraries, also create a sub-directory `lsoc_mesa` to hold our header files and libraries. After creating the `opt` directory, cd into it to make it our active, current working directory.
 
@@ -71,16 +72,24 @@ In order for meson to be able to find the up-to-date `drm` files we have just bu
 
     export PKG_CONFIG_PATH=~/opt/lsoc_mesa/lib/x86_64-linux-gnu/pkgconfig/
 
+These following `vulkan`-specific environment variables are necessary to build our branch of mesa successfully:
+
+    export VK_ICD_FILENAMES=/home/$USER/opt/lsoc_mesa/share/vulkan/icd.\
+     /libresoc_icd.x86_64.json
+    export VK_LOADER_DEBUG=warn
+    export LIBRESOC_TRACE=1
+
 Now change back to the base `~/opt` directory and clone the `mesa` git repo from the `mesa` gitlab instance. Change to the `mesa` directory. Create a build directory and cd into it.
 
     cd ~/opt
-    git clone https://gitlab.freedesktop.org/mesa/mesa.git
+    git clone https://gitlab.freedesktop.org/vivekvpandya/mesa.git
     cd mesa
     mkdir build && cd build
 
 In order to configure `mesa` for building and installation run the following command. Again, it is *very* important to specify `prefix=/home/$USER/opt/lsoc_mesa` because as mentioned above we need these files for development purposes, but we do not want to corrupt or interfere with our *system* `mesa` libraries.
 
-    meson -Dbuildtype=debug -Dprefix=/home/$USER/opt/lsoc_mesa                
+    meson -Dbuildtype=debug -Dprefix=/home/$USER/opt/lsoc_mesa \
+     -Dvulkan-drivers=libre-soc                
 
 After configuration has completed, run ninja to build and install the `mesa` libraries.
 
@@ -88,12 +97,6 @@ After configuration has completed, run ninja to build and install the `mesa` lib
 
 # From here on is solely Vivek's instructions
 
-I also have script to set few environment variables like
-
-    export VK_ICD_FILENAMES=/home/vivek/install/share/vulkan/icd.d/libresoc_icd.x86_64.json
-    export VK_LOADER_DEBUG=warn
-    export LIBRESOC_TRACE=1
-
 To test the code I am sing simple tests built by
     https://github.com/GameTechDev/IntroductionToVulkan
 
@@ -112,3 +115,8 @@ meson -Dbuildtype=debug -Dprefix=/home/vivek/install
 -Dvulkan-drivers=libre-soc ..
 
 instead of libresoc it is libre-soc for vulkan-drivers option.
+
+# Running vulkan intro tutorial
+
+* <https://github.com/GameTechDev/IntroductionToVulkan/tree/master/Project/Tutorials/01>
+* <http://lists.libre-soc.org/pipermail/libre-soc-dev/2020-August/000368.html>