GNU/Linuxãã¤ãã£ãã®Direct3D 9ã使ããããã«ããgallium nineã¨é¢é£ã¡ã¢(CSMT,Wine Staging)è·¡å°
(2019/9/29)æ¬è¨äºã¯ãGNU/LinuxネイティブのDirect3D 9を実装したGallium Nineとその使い方ãã¸ç§»åããã
以ä¸ã以åã®å 容ã¨ãªãã
ãgallium nineãã¨å¼ã°ããã½ããã¦ã§ã¢ãä¸é¨ã§æ³¨ç®ããã¦ããã
gallium nineã«ã¤ãã¦
ããã¯GNU/Linuxã§èªç±ãªã½ããã¦ã§ã¢ã®ã°ã©ãã£ãã¯ãã©ã¤ã使ç¨æã«Direct3D 9ãOSãã¤ãã£ããªæç»APIã¨ãã¦Wineä¸ã®Windowsã¢ããªã±ã¼ã·ã§ã³ãªã©ã®Direct3D 9ãå©ç¨ããããã°ã©ã ããå©ç¨ã§ããããã«ãããã®ãèªç±ãªã½ããã¦ã§ã¢ã®ã°ã©ãã£ãã¯ãã©ã¤ãã§ã¯Gallium3D(ãããã¯Gallium)ã¨å¼ã°ãã3Dã°ã©ãã£ãã¯ã®æ çµã¿ãç¨ãããããããgallium nineãã¯ãã®ä¸ã®ãstate trackerãã¨å¼ã°ãã種é¡ã®ã¢ã¸ã¥ã¼ã«ã¨ãã¦Gallium使ç¨æã«Direct3D 9ãæç»APIã¨ãã¦ç¨ãããã¨ãå¯è½ã«ããã
ãã¡ã¤ã«ã¨ãã¦ã¯ãd3dadapter9ãã¨å¼ã°ããã©ã¤ãã©ãªã®å½¢ãã¨ãããããWineãªã©ã®ã½ããã¦ã§ã¢ããå©ç¨ããããã®ããããã¡ã¤ã«ç¾¤*1ã¨ãstate trackerã¨ãã¦(libdrmãLLVMãªã©ã®ã©ã¤ãã©ãªãç¨ãã¦)Direct3D 9ã®æ©è½ãæä¾ããå ±æãªãã¸ã§ã¯ã(d3dadapter9.so.[æ°å])*2ããæãã
gallium nineã®å©ç¹ã¨æ¬ ç¹
å©ç¹
Wineã¯æ¢ã«DirectX 9cãå®è£ ãã¦ããããDirect3Dã«ã¤ãã¦ã¯OpenGLãç¨ãã¦å®è£ ããã¦ãããDirect3Dã®æç»å½ä»¤ãå®è¡ããããã«ã¯å¦çã³ã¹ããä½è¨ã«ããããgallium nineã¯ãWineã®Direct3D 9(OpenGLãç¨ããå®è£ )ã¨æ¯ã¹ãã¨OpenGLãçµç±ããªãåå¦çã³ã¹ããå°ãªãé¢ä¿ã§é«éã«åä½ããå ´åãå¤ãã
ã©ã®ç¨åº¦é«éåããããã¯ã°ã©ãã£ãã¯ãã©ã¤ã(Galliumã®ãã©ã¤ãé¨å,libdrm,ã«ã¼ãã«ã®DRMã¢ã¸ã¥ã¼ã«ã¨ãã£ãããã°ã©ã )ãGPUã«ããããç¹ã«ãé«æ§è½ãªGPUã®ä½¿ç¨æã«ã¯å¤§ããªå·®ãåºãããã ãWindowsä¸ããéããªããã©ããã¯ããããã®OSã®ã°ã©ãã£ãã¯ãã©ã¤ããªã©ã«ããã
åä½é度ããã¾ãåä¸ããªãã±ã¼ã¹ã§ãCPUã®å¦çéãæ¸ãã®ã¯ééããªããããCPU使ç¨çãæ¸ã£ã¦ãããã«çé»åã«ãªãå ´åãããã
ä¸ã¯Direct3D 9ã®æç»å¦çã®å¤§ã¾ããªæµããæ¯è¼ããå³ã
(Wineã§Direct3D 9ã¢ããªã±ã¼ã·ã§ã³ãåããéã®æç»å¦çã®æµã) Wine/d3d9 -[Direct3D 9å½ä»¤]-> Wine/wined3d(OpenGLãç¨ãã¦ãã®é½åº¦å®è¡) -[OpenGLå½ä»¤]-> libGL -> Galliumãã©ã¤ã -> ä½ã¬ãã«ãã©ã¤ã(libdrmãDRMã«ã¼ãã«ã¢ã¸ã¥ã¼ã«) -> GPU (gallium nineãç¨ããéã®æç»å¦çã®æµã) Wine/d3d9(å½ä»¤ããã®ã¾ã¾æ¸¡ã) -[Direct3D 9å½ä»¤]-> d3dadapter9 -> Galliumãã©ã¤ã -> ä½ã¬ãã«ãã©ã¤ã(libdrmãDRMã«ã¼ãã«ã¢ã¸ã¥ã¼ã«) -> GPU
ã·ã§ã¼ãå¦çã«ã¤ãã¦ã¯ãWineã®Direct3D(wined3d)ã§ã¯
ã®ãããããç¨ããå½¢ã§å®è£ ããã¦ãããããããã¯èªç±ãªã½ããã¦ã§ã¢ã®ã°ã©ãã£ãã¯ãã©ã¤ã使ç¨æã¯ä¸æ¦Galliumã®TGSI(TG Shader Infrastructure)ã¨å¼ã°ããæ½è±¡åããã表ç¾ã«å¤æããã¦ãã(åGPUåãã®Galliumãã©ã¤ããçµç±ãã¦)å®è¡ããããgallium nineããã·ã§ã¼ããç¨ããéã«ã¯ä¸è¨ã®ãããããçµç±ããã«ç´æ¥TGSIã¸å¤æãããããããããããå¦çã³ã¹ããåæ¸ãããã
(Wineã§Direct3D 9ã¢ããªã±ã¼ã·ã§ã³ãåããéã®ã·ã§ã¼ãå¦çã®æµã) Wine/d3d9 -[Direct3D 9å½ä»¤]-> Wine/wined3d(GLSL or GLæ¡å¼µã¨ãã¦ãã®é½åº¦å®è¡) -[GLSL or GLæ¡å¼µ]-> libGL(TGSIã«å¤æ) -[TGSI]-> Galliumãã©ã¤ã -> ä½ã¬ãã«ãã©ã¤ã(libdrmãDRMã«ã¼ãã«ã¢ã¸ã¥ã¼ã«) -> GPU (gallium nineãç¨ããéã®ã·ã§ã¼ãå¦çã®æµã) Wine/d3d9 -[Direct3D 9å½ä»¤]-> d3dadapter9(TGSIã«å¤æ) -[TGSI]-> Galliumãã©ã¤ã -> ä½ã¬ãã«ãã©ã¤ã(libdrmãDRMã«ã¼ãã«ã¢ã¸ã¥ã¼ã«) -> GPU
æ¬ ç¹
- 2015å¹´1ææç¹ã§ã¯Direct3D 9å°ç¨ã»ãã ããããã¸ã§ã¯ãã®ãµã¤ãã«ããã¨å¥ã®ãã¼ã¸ã§ã³ã«åãã対å¿ã®å¯è½æ§ããããç¹ã«Direct3D 8ã¯å°æ¥å¯¾å¿ããå¯è½æ§ãé«ã*3
- 2015å¹´1ææç¹ã®ãããã©ã¤ã¨ã¿ãªãªã°ã©ãã£ãã¯ãã©ã¤ã(GPUã¡ã¼ã«ã¼æä¾ã®ãèªç±ã§ãªããã©ã¤ã)ã¯Galliumã®æ§é ã«åã£ã¦ããªãããããããã©ã¤ã¨ã¿ãªãã©ã¤ãã§ã¯å©ç¨ã§ããªã
- 2015å¹´1ææç¹ã§ã¯ã¾ã å®æ度ãä½ããåä½ããããã°ã©ã ã¯é常ã«è¯å¥½ã«åä½ããä¸æ¹ã§ãã¾ã¨ãã«åä½ããªãããã°ã©ã ãå¤ã
- Wineã§å©ç¨ããããã«ã¯Wineã¸ã®ä¿®æ£ãå¿ è¦ã§ã2015å¹´1ææç¹ã§ã¯å ¬å¼ã®Wineã§ã¯æªå¯¾å¿*4ã»æ´ã«ãå¤ãå®å®çã®Wineã§ã¯å©ç¨ã§ããªã(ãã¼ã¸ã§ã³1.8ãåºãã°å®å®çã§å©ç¨ã§ãã)
ããã¾ã§ã®éçº
æåã«è©±é¡ã«ãªã£ãã®ã¯2013å¹´å¤ãMesaのメーリングリストへの投稿ã®ã¨ãã ã£ãã2014å¹´æ¥ã¾ã§ã¯ãã®ã¨ãã®éçºãªãã¸ããªã§éçºãç¶ãã¦ãããããã®å¾ã¯æ°ããæ´¾çãªãã¸ããªã«ç§»ã£ã¦æ´»çºã«éçºãè¡ãããããã«ãªã£ãã
æ´ã«ãMesaã®å
¬å¼ã®ã½ã¼ã¹ããªã¼ã«åãè¾¼ãã§ãããããåããããåããé²ãã§ããã¼ã¸ã§ã³10.4ã§ã¯åãã¦å
¬å¼ã®ãªãªã¼ã¹ã®ä¸ã«å«ã¾ãããã¨ã«ãªã£ãã
ãã«ãã®éã«configureã¹ã¯ãªããã¸ãªãã·ã§ã³--enable-nineãä»ãããã¨ã§æ¯è¼çç°¡åã«å°å
¥ã§ããããã«ãªã£ã¦ãããããã£ã¹ããªã«ãã£ã¦ã¯Mesa 10.4ã®ããã±ã¼ã¸ã§gallium nineã¯ç¡å¹(æ¢å®å¤)ã®ã¾ã¾ã¨ãªã£ã¦ãã¦å©ç¨ã§ããªãã
Mesa 10.4ã®gallium nineãã¾ã å®æ度ã¯ä½ããéçºãç¶ããããä¸æ¹ã§ãMesa 10.4ãåºãå¾ã®ä¿®æ£ã«ã¤ãã¦ãå
¬å¼ã®ã½ã¼ã¹ããªã¼ã«åãè¾¼ãã§ãããåããç¶ãã¦ããã2015/1/23(GMT表è¨ã§ã¯22æ¥ã¨ãªãæå»)ã«ã¯50ãã®ããããæ°ããåãè¾¼ã¾ãããMesa 10.5ã§ã¯ãã®æ¹åãå
¥ãè¦éãã*5
Wineã¸ã®ä¿®æ£ã«ã¤ãã¦ã¯ãå
¬å¼ã®ã½ã¼ã¹ããªã¼ã¸ã®åãè¾¼ã¿ã¯ã¾ã è¡ããã¦ããããè¦éãã«ã¤ãã¦ãä¸æ*6ã
å°å ¥
プロジェクトサイトのインストールに関するページã§ãã£ã¹ããªãã¨ã®å°å ¥ã«ã¤ãã¦æ¸ããã¦ããã詳ããã¯ããã§ã¯æ±ããªãããDRI2ãããDRI3ãç¨ããã»ããé«éã«åä½ãããã¨ããã¦ããããDRI3ã®ä½¿ç¨ã¯å¿ é ã§ã¯ãªããDRI2ç°å¢ã§ãWineã§gallium nineã使ããããã«ãªã£ã¦ãã(ãDRI2 fallbackãã¨ããæ©è½)ã*7
2015å¹´1ææç¹ã§ã¯ãX11ã§ãxf86-video-atiããã©ã¤ã*8ã使ç¨ãã¦ããå ´åãDRI3ãç¨ããã«ã¯åããã¸ã§ã¯ããæä¾ãããxf86-video-atiãããã±ã¼ã¸ãå¿ è¦ãgallium nineã®åä½ãã¹ãã¨ä¸å ·åå ±åãè¡ãç®çã§ä½¿ãå ´åã¯ãããã¯ç¨ããã«DRI2ç°å¢ãç¨ããã»ãããã(ä¸å ·ååå ã®åãåãã®é½å)ã
æå¹å/ç¡å¹åã®è¨å®
以åã¯ã¬ã¸ã¹ããªã®å¤ãæåã§è¨å®ããå¿ è¦ããã£ããã2015å¹´1ææç¹(ãã¼ã¸ã§ã³1.7.34)ã®ä¿®æ£æ¸ã¿ã®Wineã§ã¯GUIãã¼ã«winecfgã§ãç»é¢ãã¿ãã«è¨å®é ç®ãããããã§ãã¯ãå ¥ããç¶æ ã§Direct3D 9ã¢ããªã±ã¼ã·ã§ã³ã使ç¨ããã¨ãã«gallium nineã使ããã(ãã§ãã¯ãå¤ãã¨å¾æ¥ã®OpenGLãç¨ããå®è£ ã§åä½ãã)ãåä½ãã¹ã
ãã¹ãã«ã¯Windowsã®DirectX 診æãã¼ã«(dxdiag)ã便å©ã§ãwinetricksã®ãdxdiagãããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããã®ã楽ãã¤ã³ã¹ãã¼ã«ããããWineå ã®ãdxdiagãã³ãã³ããå®è¡ããã
(ãã¹ãæã«ãã«ã¹ã¯ãªã¼ã³ã§åä½) $ WINEPREFIX=[Wineç°å¢ã®å ´æ] wine dxdiag (1024x768ã®ä»®æ³ãã¹ã¯ãããã®ã¦ã£ã³ãã¦å ã§åä½ã»ãã¹ãæã«ã¯ã¦ã£ã³ãã¦ãµã¤ãºãå¤ãã) $ WINEPREFIX=[Wineç°å¢ã®å ´æ] wine explorer /desktop=dxdiag,1024x768 dxdiag
ããã£ã¹ãã¬ã¤ãã¿ãã®ãDirect3D ã®ãã¹ãããæ¼ãã¨3ã¤ç®ã®ãã¹ãã§Direct3D 9ã使ãããã®ã§ãããã§åè¿°ã®ãã§ãã¯ãå
¥ã£ã¦ããã¨GNU/Linuxãã¤ãã£ãã®Direct3D 9ã使ããããå転ããç«æ¹ä½ã®æç»ã ããè¦ã¦ãéãã¯åãããªãããGNU/Linuxãã¤ãã£ãã®Direct3D 9ã使ããã¦ããã¨ãã«ã¯ç«¯æ«ã«ã¯è²ã®ä»ããã¡ãã»ã¼ã¸ã表示ããã(ããã°ã©ã èµ·åæãªã©ãæç»å¦ç以å¤ã§è¡¨ç¤ºãããå ´é¢ããã)ã
ããã¾ã§ã«åé¡ããªããã°å°å
¥ã«æåãã¦ãããã¨ã«ãªãã
é¢é£:Wineä¸ã®Direct3DãDirectDrawã®CSMTã«ããé«éå
gallium nineã¨ã¯å¥ã«ãCSMT (Commandstream multithreading)*9ãã¨å¼ã°ããææ³(OpenGLå½ä»¤ã®å®è¡ã®å¥ã¹ã¬ããå)ã«ããWineã®Direct3D(Wineã対å¿ããå ¨ã¦ã®ãã¼ã¸ã§ã³)ãDirectDrawã®åä½ãé«éåããå ´åãããããããã©ã¤ã¨ã¿ãªãã©ã¤ãã§ãæ©æµãåããããã*10ãã¡ããã2015å¹´1ææç¹ã§ã¯ã¾ã å ¬å¼ã®Wineã®ã½ã¼ã¹ããªã¼ã«ã¯å ¥ã£ã¦ããªã*11ããã¾ã å ¬å¼ã®ã½ã¼ã¹ããªã¼ã«åãè¾¼ã¾ãã¦ããªãä¿®æ£(å®é¨çãªãã®ãå«ã)ãé©ç¨ãããã¼ã¸ã§ã³ãå¤ãã®ãã£ã¹ããªåãã«æä¾ãããã¨ã§ãã¹ãã»è©ä¾¡ãªã©ãè¡ãããããã¦ãããããåãå ¥ãã¦ãããæµããã³ã¼ãã®å質ãããããããç®çã§éç¨ããã¦ãããWine Stagingãããã¸ã§ã¯ã(www.wine-staging.com)*12ãæä¾ãã¦ããããã±ã¼ã¸ãå°å ¥ãããã¨ã§è©¦ããã¨ãã§ãããCSMTã®æå¹/ç¡å¹ã®åãæ¿ãã«ã¤ãã¦ãwinecfgã§å¯è½ã¨ãªã£ã¦ããããã¼ã¸ã§ã³1.7.34ã®æç¹ã§ã¯ãStagingãã¿ãã®CSMTã«é¢ããè¨å®é ç®ã«ãã§ãã¯ãå ¥ãããã¨ã§æå¹ã«ã§ããã
*1:ä¿®æ£ãããWineãªã©ããããå©ç¨ããå´ã®ã½ããã¦ã§ã¢ã®ãã«ãæã«ä½¿ç¨
*2:å©ç¨ããå´ã®ã½ããã¦ã§ã¢ã®ãã«ãæã¨å®è¡æã®ä¸¡æ¹ã§ä½¿ç¨
*3:Direct3D 10以ä¸ã¯éå»ã«state trackerã¨ãã¦ã®å®è£ ãåå¨ããææããã(ãã ãå®ç¨çã§ã¯ãªãã©ã¤ãã©ãªããªããå®éã¯ã»ã¨ãã©ä½¿ãããªãã£ã)ã2015å¹´1ææç¹ã§ã¯æ¶ãã¦ãããã®ã®ãå°æ¥éè¦ãé«ã¾ãã°ãã¾ãå¥ã®æ°ããstate trackerã¨ãã¦ã®å®è£ ãç»å ´ããå¯è½æ§ã¯ãã
*4:Ubuntuã®PPAã§å ¬éãã¦ãã人ããããããå°å ¥èªä½ã¯æ¥½ã«ã§ãã
*5:ãã®å ã®å¤§é¨åã¯10.4ç³»ã«ãé©ç¨ããããã¼ã¸ã§ã³10.4.3ã§å©ç¨ã§ãã
*6:ãã¡ããé©ç¨æ¸ã¿ãã¼ã¸ã§ã³ãUbuntuã®PPAã§å ¬éãã¦ãã人ããããããå°å ¥èªä½ã¯æ¥½ã«ã§ãã
*7:以åã¯DRI2ãDRI3ã®çæ¹ã«ãã対å¿ã§ããã注æãå¿ è¦ã ã£ã
*8:Device Dependent X (DDX) driverã¨ããé¡ã®X11ç¨ãã©ã¤ã
*9:ãd3dstreamãã¨å¼ã°ãããã¨ããã
*10:ã¾ããæå¹ã«ãããã¨ã§æç»ã®ä¸å ·åãåºãå ´åããéã«æ¢åã®æç»ã®ä¸å ·åã®åé¿ã«ãªãå ´åãããããã
*11:å°æ¥çã«ã¯ç¢ºå®ã«åãè¾¼ã¾ããè¦éã
*12:Silverlight(DRMæãã®åç»ã®è¦è´å«ã)ãUnity3Dãªã©ã®Windowsåããã©ã¦ã¶ãã©ã°ã¤ã³ãGNU/Linuxã®Webãã©ã¦ã¶ã§åããPipelightããã使ãããã»Pipelightã«ã¤ãã¦ã¯æ©ä¼ãããã°è¨äºã¨ãã¦è©³ããæ±ã