Upvote Upvoted 0 Downvote Downvoted
Using Metal to improve TF2 performance on MacOS
posted in Q/A Help
1
#1
0 Frags +

As a random developer who plays TF2, I was wondering if it is possible for me to make a mod for TF2 to make the game run or at least utilise some of the performance advantages Metal gives for MacOS Mojave.

I have no idea how TF2 mods work but I know that the mods load during the game's initial startup, so logically the mod should be able to modify how to the game is run in some way.

I highly doubt my idea is possible but I'd like to hear some other people's opinion on it first before just forgetting about the idea.

Also please don't reply with "Get a PC". It's not funny.

As a random developer who plays TF2, I was wondering if it is possible for me to make a mod for TF2 to make the game run or at least utilise some of the performance advantages Metal gives for MacOS Mojave.

I have no idea how TF2 mods work but I know that the mods load during the game's initial startup, so logically the mod should be able to modify how to the game is run in some way.

I highly doubt my idea is possible but I'd like to hear some other people's opinion on it first before just forgetting about the idea.


Also please don't reply with "Get a PC". It's not funny.
2
#2
0 Frags +

For anyone who doesn't know what MacOS Metal is, here's the Apple docs for it: https://developer.apple.com/metal/

For anyone who doesn't know what MacOS Metal is, here's the Apple docs for it: https://developer.apple.com/metal/
3
#3
15 Frags +

not a graphics programmer but here goes:

  • opengl on tf2 works by a layer which translates directx calls to opengl (something like this, though that seems to be for dota)
  • if you want to run it on metal you'll need to translate from directx or opengl to metal. opengl to metal wrappers seem to exist because apple deprecated opengl on iOS. MAYBE its possible to use these on mac. writing your own without help will take years.
  • iirc a lot of the performance improvements in metal come from the fact it's a lower level API (similar concept to vulkan) and so provides more granularity to rendering engines. dont expect to just glue it to tf2 and expect performance improvements as the game will still try to use a directx api
  • if it's like windows, the game is largely CPU or memory-speed limited. i wouldn't expect GPU speedups to help you much
not a graphics programmer but here goes:

[list]
[*] opengl on tf2 works by a layer which translates directx calls to opengl (something like [url=https://github.com/ValveSoftware/ToGL]this[/url], though that seems to be for dota)
[*] if you want to run it on metal you'll need to translate from directx or opengl to metal. opengl to metal wrappers seem to exist because apple deprecated opengl on iOS. MAYBE its possible to use these on mac. writing your own without help will take years.
[*] iirc a lot of the performance improvements in metal come from the fact it's a lower level API (similar concept to vulkan) and so provides more granularity to rendering engines. dont expect to just glue it to tf2 and expect performance improvements as the game will still try to use a directx api
[*] if it's like windows, the game is largely CPU or memory-speed limited. i wouldn't expect GPU speedups to help you much
[/list]
4
#4
18 Frags +

gemm when did you get so smart
you're like 40% hotter already

gemm when did you get so smart
you're like 40% hotter already
5
#5
3 Frags +

you're great loris i loved your snapchat story about the 15 year old mixing desk yesterday :)

you're great loris i loved your snapchat story about the 15 year old mixing desk yesterday :)
6
#6
0 Frags +

Get a PC

Get a PC
7
#7
17 Frags +

Install linux

Install linux
8
#8
2 Frags +

ngl I saw the thread title and thought this was some crazy exploit related to Engineer's metal

ngl I saw the thread title and thought this was some crazy exploit related to Engineer's metal
9
#9
0 Frags +
Shearsngl I saw the thread title and thought this was some crazy exploit related to Engineer's metal

i thought he was wanting to infuse his pc with refined metal from tf2 to make it go faster

[quote=Shears]ngl I saw the thread title and thought this was some crazy exploit related to Engineer's metal[/quote]

i thought he was wanting to infuse his pc with refined metal from tf2 to make it go faster
10
#10
4 Frags +

Step 1: Acquire a Linux VM with Metal support.
Step 2: Install Steam and TF2 via WINE.
Step 3: If this unholy contraption does not explode it should cause the TF2 devs enough physical pain to either
A: Fix TF2.
B: Kill you.
Really it's 50/50, worth a shot I guess.

Seriously though MacOS doesn't have GPU passthough either so even VMs won't be that good and you're simply better off dual booting a different OS. Shouldn't take up that much space anyway.

Step 1: Acquire a Linux VM with Metal support.
Step 2: Install Steam and TF2 via WINE.
Step 3: If this unholy contraption does not explode it should cause the TF2 devs enough physical pain to either
A: Fix TF2.
B: Kill you.
Really it's 50/50, worth a shot I guess.


Seriously though MacOS doesn't have GPU passthough either so even VMs won't be that good and you're simply better off dual booting a different OS. Shouldn't take up that much space anyway.
11
#11
Stream Highlights
1 Frags +
Air_Shearsngl I saw the thread title and thought this was some crazy exploit related to Engineer's metal
i thought he was wanting to infuse his pc with refined metal from tf2 to make it go faster

Pay to use configs

[quote=Air_][quote=Shears]ngl I saw the thread title and thought this was some crazy exploit related to Engineer's metal[/quote]

i thought he was wanting to infuse his pc with refined metal from tf2 to make it go faster[/quote] Pay to use configs
12
#12
0 Frags +

ill be honest I fully expected an essay about how to use refined metals to improve your skill
e: ok i didn’t read the thread other than op soz

ill be honest I fully expected an essay about how to use refined metals to improve your skill
e: ok i didn’t read the thread other than op soz
13
#13
-3 Frags +
appleMetal provides near-direct access to the graphics processing unit (GPU).

= lower level of abstraction?

gotta need that to optimize the shit out of the bad graphics cards on mac amirite

gemmnot a graphics programmer but here goes:
  • opengl on tf2 works by a layer which translates directx calls to opengl (something like this, though that seems to be for dota)

But don't you introduce significant overhead by doing so?

[quote=apple]Metal provides near-direct access to the graphics processing unit (GPU).[/quote]
= lower level of abstraction?

gotta need that to optimize the shit out of the bad graphics cards on mac amirite

[quote=gemm]not a graphics programmer but here goes:

[list]
[*] opengl on tf2 works by a layer which translates directx calls to opengl (something like [url=https://github.com/ValveSoftware/ToGL]this[/url], though that seems to be for dota)

[/list][/quote]

But don't you introduce significant overhead by doing so?
14
#14
1 Frags +
SetsulStep 1: Acquire a Linux VM with Metal support.

wtf are you talking about, metal is a proprietary Apple API

Twiggy= lower level of abstraction?

gotta need that to optimize the shit out of the bad graphics cards on mac amirite

yes it is a lower level of abstraction, Vulkan is to OpenGL is what C is to like javascript or Java
you manage the entirety of GPU resources yourself, as opposed to old OpenGL where you do whatever and driver could do things well or not

TwiggyBut don't you introduce significant overhead by doing so?

surprisingly its not really the case when Valve did it for their Source games when they added Linux+OSX support
I dont know much about MoltenVK but I think it's a similar story as well?
I've been following a Rust project for a while (https://github.com/gfx-rs/gfx) and it seems like DX12, Vulkan and Metal are very close in terms of API so you could generalize an API to work on either (what gfx-hal does) or translate between (whch is what MotltenVK does)

[quote=Setsul]Step 1: Acquire a Linux VM with Metal support.[/quote]
wtf are you talking about, metal is a proprietary Apple API

[quote=Twiggy]
= lower level of abstraction?

gotta need that to optimize the shit out of the bad graphics cards on mac amirite
[/quote]
yes it is a lower level of abstraction, Vulkan is to OpenGL is what C is to like javascript or Java
you manage the entirety of GPU resources yourself, as opposed to old OpenGL where you do whatever and driver could do things well or not

[quote=Twiggy]But don't you introduce significant overhead by doing so?[/quote]
surprisingly its not really the case when Valve did it for their Source games when they added Linux+OSX support
I dont know much about MoltenVK but I think it's a similar story as well?
I've been following a Rust project for a while (https://github.com/gfx-rs/gfx) and it seems like DX12, Vulkan and Metal are very close in terms of API so you could generalize an API to work on either (what gfx-hal does) or translate between (whch is what MotltenVK does)
15
#15
1 Frags +

I tried out using Vulkan translation for TF2 on Windows and Linux but the results I got were not statistically significant except on very powerful CPUs. I think the overhead from the translation was bottlenecking the CPU more, and any wins from using a more efficient graphics API were curbed by that.

I tried out using Vulkan translation for TF2 on Windows and Linux but the results I got were not statistically significant except on very powerful CPUs. I think the overhead from the translation was bottlenecking the CPU more, and any wins from using a more efficient graphics API were curbed by that.
16
#16
0 Frags +
twiikuuSetsulStep 1: Acquire a Linux VM with Metal support.wtf are you talking about, metal is a proprietary Apple API

Linux VM on a MacOS host.
I mean the whole reason for this thread is that he's on MacOS.
Didn't think I'd have to spell that out.

[quote=twiikuu][quote=Setsul]Step 1: Acquire a Linux VM with Metal support.[/quote]
wtf are you talking about, metal is a proprietary Apple API
[/quote]
Linux VM on a MacOS host.
I mean the whole reason for this thread is that he's on MacOS.
Didn't think I'd have to spell that out.
17
#17
-1 Frags +
SetsultwiikuuSetsulStep 1: Acquire a Linux VM with Metal support.wtf are you talking about, metal is a proprietary Apple APILinux VM on a MacOS host.
I mean the whole reason for this thread is that he's on MacOS.
Didn't think I'd have to spell that out.

that's not how that works

[quote=Setsul][quote=twiikuu][quote=Setsul]Step 1: Acquire a Linux VM with Metal support.[/quote]
wtf are you talking about, metal is a proprietary Apple API
[/quote]
Linux VM on a MacOS host.
I mean the whole reason for this thread is that he's on MacOS.
Didn't think I'd have to spell that out.[/quote]
that's not how that works
18
#18
0 Frags +

Then how do you think does hardware acceleration on MacOS work? It just runs DirectX directly?

Then how do you think does hardware acceleration on MacOS work? It just runs DirectX directly?
19
#19
0 Frags +
SetsulThen how do you think does hardware acceleration on MacOS work? It just runs DirectX directly?

The ability to have hardware acceleration on Mac is absolutely off topic, having your VM provide hardware acceleration to Linux from a OSX host is *also* off topic because the kernel doesn't magically implement the Metal API. From a Linux VM hosted by OSX, you can't run binaries that link to the Metal API.
It's propriatery and nobody going to reverse/re-implement it.

[quote=Setsul]Then how do you think does hardware acceleration on MacOS work? It just runs DirectX directly?[/quote]
The ability to have hardware acceleration on Mac is absolutely off topic, having your VM provide hardware acceleration to Linux from a OSX host is *also* off topic because the kernel doesn't magically implement the Metal API. From a Linux VM hosted by OSX, you can't run binaries that link to the Metal API.
It's propriatery and nobody going to reverse/re-implement it.
20
#20
0 Frags +

im trying to understand what you mean and i THINK you're talking about macos rendering the frames the guest OS gives you using it's desktop renderer

imaging losing an argument to drunk twiikuu LOL

im trying to understand what you mean and i THINK you're talking about macos rendering the frames the guest OS gives you using it's desktop renderer

imaging losing an argument to drunk twiikuu LOL
21
#21
0 Frags +

Did you really think any VM magically changes the API the binary uses?
Did you really think that running TF2 through WINE on Linux in a VM was a serious suggestion to improve performance?

The point was that VMs that do translate to Metal use Metal.

EDIT: Imagine being too drunk to understand a joke.

Did you really think any VM magically changes the API the binary uses?
Did you really think that running TF2 through WINE on Linux in a VM was a serious suggestion to improve performance?

The point was that VMs that do translate to Metal use Metal.

EDIT: Imagine being too drunk to understand a joke.
22
#22
1 Frags +
SetsulEDIT: Imagine being too drunk to understand a joke.

""""german humor""""

[quote=Setsul]EDIT: Imagine being too drunk to understand a joke.[/quote]
""""german humor""""
23
#23
-1 Frags +

Multiple quotation marks don't make you any less of a drunk asshole or any funnier.

Multiple quotation marks don't make you any less of a drunk asshole or any funnier.
24
#24
0 Frags +

wow that escalated quickly

wow that escalated quickly
25
#25
0 Frags +

just get a linux vm with metal support

just get a linux vm with metal support
26
#26
-3 Frags +

I'm sure you would've written
"Step 1: Acquire a Linux guest, MacOS X host VM with OpenGL guest support and Metal host support" and sucked the humour right out of it within the first line like a pro.

I'm sure you would've written
"Step 1: Acquire a Linux guest, MacOS X host VM with OpenGL guest support and Metal host support" and sucked the humour right out of it within the first line like a pro.
27
#27
-1 Frags +

i added aluminum jet wings to my PC case and mouse and the improvements were noticeable however manufacturing the wings cost several thousands of G's so it is probably preferable to just stuff more expensive parts in the thing.

i added aluminum jet wings to my PC case and mouse and the improvements [i]were[/i] noticeable however manufacturing the wings cost several thousands of G's so it is probably preferable to just stuff more expensive parts in the thing.
28
#28
-2 Frags +

yo next time drop a nice phat X D on the end so people can tell it's a joke thanks

yo next time drop a nice phat X D on the end so people can tell it's a joke thanks
Please sign in through STEAM to post a comment.