-
Notifications
You must be signed in to change notification settings - Fork 308
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
Vulkan #148
Comments
Hello. Adding vulkan to horde is great, but I think that several things should be noted:
As for your proposes, there are several things that I don't fully understand:
|
It doesn't, I missed that I had left that there - the shader contexts knowing about render-target state is not necessary, just other state (blend/stencil/etc).
I don't believe so, even push constants have to be specified as a UBO with the binding locatoin as push_constant, I'm pretty sure the glsl compiler isn't even supposed to allow non UBOs on targets greater than 4.0 core, the reference glslValidator compiler certainly doesn't (unless I failed to find a hidden switch) compile anything attempting to use loose uniforms. It was a lot of pain when I first started using Vulkan.
Possibly not, it might be viable to identify where sub-passes logically are just based on the sequence of commands. Substages would just make it explicit. Definitely worth it to go for no substages if possible.
Thinking about it, it seems completely reasonable to allow the SPIR-V inside the shaders as base64 in a block like all of the other shaders. That's also not completely atrocious even without tooling, most text-editors can paste a file as base64.
I was just listing off a random very complicated lighting situation as a things are nowhere near crazy in Horde, you already have to change code to do anything significantly different (such as subtractive lights). |
Most everything so far has been much less problematic than I had expected. Once descriptor-sets and UBOs are dealt with I should be up and rendering fairly quickly. The odder problem has been getting all of the initialization for vulkan without forcing a dependency on another library into the core Horde3D library (VkInstance, VkSurfaceKHR, etc). For that I had to add an additional So the instance, device, surface, graphics/present queues, and physical device are the user's responsibility to provide. Otherwise there's no dodging tying into some specific library like glfw or sdl. I'm not making any attempts to support headless Vulkan usage. Only 3rd party dependencies are VMA and SPRIV-Reflect Texture and pipeline handling will take some iterations, but something that can be fiddled with shouldn't be more than a few days out. Edit: I made the distinction between buffers being host_visible or GPU-only (staging required to update) based on whether data was given to |
Do you really need h3dSetExternalInterface function? As far as I know, you can just work with the correctly initialized vulkan device (through glfw or other means). Can't you just pass it to init function? I thought of extending H3DRenderDevice to a more useful structure that could pass a device pointer to horde. |
At the minimum I require VkInstance, VkPhysicalDevice, VkSurfaceKHR, and VkDevice to all be fed because they're products of the windowing system (ie. querying platform functions) - without committing to a this is the windowing library all shall use I have to either get the constructed objects from outside or take some function pointers to get them. Sure a That's a fairly minor thing though. The final bits of shader handling are my main issue. The shader loading in H3D is objectively academic spaghetti so tying precompiled bytecode into that has turned out to be non-trivial. The main issue there is that shader construction has thus far been about constructing the appropriate shader (prefixes, flags) whereas SPIR-V needs the permutations precompiled, although If I don't get anywhere in a few more days I'll toss everything into git, maybe other eyes will spot something I don't. Realistically it looks like I'll have to make |
What, GL2 is going to be deprecated? Oh hell naw, that's the whole reason I'm using Horde. |
Version 2 and several versions till version 3 of horde3d will still have gl2 backend (so, you are safe for several years :) ). Also, gl4 backend can work with 3.3 opengl version, that works on video cards from 2007. So it should not be a very large problem if gl2 backend is removed in the following years. |
Preparing to tackle Vulkan, these are my notes. This issue is an RFC for things I might be missing before I dive in.
Occlusion Query
disabled for first version
Vertex/Index Buffer changes
addition of a dynamic/static specification
changes expectations on data update, in Vulkan dynamic will be host-visible and not use the buffer copy operations
all setXXXX functions pertaining to GL-state go away (blend / etc)
Presumably these move into shader contexts
Use possibility space for configurations
blend = ADD|SUBTRACT|MULTIPLY
to enumerate the permutations that need to be determined using derivative pipelines
Contexts also specify targets
setShaderConst has to evolve for uniform-buffers
not terribly difficult to leave the same API and also support blob transfer, provided UBO members are uniquely named
adjustments portable to GL4 and GLES3 backends
Pipeline
introduce substage
stage is now just a container, Vulkan-wise the targets used by substages in stage are aggregated to the renderpass
If no substages are contained in a stage element then a root substage will be inferred
Targets can only be changed ONCE during a substage
Targets can only be bound ONCE during a substage
SPIR-V
SPIR-V is offline compiled, though the compiler could be bundled that's an unecessary dependency
Add RIFF support to shaders because RIFF is trivial enough that tooling should never be a problem.
Include reference "compiler" that delegates to glslValidator and SPIR-V_Cross binaries to generate this format
The text was updated successfully, but these errors were encountered: