-
Notifications
You must be signed in to change notification settings - Fork 2k
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 Vulkan support #274
Comments
Hard part done https://github.com/bkaradzic/bgfx/blob/master/src/renderer_vk.cpp, now just Khronos to release specs, headers, docs, etc. and I can start filling up the blanks... :) |
It's finally happening! 👍 https://www.khronos.org/registry/vulkan/specs/1.0/apispec.html |
Whooo, can't wait for this to be completed. |
It won't change bgfx API. It's just another rendering backend. Everything you write with bgfx will just work once it's in. |
Do you have a roadmap for Vulkan support? |
I'm working on it. ETA, when it's done. |
ETA, when it's done is because, if you're using bgfx, you should not care what's behind it, nothing will change in bgfx API specifically for Vulkan, and even if there are changes it will be reflected for all other renderers. Once I release Vulkan backend renderer, your existing code will just work there. If you're just curious to see how Vulkan implementation looks like, just look at D3D12 since it's closest to Vulkan. |
Great thanks! Sent from my iPhone
|
What's the status of the implementation? I see a lot of code is already committed. Is it done? |
@sp82 it's work in progress, not usable yet. But also you should not care about it because from bgfx user point of view there is no difference between underlying APIs used. |
Hi @bkaradzic ! |
Hi @bkaradzic ! |
@kalibannez All platforms have support for at least one renderer. Once Vulkan is in you'll be able to switch, there is no platform that bgfx supports and requires only Vulkan. Also once Vulkan is working I'll close this issue, and you'll get notification about it. |
Looking forward to the vulkan support ! |
Hi, @bkaradzic |
The time will be sometime in the future, and dose will be 1. :) |
Hi, when will Vulkan be added to BGFX? |
As soon as it becomes relevant for any commercially viable platform. ;) |
Is Nintendo Switch a commercially viable platform? :) |
Switch uses native graphics API called NVN:
|
Do Unity and Unreal support NVN or Vulkan? |
What's your point here?! |
I asked about ue4 and unity as i didn't find the answer with a quick search.Not saying you should follow what others do.It was just curiousity.second the existence of nvn doesn't fight the relevancy of Vulkan even not counting Android. |
@Paolo-Oliverio Do you use bgfx? |
I'm making a native backend for my html5 only haxe engine and so I'm evaluating the library stack. for the render I'm planning to use bgfx or sokol's gfx.h. i'll probably go with bgfx as I just used bx and like it and bgfx not being one single file. |
The biggest advantage of Vulkan on platforms that support it is the |
@bkaradzic and some other examples that uses codes in common dir also should include recompiled embedded shader binaries. I will PR for this issue soon, including the metaballs example. |
@rinthel I thought you submitted embedded shaders with your PR. |
@rinthel Updated shaders and updated table... |
@rinthel Are there any special MoltenVK/OSX build instructions for bgfx? |
@bkaradzic Nothing special in build, but some environment variables should be set for running examples. Let me explain what I know about that. Here is the link which I referred during setting in macOS.
Please let me know if you have any other question :) |
@rinthel Thanks for the info. I have tried it but couldn't make it work. After that I have tried using the system path install './install_vulkan.py' . It seems to do the trick but I got validation errors: At the beginning there is 'bgfx platform data like window handle or backbuffer is not set, creating headless device.' Which is suspicious. Any advice, what should I do to make it work? |
@rinthel https://github.com/bkaradzic/bgfx/blob/master/src/renderer_vk.cpp#L1547 I will check other examples, which ones are expected to work? |
@attilaz good! An appropriate depth/stencil format choice step should be added in the initialization step, but I didn't write that yet. |
MacBook Air (13-inch, Early 2014) Intel HD Graphics 5000 Results are similar to what @bkaradzic saw on windows/nvidia: From 00 - 23 everything works except: 15 - incorrect depth sampling |
Updated: #274 (comment) |
Latest PR (2b5246f ) introduced new problems: It fixed 19 with default options for me, but when I change options to 'mrt independent' I get validation error. |
@attilaz OK, I’ll check it on my mac! |
@bkaradzic @attilaz Now I'm trying to support compute shaders on Vulkan. And I have the issue that should be discussed. |
But shouldn't SPIRV-Cross convert this back to something comparable? I didn't use GLSL input because it added even more preprocessor hacks, and HLSL was cleaner path. |
@bkaradzic good point that I missed! I’ll try that. |
@bkaradzic It seems to be solved by modifying preprocessor in #if BGFX_SHADER_LANGUAGE_METAL || BGFX_SHADER_LANGUAGE_SPIRV // add SPIRV case!
#define BUFFER_RO(_name, _struct, _reg) StructuredBuffer<_struct> _name : REGISTER(t, _reg)
#define BUFFER_RW(_name, _struct, _reg) RWStructuredBuffer <_struct> _name : REGISTER(u, _reg)
#define BUFFER_WR(_name, _struct, _reg) BUFFER_RW(_name, _struct, _reg)
#else
#define BUFFER_RO(_name, _struct, _reg) Buffer<_struct> _name : REGISTER(t, _reg)
#define BUFFER_RW(_name, _struct, _reg) RWBuffer<_struct> _name : REGISTER(u, _reg)
#define BUFFER_WR(_name, _struct, _reg) BUFFER_RW(_name, _struct, _reg)
#endif Thanks! |
Linux - Mesa 19.2.0-devel (git-4619535 2019-08-07 bionic-oibaf-ppa)
|
Windows 10 - Radeon Vega 8 Graphics (driver 19.7.1) The depth stencil is failed with VK_FORMAT_D24_UNORM_S8_UINT. In addition, VkAllocationCallbacks is confusing s_renderVK->m_allocatorCb and s_allocationCb. |
Can you grab latest and test it again? cebb749 |
@rinthel I fixed shaderc and now 21-deferred works. It crashes once I select "Show light scissor" and move away camera. |
@bkaradzic Good! I checked it on my iMac and it seems to work but draw buggy scene, and some validation failure case were found. I'll fix it on the next PR. |
Updated #274 (comment) |
The OpenGL successor:
https://www.khronos.org/vulkan
:)
The text was updated successfully, but these errors were encountered: