Skip to content

Commit

Permalink
Release 18.1.0.600-1
Browse files Browse the repository at this point in the history
Make appropriate changes as Mesa3D now supports OpenGL 3.1 in compatibility context
  • Loading branch information
pal1000 committed May 19, 2018
1 parent efff25b commit 33b3b18
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 42 deletions.
6 changes: 3 additions & 3 deletions buildenvconf.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### Notes

[1]Executed from an x64 Native Tools Command Prompt for VS 2017 shell
[1]Executed from a x64 Native Tools Command Prompt for VS 2017 shell

[2]Executed from an x64_x86 Cross Tools Command Prompt for VS 2017 shell
[2]Executed from a x64_x86 Cross Tools Command Prompt for VS 2017 shell

[3]Executed after each build configuration on same command shell

Expand Down Expand Up @@ -58,4 +58,4 @@ Git For Windows portable | 2.17.0.1
| | |
|-|-|
Build config and execute x64 [4] | scons build=release platform=windows machine=x86_64 libgl-gdi swr=1 graw-gdi osmesa
Build config and execute x86 [4] | scons build=release platform=windows machine=x86 libgl-gdi graw-gdi osmesa
Build config and execute x86 [4] | scons build=release platform=windows machine=x86 libgl-gdi graw-gdi osmesa
12 changes: 6 additions & 6 deletions buildscript/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Visual Studio has to be installed in its default location. You only need components from within Desktop Development with C++ category. Beside default selected components MFC, ATL and a Windows SDK is required. Latest Windows 10 SDK is highly recommended. You may opt-out in this exact order of CMake Tools and Windows 10 SDK in Visual Studio installer and manually install standalone version of Windows 10 SDK instead as it is sometimes newer. If you want to use standalone Windows 10 SDK make sure you install Windows SDK for Desktop C++ x86 and amd64 apps components.
- [7-zip](http://www.7-zip.org/download.html) or [7-zip portable](https://portableapps.com/apps/utilities/7-zip_portable)

We'll use this to extract all depencies packed in tar.gz or tar.xz archives.
We'll use this to extract all dependencies packed in tar.gz or tar.xz archives.
Before continuing prepare an empty folder to extract the rest of dependencies into. I'll call this `.`.

- [Git for Windows 32 or 64-bit](https://git-scm.com/download/win);
Expand All @@ -35,7 +35,7 @@ You may use the installer or you can extract the zipped version in `.\cmake`. Re
Extract in `.\flexbison`.
- [Python 32 or 64 bit](https://www.python.org/);

Use Python 2.7. Mesa3D Scons build system was written using Python 2 syntax. Trying to use Python 3 leads to Python crash at this moment. Use the installer. Make sure pip is installed. Sometimes it isn't. If it isn't get it from [here](https://pip.pypa.io/en/stable/installing/). If you don't want to add Python to PATH you can either install it in `.\python` or if you have Python launcher component of Python 3.x installed for whatever reason you can install it anywhere you want. If using Python launcher pick a Python 2.7 installation. Python 3.x can only build LLVM for now. It can't build Mes3D on Windows yet, but developpers are working upstream on a Meson build for Mesa3D which is a Python 3.x native. For those who want to attempt a Mesa3D build with Meson there is the command line switch `/enablemeson`, but obviously it doesn't work yet due to lack of upstream support.
Use Python 2.7. Mesa3D Scons build system was written using Python 2 syntax. Trying to use Python 3 leads to Python crash at this moment. Use the installer. Make sure pip is installed. Sometimes it isn't. If it isn't get it from [here](https://pip.pypa.io/en/stable/installing/). If you don't want to add Python to PATH you can either install it in `.\python` or if you have Python launcher component of Python 3.x installed for whatever reason you can install it anywhere you want. If using Python launcher pick a Python 2.7 installation. Python 3.x can only build LLVM for now. It can't build Mes3D on Windows yet, but developers are working upstream on a Meson build for Mesa3D which is a Python 3.x native. For those who want to attempt a Mesa3D build with Meson there is the command line switch `/enablemeson`, but obviously it doesn't work yet due to lack of upstream support.
- [pywin32 for Python 2.7](https://github.com/mhammond/pywin32/releases);

It must match in architecture with Python. There is a bug in the installer. For true successful installation you have to open Command Prompt as admin, browse to the folder holding pywin32 installer using CD command and run it from there.
Expand All @@ -48,11 +48,11 @@ The build script gets the latest version of Scons automatically.

You will need to clone its repository using git. Go to folder where you installed git and open git-cmd.bat. Change current folder to dependencies dropping folder, the one I called `.`. Execute `git clone https://github.com/pal1000/mesa-dist-win mesa-dist-win`.

Mesa 17.3 and newer have built-in S3TC suppport, now that the S3TC patent expired, but you still need to enable S3TC texture cache though by modifying inside Mesa source code in src/gallium/drivers/llvmpipe/lp_tex_sample.h the value of LP_USE_TEXTURE_CACHE to 1. It should become
Mesa 17.3 and newer have built-in S3TC support, now that the S3TC patent expired, but you still need to enable S3TC texture cache though by modifying inside Mesa source code in src/gallium/drivers/llvmpipe/lp_tex_sample.h the value of LP_USE_TEXTURE_CACHE to 1. It should become

`#define LP_USE_TEXTURE_CACHE 1`

You can also enable S3TC texture cache by applying a patch included in this repository in `patches/s3tc.patch` to Mesa3D source code if you have git installed. This build script will try to apply it automatically. To apply manually, browse in Command Prompt to Mesa3D source code, then use `git apply` command with the location of the patch file as parametter.
You can also enable S3TC texture cache by applying a patch included in this repository in `patches/s3tc.patch` to Mesa3D source code if you have git installed. This build script will try to apply it automatically. To apply manually, browse in Command Prompt to Mesa3D source code, then use `git apply` command with the location of the patch file as parameter.

This will improve S3 texture compression performance significantly.
## 2. Setting environment variables and prepare the build
Expand All @@ -66,7 +66,7 @@ CMake | `.\bin\;`
Ninja build system if used | `.\ninja\;`
LLVM | `.\llvm\bin\;`

Python and CMake installers can set PATH automatically during installation. This build script automates this whole process but you must respect the relative paths between the script and the sources and tools. If you folowed my instructions this should have been accomplished already.
Python and CMake installers can set PATH automatically during installation. This build script automates this whole process but you must respect the relative paths between the script and the sources and tools. If you followed my instructions this should have been accomplished already.

This way the script would be able to set PATH variable correctly and you'll no longer need to set anything from this point forward.

Expand Down Expand Up @@ -109,7 +109,7 @@ Mesa swr drivers are dropped in.\mesa\build\windows-x86_64\gallium\drivers\swr.

[They only support 64-bit officially](https://bugs.freedesktop.org/show_bug.cgi?id=102564#c5). They are named swrAVX.dll and swrAVX2.dll after their instruction set requirements. You need both llvmpipe/softpipe and swr driver suitable to your CPU for swr to work. swr drivers are loaded when requested by llvmpipe/softpipe drivers. They can't run on their own.

Mesa3D off-screen renderers are dropped in:
Mesa3D off-screen rendering drivers are dropped in:
- 32-bit gallium: .\mesa\build\windows-x86\gallium\targets\osmesa;
- 64-bit gallium: .\mesa\build\windows-x86_64\gallium\targets\osmesa;
- 32-bit swrast: .\mesa\build\windows-x86\mesa\drivers\osmesa;
Expand Down
30 changes: 16 additions & 14 deletions examples/readme.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
Here are some examples on how to manually configure GL context and one that shows how to use swr instead of
llvmpipe. This is required for most applications using OpenGL 3.1 and higher on Windows
as GL_ARB_compatibility implemented by all proprietary drivers is not exposed on Mesa3D.
Here are some examples on how to manually configure OpenGL context and one that shows how to use swr instead of
llvmpipe. This is required for most applications using OpenGL 3.2 and higher on Windows
as GL_ARB_compatibility implemented by Mesa3D only supports OpenGL 3.1.
Probably as a side-effect shading language and OpenGL version don't sync by default
for most OpenGL versions except 3.3 and default 3.0.
for most OpenGL versions except 3.3 and default 3.1.

Examples:
1. Getting Desmume emulator OpenGL 3.2 renderer to work.
Require OpenGL 3.2. Trial and error shows it works best with Core profile.
1. Getting Desmume emulator OpenGL 3.2 rendering to work.
Requires OpenGL 3.2. Trial and error shows it works best with Core profile.
Solutions:
a. Override GL version to 3.2 and shading language to 1.50
a. Override OpenGL version to 3.2 and shading language to 1.50
OpenGL and shading language should always sync.
Solution highlighted in desmume.cmd.
b. Slightly easier. Override GL version to 3.3. Get shading language sync for free.
b. Slightly easier. Override OpenGL version to 3.3. Get shading language sync for free.
Going above requirements is most of times pretty safe.
Solution highlighted in desmume2.cmd.

2. GPU Caps Viewer
Tessellation is not supported by Mesa software renderers so only GL 3.x, GL 2.1 and GL 1.2
benchmarks can run. Most demos expect GL 3.2. In conclusion we need an OpenGL 3.2 or 3.3
compatibility context to simultaneously support GL 1.2, GL 2.1 and GL 3.x benchmarks.
Again GL 3.3 compatibility context is easier as shown in GPUCapsViewer.cmd.
Tessellation is not supported by Mesa software rendering so only OpenGL 3.x, OpenGL 2.1 and OpenGL 1.2
benchmarks can run. Most demos expect OpenGL 3.2. In conclusion we need an OpenGL 3.2 or 3.3
compatibility context to simultaneously support OpenGL 1.2, OpenGL 2.1 and OpenGL 3.x benchmarks.
Again OpenGL 3.3 compatibility context is easier as shown in GPUCapsViewer.cmd.

3. rpcs3 - Playstation 3 emulator.
System requirements: OpenGL 4.3 with GLSL 4.30 as specified here:
https://rpcs3.net/quickstart
Example highlighted in rpcs3.cmd
This example shows it is possible to request an incomplete OpenGL context as long as required extensions
are available as Mesa3D software rendering only supports OpenGL 3.3 fully in Core profile.

4. swr example
PPSSPP doesn't need any kind of GL context configuration. This example shows how to use swr instead of llvmpipe.
There no conflict between swr and manual GL context configuration. You can mix them if necessary.
PPSSPP doesn't need any kind of OpenGL context configuration. This example shows how to use swr instead of
llvmpipe. There no conflict between swr and manual GL context configuration. You can mix them if necessary.
2 changes: 1 addition & 1 deletion mesa3d.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Mesa3D software rendering drivers for Windows"
#define MyAppVersion "18.0.4.600-1"
#define MyAppVersion "18.1.0.600-1"
#define MyAppPublisher "Pal100x"
#define MyAppURL "https://github.com/pal1000/mesa-dist-win"
#define MyAppExeName "mesa-{#MyAppVersion}-setup.exe"
Expand Down
Loading

0 comments on commit 33b3b18

Please sign in to comment.