1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2024-11-29 11:24:14 +01:00
VK driver for the Raspberry Pi (Broadcom Videocore IV)
Go to file
2020-02-01 09:29:57 +00:00
.github/ISSUE_TEMPLATE Update bug_report.md 2019-12-15 10:30:31 +00:00
brcm loader work pt2 2019-09-30 01:13:55 +01:00
driver depth texture reading and buffer copying works now 2020-01-31 18:42:37 +00:00
external trying to make the loader stuff work 2019-09-29 23:52:21 +01:00
QPUassembler added vertex attrib encoding, removed shader patching 2019-12-08 15:31:42 +00:00
test depth tex is now working 2020-01-31 20:42:51 +00:00
.gitignore added qpu assembler/disassembler 2019-04-14 14:43:27 +01:00
BUILD.md Update BUILD.md 2019-12-14 20:43:49 +00:00
CMakeLists.txt now assembly can be loaded in text form 2019-05-06 16:58:34 +01:00
install.sh loader work pt2 2019-09-30 01:13:55 +01:00
LICENSE Create LICENSE 2018-11-17 16:31:44 +00:00
README.md Update README.md 2020-02-01 09:29:57 +00:00
rpi-vk-driver.json trying to make the loader stuff work 2019-09-29 23:52:21 +01:00
toolchain.cmake sdf 2019-12-07 17:31:34 +00:00

rpi-vk-driver

(not conformant yet, can't use official name or logo)

Milestones

  • clear screen example working
  • triangle example working
    • shader from assembly, vertices from vertex buffer object, no uniforms, color hardcoded
    • uniforms for matrix multiplication and animation
    • texture coordinates and texture sampling
    • varyings
    • Multiple vertex attributes
    • Depth buffers
    • Stencil buffers
    • Indexed draw calls
    • blending
    • mipmapping
    • cube mapping
    • shadow mapping / depth texture sampling
    • HDR rendering
    • Multi threaded cmdbuf generation test
  • Shader compiler chain
    • QPU assembler / disassembler
  • Resources
    • Descriptor support
    • VkSampler support
    • Push constant support
  • Platform features
    • Layer support
  • Emulated features
    • Clear command support
    • Copy command support
  • Render to texture features
    • VkRenderPass support
    • Subpass support
    • MSAA support
  • Synchronization
    • vkCmdPipelineBarrier support
  • Performance
    • Performance counters
    • Queries
    • Shader performance info
  • WSI
    • Direct to display support
  • Secondary command buffers
  • Fixes
    • Hardware bug workarounds
    • Handle offsets wherever required
    • Handle subresource ranges properly
    • Handle allocation scopes properly
    • Shader module creation might not be thread safe
  • Try to pass as much of the VK CTS as possible with existing feature set
  • Github pages
  • Wiki
    • Performance recommendations
    • How to do blending, depth/stencil testing, attributes

VK CTS progress

  • Passed: 7894/67979 (11.6%)
  • Failed: 878/67979 (1.3%)
  • Not supported: 59206/67979 (87.1%)
  • Warnings: 1/67979 (0.0%)

Conformance run is considered passing if all tests finish with allowed result codes. Following status codes are allowed:

  • Pass
  • NotSupported
  • QualityWarning
  • CompatibilityWarning

There are about 470.000 conformance tests.

FAQ

Will this ever be a fully functional VK driver?

As far as I know the PI is NOT fully VK capable on the hardware level. I can already see that some things will need to be emulated and others won't ever be emulated.

What performance should you expect?

Performance wise, the Pi is quite capable. The specs and architecture is close to the GPU in the iPhone 4s. The only problem I see is bandwidth as you only have about 7GB/s compared to 12-25GB/s on typical mobile phones. So post processing is a huge no and you'd need to be very careful about the techniques that you use. Eg. you'd need to stay on chip at all times. CPU performance (eg. number of draw calls) should be enough on the quad-core PIs as you can easily utilise all cores using VK.

What features will not be supported?

  • 3D textures
  • sparse textures
  • compute shaders (though could be supported to some extent if the kernel side would support it)
  • some texture formats
  • some render target texture formats
  • occlusion queries (https://github.com/anholt/mesa/wiki/VC4-OpenGL-support)
  • indirect draws
  • spirv shaders
  • events
  • proper semaphore support
  • tessellation shaders
  • geometry shaders
  • 32 bit indices
  • instancing
  • some vertex buffer formats
  • pipeline caches (doesn't make sense with assembly shaders)

What additional features will this driver support?

  • I already added support (to be polished) to load shader assembly. This will enable devs to optimise shaders to the last cycle.
  • I'll probably add something to indicate towards the developer that things are emulated or not supported at all.
  • Videocore IV provides some performance counters these will be exposed
  • Videocore IV supports some texture formats that are not present in the spec
    • bw1: 1 bit black and white
    • a4: 4 bit alpha
    • a1: 1 bit alpha
  • vector graphics support?

Shader patching

The Broadcom Videocore IV needs a couple of operations to happen in shader code that might have fixed function hardware on other platforms.
These are:

  • writing stencil state setup register
  • writing depth value to depth buffer
  • performing blending in software
  • writing vertex parameter memory read and write setup registers

Since the project will not include a compiler, but rather works with an assembly based shader setup, I decided not to patch shaders based on the state provided to the driver, but rather let the developer have full control. This means that regardless of what

  • depth write state
  • blending state
  • stencil state
  • vertex attribute state

is passed to the driver, this will not be reflected in the final behaviour unless the developer adds it to the assembly shaders. Helper functionality will be provided to aid with encoding register values. Additionally, general documentation will be provided on how to perform these operations.

This will enable developers to take full control and optimise shaders to the last cycle.