RageDisplay Vulkan support#1418
RageDisplay Vulkan support#1418convextriangle wants to merge 263 commits intoetternagame:developfrom
Conversation
convextriangle
left a comment
There was a problem hiding this comment.
more notes to myself from debugging and etterna dev group chats
| const std::string& vertexShaderPath, | ||
| const std::string& fragmentShaderPath) | ||
| { | ||
| return m_Renderer->CreateGraphicsPipeline(vertexShaderPath, |
There was a problem hiding this comment.
maybe these paths should be... sanitized/sandboxed? e.g. in other stepman lua, file access is generally constrained to the game root dir (or something)
| function install_linux() { | ||
| test -d $VULKAN_SDK && test -f vulkan_sdk.tar.gz | ||
| echo "extract just the SDK's prebuilt binaries ($VULKAN_SDK_VERSION/x86_64) from vulkan_sdk.tar.gz into $VULKAN_SDK" >&2 | ||
| tar -C "$VULKAN_SDK" --strip-components 2 -xf vulkan_sdk.tar.gz $VULKAN_SDK_VERSION/x86_64 |
There was a problem hiding this comment.
yeah this doesn't work for aarch64 for obvious reasons...
| bufferInfo.commandPool = m_CommandPool; | ||
| bufferInfo.commandBufferCount = 1; | ||
|
|
||
| auto buffers = m_Device.allocateCommandBuffers(bufferInfo); |
There was a problem hiding this comment.
maybe reuse the command buffer instead of allocating for every call...
| copyBufferInfo.level = vk::CommandBufferLevel::ePrimary; | ||
| copyBufferInfo.commandPool = m_CommandPool; | ||
| copyBufferInfo.commandBufferCount = 1; | ||
| vk::raii::CommandBuffer copyBuffer = |
There was a problem hiding this comment.
reuse the command buffer here as well
| m_PendingTextureUpdates[m_CurrentFrame] = false; | ||
|
|
||
| std::vector<vk::DescriptorImageInfo> textureInfo(GetMaxTextureCount()); | ||
| for (int i = 0; i < textureInfo.size(); i++) { |
There was a problem hiding this comment.
check if it's any faster to update descriptors for textures that have actually been added/removed
increasing the texture binding limit would also be a bonus (^^)
also would be nice if we can get away with not removing references to deleted textures
| const DisplayAdapter::CommandBatcher& batcher); | ||
|
|
||
| constexpr static size_t FramesInFlight = 3; | ||
| constexpr static size_t MaxDrawCount = 25'000; |
There was a problem hiding this comment.
this might be too small... bump to sizeof(DisplayAdapter::Vertex)*MaxDrawCount ≈ 4MB?
Adds a Vulkan implementation of RageDisplay (with custom shader support for it).
To test, in Preferences.ini:
Also, Vulkan SDK is necessary for building Vulkan stuffs (some drivers ship with older versions of Vulkan libraries, specify the SDK location in the VULKAN_SDK env var so CMake can pick it up - see here for info)...
Note - macOS support doesn't exist because I don't have a mac to test/code the MoltenVK support / Metal surface...