• We've upgraded our forums. Please post any issues/requests in this thread.

Valve Runs a Direct3D to OpenGL Translation Layer

btarunr

Editor & Senior Moderator
Staff member
Joined
Oct 9, 2007
Messages
34,328 (9.23/day)
Likes
17,426
Location
Hyderabad, India
System Name Long shelf-life potato
Processor Intel Core i7-4770K
Motherboard ASUS Z97-A
Cooling Xigmatek Aegir CPU Cooler
Memory 16GB Kingston HyperX Beast DDR3-1866
Video Card(s) 2x GeForce GTX 970 SLI
Storage ADATA SU800 512GB
Display(s) Samsung U28D590D 28-inch 4K
Case Cooler Master CM690 Window
Audio Device(s) Creative Sound Blaster Recon3D PCIe
Power Supply Corsair HX850W
Mouse Razer Abyssus 2014
Keyboard Microsoft Sidewinder X4
Software Windows 10 Pro Creators Update
#1
Digging through the source code tree of Dota 2, developers discovered Valve's latest creation, ToGL. Simply put, it's a Direct3D to OpenGL translation layer, which works to reduce duplication of effort in developing games for multiple platforms (such as Windows, Linux, and OS X). The software can translate Direct3D calls to their OpenGL analogues. So far, it can translate only certain kinds of calls within the Direct3D 9.0c API, which should fit Valve's needs adequately. It features a bytecode-level HLSL to GLSL shader language translator. It features only a limited shader model 3.0 support. ToGL is currently being provided by Valve as-is on GitHub, and is unsupported. Developers are free to incorporate it into their projects, and make modifications to it.

Show full news post
 
Joined
Mar 15, 2013
Messages
2,464 (1.42/day)
Likes
1,888
Location
GMT +2
System Name Red Radiance
Processor fx 8320
Motherboard GA-990FXA-UD5
Cooling CM Hyper 212 EVO
Memory 16gb G.skill TridentX 2400mhz (2x8 kit)
Video Card(s) GV-R929XOC-4GD
Storage OCZ vertex 460 480gb
Display(s) 32" Toshiba Full HD TV
Case CMstorm Trooper
Audio Device(s) sennheiser's pc323d usb soundcard
Power Supply corsair AX860i
Mouse roccat tyon
Keyboard roccat ryos mk fx
Software windows 7
#2
linux gaming on horizont
 
Joined
Sep 6, 2013
Messages
1,182 (0.76/day)
Likes
569
Location
Athens, Greece
System Name 3 systems: Gaming/Internet/HTPC
Processor 1075T @ 3.7GHz, undervolted @ 1.32V /1055T @ 3.5GHz, undervolted @ 1.27V/A6 5400K
Motherboard Gigabyte GA-990XA-UD3/ASRock 970 Extreme3 R2.0/ASUS FM2+
Cooling CoolerMaster TX3 (2fans)/Zalman CNPS9500 (Nvidia version)/CoolerMaster
Memory 16GB Adata 2133MHz/16GB DDR3 Kingston 2400MHz/8GB Corsair 1600MHz
Video Card(s) ASUS HD7850 2GB /Gigabyte GT620/FM2 iGPU
Storage OCZ ARC 100 + HDDs/Samsung 840 EVO + HDDs/OCZ Agility 3
Display(s) Samsung LE32D550 32'' TV(2 systems connected)/LG 42''
Case Sharkoon Rebel 12/Sharkoon Rebel 9/Xigmatek Midguard
Audio Device(s) onboard
Power Supply 850W Chieftec/560W Cheieftec/400W
Mouse CoolerMaster/Rapoo/Logitech
Keyboard CoolerMaster/Microsoft/Logitech
Software Windows 10 64bit TP + Windows 7 64bit + Windows XP (triple boot,stupidity all over the drives)
#3
This looks like the opossite to Scitech GLdirect that was translating OpenGL to DirectX in Windows.
 
Joined
Feb 8, 2012
Messages
2,678 (1.25/day)
Likes
1,914
Location
Zagreb, Croatia
System Name Windows 7 64-bit Core i5 3570K
Processor Intel Core i5 3570K @ 4.2 GHz, 1.26 V
Motherboard Gigabyte GA-Z77MX-D3H
Cooling Scythe Katana 4
Memory 4 x 4 GB G-Skill Sniper DDR3 @ 1600 MHz
Video Card(s) Gainward NVIDIA GeForce GTX 970 Phantom
Storage Western Digital Caviar Blue 1 TB, Seagate Baracuda 1 TB
Display(s) Dell P2414H
Case CoolerMaster Silencio 550
Audio Device(s) VIA HD Audio
Power Supply Corsair TX v2 650W
Mouse Steelseries Sensei
Keyboard CM Storm Quickfire Pro, Cherry MX Reds
Software MS Windows 7 Enterprise 64-bit SP1
#4
I suppose this is specifically for dota2 linux port .... wonder if it could be used to port all those games that are already xbox 360 ports :laugh: wonder how a bad port of a bad port would be like
 

Easy Rhino

Linux Advocate
Joined
Nov 13, 2006
Messages
14,405 (3.56/day)
Likes
4,256
System Name VHOST01 | Desktop
Processor i7 980x | i5 7500 Kaby Lake
Motherboard Gigabyte x58 Extreme | AsRock MicroATX Z170M Exteme4
Cooling Prolimatech Megahelams | Stock
Memory 6x4 GB @ 1333 | 2x 8G Gskill Aegis DDR4 2400
Video Card(s) Nvidia GT 210 | Nvidia GTX 970 FTW+
Storage 4x2 TB Enterprise RAID5 |Corsair mForce nvme 250G
Display(s) N/A | Dell 27" 1440p 8bit GSYNC
Case Lian Li ATX Mid Tower | Corsair Carbide 400C
Audio Device(s) NA | On Board
Power Supply SeaSonic 500W Gold | Seasonic SSR-650GD Flagship Prime Series 650W Gold
Mouse N/A | Logitech G900 Chaos Spectrum
Keyboard N/A | Posiden Z RGB Cherry MX Brown
Software Centos 7 | Windows 10
#5
with this and the crytek engine available on linux it looks like easy rhino was right 5 years ago. please bow down.
 
Joined
Mar 15, 2013
Messages
2,464 (1.42/day)
Likes
1,888
Location
GMT +2
System Name Red Radiance
Processor fx 8320
Motherboard GA-990FXA-UD5
Cooling CM Hyper 212 EVO
Memory 16gb G.skill TridentX 2400mhz (2x8 kit)
Video Card(s) GV-R929XOC-4GD
Storage OCZ vertex 460 480gb
Display(s) 32" Toshiba Full HD TV
Case CMstorm Trooper
Audio Device(s) sennheiser's pc323d usb soundcard
Power Supply corsair AX860i
Mouse roccat tyon
Keyboard roccat ryos mk fx
Software windows 7
#6
valve is working to make soruce 2 linux capable and then port all source 2 based games to linux
 
Joined
Aug 11, 2011
Messages
4,335 (1.87/day)
Likes
3,020
Location
Mexico
System Name STEAMBOX | GAMECUBE | EQC (Everyday Quad Core)
Processor i5 4590@3.7Ghz |i7 3770K@4Ghz -|- Athlon 5350@2.52Ghz
Motherboard GA-B85N PHOENIX | Asrock Z77E-ITX | Asus AM1I-A
Cooling Stock | Antec Kuhler 620 | Reeven Vanxie
Memory 2x4GB ADATA XPG 1600Mhz | 2x4GB Kingston 1866Mhz -|- 2x4GB Crucial Ballistix@1920Mhz
Video Card(s) RX 480 Nitro | Sapphire RX 480 w/Accelero Mono Plus | HD 8400 @ 720Mhz (IGP)
Storage LiteON 128GB mSATA+3TB Seagate | Seagate 1TBxSamung 64GB SSD (Intel RST) | Kingston v300 240GB
Display(s) Daewoo 49" 1080p | ASUS PA248Q 1920x1200 IPS
Case Corsair 250D | CoolerMaster Elite 110 | Acteck Fiji
Audio Device(s) Onboard
Power Supply Seasonic SS-660XP2 | Silverstone SFX-450 | 200w mini FLEX PSU
Software Windows 10 64bit
#7
I don't know if this will affect much. Cedega is more mature, has been around since like forever and I can only think of one game that has used it.
 

sneekypeet

Unpaid Babysitter
Staff member
Joined
Apr 12, 2006
Messages
24,623 (5.78/day)
Likes
9,345
System Name His
Processor Intel i7 5930K
Motherboard Asus Maximus V Extreme
Cooling Thermalright True Spirit 140 BW Rev.A
Memory Corsair Dominator Platinum ROG
Video Card(s) nVidia GTX 1080 SLI with EVGA Hybrid coolers.
Storage Samsung 960 Pro / Crucial MX300 750GB / Seagate 1TB Spinner
Display(s) Sony 43" 4K 60hz
Case SilverStone Temjin TJ11
Audio Device(s) Realtek on board > Sony receiver > Cerwin Vega's
Power Supply Thermaltake TPSG 1050W
Mouse Always Changing
Keyboard Always Changing
Software Windows 10 Pro 64
#8
How about we all stop calling each other trolls or whatever name it is at the time and move on!
This is a polite warning to everyone, move along, nothing to see here!
 

Tatty_One

Super Moderator
Staff member
Joined
Jan 18, 2006
Messages
19,747 (4.54/day)
Likes
6,014
Location
Worcestershire, UK
Processor Skylake Core i7 6700k @ 4.6gig
Motherboard MSI Z170A Tomahawk
Cooling Cooler Master Seidon 240V AIO/Viper140's
Memory 16GB Corsair Vengeance LPX 3000mhz CL14
Video Card(s) Sapphire 4gb R9 290X VaporX @1150mhz
Storage SkHynix SL308 120GB/CrucialM4/1TB WD Black
Display(s) LG 29inch 2560x1080 Curved Ultrawide IPS
Case Phanteks Enthoo Pro M Windowed - Gunmetal
Audio Device(s) Xifi Elite Pro 7.1/VideoLogic ZXR550's
Power Supply XFX Pro Black Edition 750W Gold modular
Keyboard CM Storm Octane Combo
Software Win 10 Home x64
#9
I never cease to be surprised that so much ignorance can fall upon one thread like flys around s**t, a warning was issued a while back, it has been ignored, so sadly pain is a coming, any more crap in here and we wont be talking modest 45 day holidays....... Thank You.
 
Joined
Feb 17, 2010
Messages
520 (0.18/day)
Likes
161
System Name SKY OC
Processor i3-6100 4.6GHz
Motherboard Z170 FATAL1TY K4/D3
Cooling TPC-612
Memory Trident X 2400CL9
Video Card(s) HD 7850 CFX
Storage Vector 150
Case HAF XB
Power Supply Capstone 550M
#10
Does this add even more CPU overhead?
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
10,399 (4.85/day)
Likes
5,480
Location
Concord, NH
System Name Kratos
Processor Intel Core i7 3930k @ 4.2Ghz
Motherboard ASUS P9X79 Deluxe
Cooling Zalman CPNS9900MAX 130mm
Memory G.Skill DDR3-2133, 16gb (4x4gb) @ 9-11-10-28-108-1T 1.65v
Video Card(s) MSI AMD Radeon R9 390 GAMING 8GB @ PCI-E 3.0
Storage 2x120Gb SATA3 Corsair Force GT Raid-0, 4x1Tb RAID-5, 1x500GB
Display(s) 1x LG 27UD69P (4k), 2x Dell S2340M (1080p)
Case Antec 1200
Audio Device(s) Onboard Realtek® ALC898 8-Channel High Definition Audio
Power Supply Seasonic 1000-watt 80 PLUS Platinum
Mouse Logitech G602
Keyboard Rosewill RK-9100
Software Ubuntu 17.10
Benchmark Scores Benchmarks aren't everything.
#11
Does this add even more CPU overhead?
Any compatibility layer is going to add some level of overhead. I'm curious if it's going to perform well.
 
Joined
Aug 11, 2011
Messages
4,335 (1.87/day)
Likes
3,020
Location
Mexico
System Name STEAMBOX | GAMECUBE | EQC (Everyday Quad Core)
Processor i5 4590@3.7Ghz |i7 3770K@4Ghz -|- Athlon 5350@2.52Ghz
Motherboard GA-B85N PHOENIX | Asrock Z77E-ITX | Asus AM1I-A
Cooling Stock | Antec Kuhler 620 | Reeven Vanxie
Memory 2x4GB ADATA XPG 1600Mhz | 2x4GB Kingston 1866Mhz -|- 2x4GB Crucial Ballistix@1920Mhz
Video Card(s) RX 480 Nitro | Sapphire RX 480 w/Accelero Mono Plus | HD 8400 @ 720Mhz (IGP)
Storage LiteON 128GB mSATA+3TB Seagate | Seagate 1TBxSamung 64GB SSD (Intel RST) | Kingston v300 240GB
Display(s) Daewoo 49" 1080p | ASUS PA248Q 1920x1200 IPS
Case Corsair 250D | CoolerMaster Elite 110 | Acteck Fiji
Audio Device(s) Onboard
Power Supply Seasonic SS-660XP2 | Silverstone SFX-450 | 200w mini FLEX PSU
Software Windows 10 64bit
#12
Any compatibility layer is going to add some level of overhead. I'm curious if it's going to perform well.
Cedega 6.0 was reporting >90% native speed on some titles (Enemy Territory, WoW, etc.) but that was 4 years ago, not to mention that these translators support up to DX9c.
 
Joined
Dec 28, 2012
Messages
822 (0.45/day)
Likes
304
#13
Does this add even more CPU overhead?
in this day of 7 year old core i7 cpus being capable of running modern games at 60fps, I doubt that the cpu overhead of a program like this would really make any kind of sizable impact on any halfway modern gaming system.
 
Joined
Aug 22, 2007
Messages
3,170 (0.84/day)
Likes
527
Location
Florida, US
System Name bits and pieces
Processor Intel Xeon E3-1230V3
Motherboard Gigabyte H97
Cooling stock
Memory 16GB for now
Video Card(s) EVGA GTX 970 SC
Storage 256GB SSD + 3x 2TB WDs (storage)
Display(s) 2x BENQ GW2250 + ViewSonic 24"
Case Cooler Master Centurion 5 :P
Audio Device(s) X-Fi Titanium HD --- JBL 4412 Studio Monitors / Polk PSW505
Power Supply Antec 550W
Mouse Corsair M65 pro
Keyboard MS Sidewinder
Software Win 10 Pro x64
#14
in this day of 7 year old core i7 cpus being capable of running modern games at 60fps, I doubt that the cpu overhead of a program like this would really make any kind of sizable impact on any halfway modern gaming system.
7 year old??
 
Joined
Oct 29, 2009
Messages
2,516 (0.85/day)
Likes
757
System Name Nightblade / Dell Latitude / Wife's Rig
Processor Core i5 4690K / i7 2720QM / FX-6100
Motherboard Nightblade ITX z97 / Dell 032T9K QM67 / Gigabyte GA-970A-DS3 Rev3
Cooling tower style cooler, plus one 120mm fan / stock blower / CNPS7000V
Memory Patriot Viper 2x8gb DDR3 2400 / Micron 2x4GB DDR3 / 2x4GB 2x2GB DDR3 1333
Video Card(s) MSI Gaming GTX 970 4GB / NVS 4200M 512MB / nVidia GTX 460 1GB
Storage 120GB ForceGT SSD (OS), 2TB WD Black, 250GB Seagate 2.5in / 320GB WD Blue /240GB SSD M500
Display(s) ASUS ROG SWIFT 1440P / Dell 14in @ 1600x900 / Vizio 1080p TV
Case MSI Nightblade Z97 / Dell Latitude / Corsair Full Tower
Audio Device(s) Realtek ALC1150, Microsoft Lifechat 3000 / Intel / ALC887
Power Supply Gold rated 600W / Battery with 95w brick / Antec EA-650 Green
Mouse MadCatz RAT5
Keyboard G510
Software Windows 10 Pro x64 on all
#15
yep... they're getting that old now. though 6 yrs not 7.
 
Joined
Oct 2, 2004
Messages
12,353 (2.56/day)
Likes
5,812
Location
Europe\Slovenia
System Name Dark Silence 2
Processor Intel Core i7 5820K @ 4.5 GHz (1.15V)
Motherboard MSI X99A Gaming 7
Cooling Cooler Master Nepton 120XL
Memory 32 GB DDR4 Kingston HyperX Fury 2400 MHz @ 2666 MHz 15-15-15-32 1T (1.25V)
Video Card(s) AORUS GeForce GTX 1080Ti 11GB (1950/11000 OC Mode)
Storage Samsung 850 Pro 2TB SSD (3D V-NAND)
Display(s) ASUS VG248QE 144Hz 1ms (DisplayPort)
Case Corsair Carbide 330R Titanium
Audio Device(s) Creative Sound BlasterX AE-5 + Altec Lansing MX5021 (HiFi capacitors and OPAMP upgrade)
Power Supply BeQuiet! Dark Power Pro 11 750W
Mouse Logitech G502 Proteus Spectrum
Keyboard Cherry Stream XT Black
Software Windows 10 Pro 64-bit (Fall Creators Update)
#17
This is so going in the wrong direction. Instead of using direct HW acceleration through metal API's, they are now doing rendering through several extra layers of API's. How stupid is that, all with excuse they don't have to make double work. That's how console ports are born and i don't have to say it twice, they are all rubbish. I miss the days when games had engines designed from ground up to run on both Direct3D and OpenGL from day one. Remember all the Unreal Engine based games from 1999-2003 or so?
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
10,399 (4.85/day)
Likes
5,480
Location
Concord, NH
System Name Kratos
Processor Intel Core i7 3930k @ 4.2Ghz
Motherboard ASUS P9X79 Deluxe
Cooling Zalman CPNS9900MAX 130mm
Memory G.Skill DDR3-2133, 16gb (4x4gb) @ 9-11-10-28-108-1T 1.65v
Video Card(s) MSI AMD Radeon R9 390 GAMING 8GB @ PCI-E 3.0
Storage 2x120Gb SATA3 Corsair Force GT Raid-0, 4x1Tb RAID-5, 1x500GB
Display(s) 1x LG 27UD69P (4k), 2x Dell S2340M (1080p)
Case Antec 1200
Audio Device(s) Onboard Realtek® ALC898 8-Channel High Definition Audio
Power Supply Seasonic 1000-watt 80 PLUS Platinum
Mouse Logitech G602
Keyboard Rosewill RK-9100
Software Ubuntu 17.10
Benchmark Scores Benchmarks aren't everything.
#18
This is so going in the wrong direction. Instead of using direct HW acceleration through metal API's, they are now doing rendering through several extra layers of API's. How stupid is that, all with excuse they don't have to make double work. That's how console ports are born and i don't have to say it twice, they are all rubbish. I miss the days when games had engines designed from ground up to run on both Direct3D and OpenGL from day one. Remember all the Unreal Engine based games from 1999-2003 or so?
I disagree, if they can get close with minimal overhead, that save a lot of programming hours porting an engine from one 3D API to another. While it might be slower, it's a step in the right direction. It also create a framework for how to port DX applications to OpenGL since there is a library that does the translation for you.

The real question we have to ask (before we start bashing it,) is what kind of performance will we see out of this compatibility layer. Until our questions are answered we shouldn't judge it. Additionally, it's a lot more than double work to port a game from one API to another. Consider for a moment how many bugs and incompatibilities you come across between the two APIs then remember that they need to thoroughly test it once they even get it working.

This makes sense for games that were coded for DX and only DX to run in OpenGL. I don't see the problem with that. It's giving you an option where you wouldn't otherwise have one.

Don't like it? Make your own damn 3d engine. :p
 
Joined
Oct 2, 2004
Messages
12,353 (2.56/day)
Likes
5,812
Location
Europe\Slovenia
System Name Dark Silence 2
Processor Intel Core i7 5820K @ 4.5 GHz (1.15V)
Motherboard MSI X99A Gaming 7
Cooling Cooler Master Nepton 120XL
Memory 32 GB DDR4 Kingston HyperX Fury 2400 MHz @ 2666 MHz 15-15-15-32 1T (1.25V)
Video Card(s) AORUS GeForce GTX 1080Ti 11GB (1950/11000 OC Mode)
Storage Samsung 850 Pro 2TB SSD (3D V-NAND)
Display(s) ASUS VG248QE 144Hz 1ms (DisplayPort)
Case Corsair Carbide 330R Titanium
Audio Device(s) Creative Sound BlasterX AE-5 + Altec Lansing MX5021 (HiFi capacitors and OPAMP upgrade)
Power Supply BeQuiet! Dark Power Pro 11 750W
Mouse Logitech G502 Proteus Spectrum
Keyboard Cherry Stream XT Black
Software Windows 10 Pro 64-bit (Fall Creators Update)
#19
Sure, Direct3D also had "minimal" overhead which now turned into a massive one...
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
10,399 (4.85/day)
Likes
5,480
Location
Concord, NH
System Name Kratos
Processor Intel Core i7 3930k @ 4.2Ghz
Motherboard ASUS P9X79 Deluxe
Cooling Zalman CPNS9900MAX 130mm
Memory G.Skill DDR3-2133, 16gb (4x4gb) @ 9-11-10-28-108-1T 1.65v
Video Card(s) MSI AMD Radeon R9 390 GAMING 8GB @ PCI-E 3.0
Storage 2x120Gb SATA3 Corsair Force GT Raid-0, 4x1Tb RAID-5, 1x500GB
Display(s) 1x LG 27UD69P (4k), 2x Dell S2340M (1080p)
Case Antec 1200
Audio Device(s) Onboard Realtek® ALC898 8-Channel High Definition Audio
Power Supply Seasonic 1000-watt 80 PLUS Platinum
Mouse Logitech G602
Keyboard Rosewill RK-9100
Software Ubuntu 17.10
Benchmark Scores Benchmarks aren't everything.
#20
Sure, Direct3D also had "minimal" overhead which now turned into a massive one...
Please start citing your sources if you're going to make claims like that. DX interfaces with hardware-level APIs so overhead will be minimal anyways in most cases, so I'm reluctant to believe that. Any API call is going to have some overhead and take some time to call it, but taking time to call an API doesn't mean that it has a lot of overhead. Some API calls are just simply costly.
 
Joined
May 11, 2006
Messages
74 (0.02/day)
Likes
11
#21
As far as I understand from a short look in the source, this wrapper is used at compile-time.
This means that there is no overhead for redirected calls at runtime, but you need the source of a game to make use of it.
I'd still expect a slight performance hit compared to native OGl though. Some API-calls are normally avoided/used less in OGl due to bad performance and others from DX which are normally eluded with some effort would perform well when their OGl counterpart is used.
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
10,399 (4.85/day)
Likes
5,480
Location
Concord, NH
System Name Kratos
Processor Intel Core i7 3930k @ 4.2Ghz
Motherboard ASUS P9X79 Deluxe
Cooling Zalman CPNS9900MAX 130mm
Memory G.Skill DDR3-2133, 16gb (4x4gb) @ 9-11-10-28-108-1T 1.65v
Video Card(s) MSI AMD Radeon R9 390 GAMING 8GB @ PCI-E 3.0
Storage 2x120Gb SATA3 Corsair Force GT Raid-0, 4x1Tb RAID-5, 1x500GB
Display(s) 1x LG 27UD69P (4k), 2x Dell S2340M (1080p)
Case Antec 1200
Audio Device(s) Onboard Realtek® ALC898 8-Channel High Definition Audio
Power Supply Seasonic 1000-watt 80 PLUS Platinum
Mouse Logitech G602
Keyboard Rosewill RK-9100
Software Ubuntu 17.10
Benchmark Scores Benchmarks aren't everything.
#22
As far as I understand from a short look in the source, this wrapper is used at compile-time.
This means that there is no overhead for redirected calls at runtime, but you need the source of a game to make use of it.
I'd still expect a slight performance hit compared to native OGl though. Some API-calls are normally avoided/used less in OGl due to bad performance and others from DX which are normally eluded with some effort would perform well when their OGl counterpart is used.
I saw translated calls and not a whole lot of pre-prossessor directives. I don't think it's done at compile time, but it doesn't do much more than add another reference frame to the call stack as most of those translated calls are pretty simple (direct one-to-one translations with one line of code,), but any extra calls take time to do and I'm sure there are things that DX does faster than OpenGL and things that OpenGL does faster than DX.
 
Joined
May 11, 2006
Messages
74 (0.02/day)
Likes
11
#23
Even a stupid compiler will inline most of those calls and get rid of the added reference, but they are not strictly preprocessor, that's right.