Skip to content

[Vulkan1.2] (Proof of Concept) Implement Bindless Rendering #422

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

Closed
wants to merge 147 commits into from

Conversation

thr3343
Copy link
Contributor

@thr3343 thr3343 commented May 24, 2024

Not the final PR

  • Contains alot of broken test code + other merged PRs unrelated to Bindless Rendering
  • Will replace with a new PR without the unnecessary commits, once its more complete + finalized

This PR is a proof of concept that implements a special rendering system called Bindless rendering, which gives the following enhancements

Added Enhancements/Features

  • Reduced pipeline complexity + pipeline boilerplate

    • Reduces reliance on shader .jsons
    • Pipeline layout is global and shared between all pipelines
    • DescriptorSetLayout is also global: Allows Descriptor updates and binds to be optimized down to once per frame
  • Bindless Textures

    • Textures are stored in a Descriptor Array
    • Improves speed + CPU overhead of texture switching
    • Entity + Text rendering performance is enhanced when handling complex environments
      • e.g. Texture heavy scenes like Entities, Text, Nametags and Player rendering
    • Image transitions greatly reduced
    • Supports Max limit of 65536 textures for Modpacks
  • Bindless Uniforms

    • UBO usage reduced to 1KB to fit in GPU L1 cache
    • Uploads greatly reduced
  • Shader optimizations

    • Some Uniforms optimized to Push Constants
    • Inline Uniform Blocks used to allow Uniforms to be inlined as Constants
  • Provides a Platform for additional features

    • Anisotropic Filtering + MSAA
      • Will require Unstitching for Atlases > maxImageArrayLayers in size
      • Atlases < maxImageArrayLayers can be optimized into onion textures
    • Allow AMD/Intel GPUs to use > 512x Resource Packs
      • Will likely use the same features as above to unstitch atlases
      • if implemented, The new max resource pack limit for AMD/Intel would likely become 2048x

issues:

  • Doesn't work on Mac/MoltenVK due to Texture Slot limits (Fixable: Needs a Bindfull fallback)
  • Postprocess renderpasses are not functional yet (Fixable w/ Pushing new Descriptor allocations)
  • Broken MVP rotations when entering the End
  • Player hand lighting glitches
  • Teleporting in some instances causes outdated MVP rotations
  • Has not been tested fully on AMD/Intel Devices

Required Vulkan 1.2 and 1.3 features

  • inlineUniformBlock
  • runtimeDescriptorArray:
  • descriptorBindingPartiallyBound:
  • descriptorBindingVariableDescriptorCount:

thr3343 added 16 commits May 12, 2024 18:28
# Conflicts:
#	src/main/java/net/vulkanmod/vulkan/Drawer.java
#	src/main/java/net/vulkanmod/vulkan/memory/AutoIndexBuffer.java
# Conflicts:
#	src/main/java/net/vulkanmod/mixin/render/BufferUploaderM.java
#	src/main/java/net/vulkanmod/render/VBO.java
#	src/main/java/net/vulkanmod/render/chunk/WorldRenderer.java
#	src/main/java/net/vulkanmod/vulkan/Drawer.java
#	src/main/java/net/vulkanmod/vulkan/VRenderSystem.java
#	src/main/java/net/vulkanmod/vulkan/device/DeviceManager.java
#	src/main/java/net/vulkanmod/vulkan/shader/GraphicsPipeline.java
#	src/main/java/net/vulkanmod/vulkan/shader/PipelineState.java
 Possible RADV bug (unconfirmed)
@thr3343 thr3343 marked this pull request as draft May 24, 2024 16:28
@thr3343
Copy link
Contributor Author

thr3343 commented Jun 5, 2024

Going to replace this with a cleaned up PR in a few days, without all the N/A commits/optimizations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant