| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 1 | # Build Instructions |
| 2 | This project supports Linux today. |
| 3 | Support for Windows will start in Q1'15. |
| 4 | Support for Android is TBD. |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 5 | |
| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 6 | ##System Requirements |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 7 | Ubuntu 14.04 LTS, (Ubuntu 14.10 needed for DRI 3 demos) |
| 8 | |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 9 | ``` |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 10 | sudo apt-get install git subversion cmake libgl1-mesa-dev freeglut3-dev libglm-dev libpng12-dev |
| 11 | sudo apt-get build-dep mesa |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 12 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 13 | |
| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 14 | ##Build |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 15 | |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 16 | The sample driver uses cmake and should work with the usual cmake options and utilities. |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 17 | The standard build process builds the icd, the icd loader and all the tests. |
| 18 | |
| 19 | Example debug build: |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 20 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 21 | cd xgl # cd to the root of the xgl git repository |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 22 | export KHRONOS_ACCOUNT_NAME= <subversion login name for svn checkout of BIL> |
| 23 | ./update_external_sources.sh # fetches and builds glslang, llvm, LunarGLASS, and BIL |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 24 | cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug |
| 25 | cd dbuild |
| 26 | make |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 27 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 28 | |
| 29 | To run XGL programs you must tell the icd loader where to find the libraries. Set the |
| 30 | environment variable LIBXGL_DRIVERS_PATH to the driver path. For example: |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 31 | ``` |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 32 | export LIBXGL_DRIVERS_PATH=$PWD/icd/intel |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 33 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 34 | |
| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 35 | ##Test |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 36 | |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 37 | The test executibles can be found in the dbuild/tests directory. The tests use the Google |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 38 | gtest infrastructure. Tests avilable so far: |
| 39 | - xglinfo: Report GPU properties |
| 40 | - xglbase: Test basic entry points |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 41 | - xgl_blit_tests: Test XGL Blits (copy, clear, and resolve) |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 42 | - xgl_image_tests: Test XGL image related calls needed by render_test |
| 43 | - xgl_render_tests: Render a single triangle with XGL. Triangle will be in a .ppm in |
| 44 | the current directory at the end of the test. |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 45 | |
| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 46 | #Demos |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 47 | |
| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 48 | The demos executables can be found in the dbuild/demos directory. The demos use DRI 3 |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 49 | to render directly onto window surfaces. |
| 50 | - tri: a textured triangle |
| 51 | - cube: a textured spinning cube |
| 52 | |
| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 53 | #Render Nodes |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 54 | |
| 55 | The render tests depend on access to DRM render nodes. |
| 56 | To make that available, a couple of config files need to be created to set a module option |
| 57 | and make accessible device files. |
| 58 | The system will need to be rebooted with these files in place to complete initialization. |
| 59 | These commands will create the config files. |
| 60 | |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 61 | ``` |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 62 | sudo tee /etc/modprobe.d/drm.conf << EOF |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 63 | # Enable render nodes |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 64 | options drm rnodes=1 |
| 65 | EOF |
| 66 | |
| 67 | sudo tee /etc/udev/rules.d/drm.rules << EOF |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 68 | # Add permissions to render nodes |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 69 | SUBSYSTEM=="drm", ACTION=="add", DEVPATH=="/devices/*/renderD*", MODE="020666" |
| 70 | EOF |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame^] | 71 | ``` |