Skip to content

Commit

Permalink
Adjustments after OpenGL ES backend removal
Browse files Browse the repository at this point in the history
  • Loading branch information
pal1000 committed Dec 22, 2021
1 parent a4841b1 commit 28606e8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
git clone --depth=1 https://swiftshader.googlesource.com/SwiftShader swiftshader
git clone https://github.com/pal1000/swiftshader-dist-win.git swiftshader-dist-win
cd swiftshader-dist-win
git checkout 1.0.6e
git checkout 1.0.7
cd ..
displayName: Get sources
- script: swiftshader-dist-win\buildscript\ci\ci.cmd collectuids
Expand Down
4 changes: 2 additions & 2 deletions buildscript/ci/ci.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
@call %devroot%\%projectname%\buildscript\build.cmd x64-%1
@call %devroot%\%projectname%\buildscript\build.cmd x86-%1
@cd %devroot%\%projectname%\dist\x64\bin
@IF EXIST vk_swiftshader_icd.json IF EXIST libEGL.dll IF EXIST vk_swiftshader.dll set swiftshaderx64ok=1
@IF EXIST vk_swiftshader_icd.json IF EXIST vk_swiftshader.dll set swiftshaderx64ok=1
@cd %devroot%\%projectname%\dist\x86\bin
@IF EXIST vk_swiftshader_icd.json IF EXIST libEGL.dll IF EXIST vk_swiftshader.dll set swiftshaderx86ok=1
@IF EXIST vk_swiftshader_icd.json IF EXIST vk_swiftshader.dll set swiftshaderx86ok=1
@IF NOT defined swiftshaderx64ok IF NOT defined swiftshaderx86ok GOTO doneci
@cd %devroot%\%projectname%\dist
@7z a -t7z -mx=9 ..\swiftshader-%artifactuid%-%1.7z .\*
Expand Down
8 changes: 4 additions & 4 deletions buildscript/modules/dist.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
@forfiles /p %devroot%\%projectname:~0,-9%\build\buildsys-%abi% /s /m *.json /c "cmd /c copy @path %devroot%\%projectname%\dist\%abi%\bin"
@cd /d %devroot%\%projectname%\dist\%abi%\bin
@IF EXIST translator RD /S /Q translator
@md translator
@move *translator.dll translator
@REN libEGL_deprecated.dll libEGL.dll
@REN libGLESv2_deprecated.dll libGLESv2.dll
@IF EXIST *translator.dll md translator
@IF EXIST *translator.dll move *translator.dll translator
@IF EXIST libEGL_deprecated.dll REN libEGL_deprecated.dll libEGL.dll
@IF EXIST libGLESv2_deprecated.dll REN libGLESv2_deprecated.dll libGLESv2.dll
@echo.
@endlocal
@cd %devroot%
Expand Down
35 changes: 17 additions & 18 deletions buildscript/modules/swiftshader.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,26 @@
@echo.
@IF /I NOT "%buildswiftshader%"=="y" GOTO skipbuild

@rem Ask to update source code if git is available
@IF %gitstate% GTR 0 IF EXIST %devroot%\swiftshader IF %cimode% EQU 0 set "srcupd="
@IF %gitstate% GTR 0 IF EXIST %devroot%\swiftshader IF %cimode% EQU 0 set /p srcupd=Update SwiftShader source code (y/n):
@IF %gitstate% GTR 0 IF EXIST %devroot%\swiftshader IF %cimode% EQU 1 echo Update SwiftShader source code (y/n):%srcupd%
@IF %gitstate% GTR 0 IF EXIST %devroot%\swiftshader echo.
@IF %gitstate% GTR 0 IF EXIST %devroot%\swiftshader cd /d %devroot%\swiftshader
@IF %gitstate% GTR 0 IF EXIST %devroot%\swiftshader IF /I "%srcupd%"=="y" git pull -v --progress origin
@IF %gitstate% GTR 0 IF EXIST %devroot%\swiftshader IF /I "%srcupd%"=="y" echo.

@rem Get swiftshader source code if missing
@IF %gitstate% GTR 0 IF NOT EXIST %devroot%\swiftshader IF %cimode% EQU 0 git clone https://swiftshader.googlesource.com/SwiftShader %devroot%\swiftshader
@IF %gitstate% GTR 0 IF NOT EXIST %devroot%\swiftshader IF %cimode% EQU 1 git clone --depth=1 https://swiftshader.googlesource.com/SwiftShader %devroot%\swiftshader
@IF %gitstate% GTR 0 IF NOT EXIST %devroot%\swiftshader echo.
@IF %gitstate% GTR 0 IF NOT EXIST %devroot%\swiftshader IF %cimode% EQU 0 (
@git clone https://swiftshader.googlesource.com/SwiftShader %devroot%\swiftshader
@echo.
)
@IF %gitstate% GTR 0 IF NOT EXIST %devroot%\swiftshader IF %cimode% EQU 1 (
@git clone --depth=1 https://swiftshader.googlesource.com/SwiftShader %devroot%\swiftshader
@echo.
)
@cd /d %devroot%\swiftshader

@rem Ask to update source code if git is available
@IF %gitstate% GTR 0 IF %cimode% EQU 0 set "srcupd="
@IF %gitstate% GTR 0 IF %cimode% EQU 0 set /p srcupd=Update SwiftShader source code (y/n):
@IF %gitstate% GTR 0 IF %cimode% EQU 1 echo Update SwiftShader source code (y/n):%srcupd%
@IF %gitstate% GTR 0 echo.
@IF %gitstate% GTR 0 IF /I "%srcupd%"=="y" git pull -v --progress origin
@IF %gitstate% GTR 0 IF /I "%srcupd%"=="y" echo.

@IF NOT EXIST build md build
@cd build

Expand Down Expand Up @@ -68,13 +74,6 @@
@IF /I "%vk-swiftshader%"=="n" set buildconf=%buildconf% -DSWIFTSHADER_BUILD_VULKAN=OFF
@IF /I NOT "%vk-swiftshader%"=="n" set buildconf=%buildconf% -DSWIFTSHADER_BUILD_VULKAN=ON

@IF %cimode% EQU 0 set "gles-swiftshader="
@IF %cimode% EQU 0 set /p gles-swiftshader=Build SwiftShader GLES Drivers - default^:no (y/n)^:
@IF %cimode% EQU 1 echo Build SwiftShader GLES Drivers - default^:no (y/n)^:%gles-swiftshader%
@echo.
@IF /I "%gles-swiftshader%"=="y" set buildconf=%buildconf% -DSWIFTSHADER_BUILD_EGL=ON -DSWIFTSHADER_BUILD_GLESv2=ON
@IF /I NOT "%gles-swiftshader%"=="y" set buildconf=%buildconf% -DSWIFTSHADER_BUILD_EGL=OFF -DSWIFTSHADER_BUILD_GLESv2=OFF

@IF %cimode% EQU 0 set "subzerojit="
@IF %cimode% EQU 0 set /p subzerojit=Use Subzero JIT instead of LLVM - default^:no (y/n)^:
@IF %cimode% EQU 1 echo Use Subzero JIT instead of LLVM - default^:no (y/n)^:%subzerojit%
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Each binaries package has a life span of 30 days since creation per default Azur

Legacy Direct3D drivers are available [here](https://github.com/pal1000/swiftshader-dist-win/releases/download/1.0.4g/swiftshader-legacy-D3D-2020_03_30.7z).
### How to use
For OpenGL ES just copy `libEGL.dll`, `libGLES_CM.dll` and `libGLESv2.dll` from `x86\bin` / `x64\bin` depending on program architecture to program location. Same for legacy Direct3D drivers, `d3d8.dll` and `d3d9.dll`.
For legacy Direct3D drivers just copy `d3d8.dll` and `d3d9.dll` from `x86\bin` / `x64\bin` depending on program architecture to program location.

For Vulkan there are a few options (you pick one or more, first is the easiest):
- Run `swiftshader-vulkan-setup.cmd` and follow the instructions (requires Vulkan loader, see paragraph bellow if you don't have any GPU with Vulkan support);
Expand Down
3 changes: 1 addition & 2 deletions roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ Write CI script that:
- [ ] implemnt system-wide legacy type vulkan driver deployment;
- [x] implement programs launcher with swiftshader as unique Vulkan driver;
- [ ] implement per application deployment with swiftshader as unique Vulkan driver;
- [ ] implement system-wide vulkan driver deployment via fake GPU or dummy software component if possible;
- [ ] implement per application deployment of swiftshader OpenGL ES driver.
- [ ] implement system-wide vulkan driver deployment via fake GPU or dummy software component if possible.
### Support build with GN as an alternative to cmake (v1.2)
- [ ] create choice for it and integrate with build configuration profiles;
- [ ] research for and use cmake build options equivalents if possible.

0 comments on commit 28606e8

Please sign in to comment.