-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for geometry shaders #1524
Comments
Thanks for submitting the request and recommendation. Interesting idea. |
#1657 (comment) |
Metal 3 has new features which help support Geometry Shaders. #1616 (comment) |
I Agree but metal 3 is not there yet, also you want to support users that for some reason want to use older OSs for some time? |
more suggestions discussed here: http://hacksoflife.blogspot.com/2015/06/os-x-metal-raw-notes.html |
If it's still important providing support for the current os without waiting the future release of metal3 with the next OS:
Also: one of the contributors also pointed that another source of inspiration is looking into zink and how it emulates geometry shaders. |
Doing it on the CPU is a waste of time. That would be too slow to be usable anyway. |
Agree, but there are many other ways of solving this problem anyway. It's worth trying tho, everything is better than nothing at all. |
Again from that project. |
Related issue #1741 outlines real-world needs for geometry shaders. |
There’s really many games that require geometry shaders but it’s not always so in your face. One reason it’s not so obvious is DXVK-CX and some third-party builds aimed at macOS have a hard requirement on faking extensions on the MoltenVK side. Instead doing the following Gcenx/DXVK-macOS@9340068 makes sure that anything the feature is requested the message will show up in the log. |
Can you elaborate on what you mean by that? Specifically, what "hard requirement on faking extensions" means? Are you saying frameworks like DXVK-CX have two code paths, one when geometry shaders are available in the driver, and one when they are not, and both work (maybe not equally well)? And in the second case, how do these frameworks "fake" geometry shaders? Or are you saying DXVK-CX will not run when geometry shaders are not available because they have a hard requirement to not fake extensions? |
Sorry to interrupt the conversation... |
DXVK-CX and some other third-party packages won’t run unless MoltenVK fakes support for geometry shaders (and some other extensions) The DXVK-macOS packages I advertise are used in XIV on Mac|Wineskin|PortingKit will use geometry shaders and other extensions if available, if these are missing it will continue to run just give a message (for geometry shaders) Here’s the current version of DXVK-CX shipped with recent versions of crossover https://media.codeweavers.com/pub/crossover/dxvk/dxvk-v1.7-14-gef993b2f_x86_64.tar.bz2 this won’t run on stock MoltenVK Here’s my own build of the same version but does function on stock MoltenVK https://github.com/Gcenx/DXVK-macOS/releases/download/v1.7/dxvk-macOS-1.7.tar.gz Or the very latest version https://github.com/Gcenx/DXVK-macOS/releases/download/v1.10.3/dxvk-macOS-async-1.10.3.tar.gz (async is enabled by default on select titles) There’s no fallback for these missing Vulkan extensions with my packages I simply allow the games to still function (that’s fine until more recent DXVK-git), prior DXVK releases allowed this I’d simply reverted some changes to still allow it. |
In older Unity games (at least 2018), geometry shaders are used for gpu skinning. That causes models to not render at all in Crossover. |
Now that Ventura has released today, with Metal 3 support, hopefully this will become a reality. Can't wait to be able to use CrossOver to play my UE4 based games rather than having to rely on a virtual machine! +1 for this and the team working on it! :) |
Let me just say that I know almost nothing about any of these. But I was reading the Ryujinx blog update and they mentioned this about geometry shaders: "Geometry Shaders: Geometry shaders do not exist in Metal or MoltenVK. Used for writing 3D textures in UE4 games, and a number of complex graphical effects in others, missing this would definitely hurt compatibility. However, gdkchan has come up with a clever method to emulate these stages using additional draws to vertex shader only. The result is incredibly impressive - hardware-accelerated geometry shaders on a GPU that doesn't support them. Coup de grâce!" Since Ryujinx is open source, is this a possible solution to this issue? |
The compute shader or mesh shader solution would be much more efficient than the Vertex shader solution, but if the Vertex one is easier to accomplish, always better than nothing at all. |
There is some PoC effort currently underway using Mesh shaders to provide Geometry shaders. We're expecting initial availability to be sometime in Q1/23. |
That's really good news! I was somewhat worried that Metal 3's features are not enough to provide a solution for geometry shaders. Also, with regards to other problems that I've read about, Ryujinx also made workarounds for 4-byte Vertex Buffer Alignment Requirement & Transform Feedback. |
Mesh shaders alone may not be enough to handle the case where geometry shaders interacts with transform feedback ... It's a possibility that either tessellation or geometry shaders implementation over mesh shaders on MoltenVK/Metal may never reach parity in functionality with other graphics APIs out there ... |
True TF should be implemented first. |
Further development on Geometry shader substitutes from Ryujinx... |
Any new updates? I'd also be willing to contribute to any available bounties or donate to anybody working on this issue. |
@billhollings your probably aware of this but could this somehow be usable as a pollyfill for older version of macOS https://developer.apple.com/documentation/metal/metal_sample_code_library/mixing_metal_and_opengl_rendering_in_a_view |
Can you elaborate? How are you thinking we could use OpenGL to provide Geometry Shaders? |
That’s indeed what I was thinking. |
Yes. But how do you envision it hanging together in a pipeline that is otherwise Vulkan/SPIR-V? |
It’s probably better someone more knowledgeable with Metal/Vulkan look into how/if this could be made viable, it seems technically possible but not sure how viable. |
It's not viable. You'd have to write a Vulkan to OpenGL translation layer, which is impossible, especially with Apples ancient OpenGL 4.1 and then somehow dynamically switch to that based on the rendering pipeline while remembering to sync all previously set state over. |
How is the Game Porting Toolkit addressed? |
Apple directly maps to Metal when possible and emulate what Metal 3.1 doesn’t support. |
does apple use mesh shaders in place of geometry shaders for their dx to metal in gptk? 🤔 |
Yes. GPTK and Apple's Shader Converter convert HLSL Tessellation and Geometry shaders to MSL Mesh shaders. Plus, it's done at a binary level, without source code involved. I'm starting to look into whether we can leverage this in MoltenVK. |
HLSL Tessellation and Geometry shaders to MSL Mesh shaders. This is the best solution, because Apple is doing this |
i agree the performance of doing it this way was really good when i tested unreal engine games on gptk |
Needed to get Stray working (currently black screen) |
Do you think moltenvk can leverage this? I'm sure there is other projects that would use moltenvk on macOS and iOS to do their own ports that also utilize transform feedback. |
Unfortunately, I haven't had time yet to delve into this in depth. It's on the to-do list. |
If you use this approach, what's the plan for transform feedback? #1943 |
I read some works have been done in WIP Geometry shaders #1815 Also this is present from crossover 23 beta1 release which says: |
Since MSL3 still doesn't support geometry shaders, and it seems a requirement (along with tessellation) for modern 3D applications, would it be possible to add this in MoltenVK as a polyfill? I saw this repo that gives an example of geometry shader for MSL https://github.com/Kosalos/GeometryShader
The text was updated successfully, but these errors were encountered: