vulkan-pre-rotation-demo
vulkan-pre-rotation-demo copied to clipboard
Handle Vulkan pre-rotation properly on Android
Vulkan Pre-rotation Demo
After git clone
- git submodule init
- git submodule update
What's covered?
- Detect all surface rotations in Android 10+(easier if landscape only without resizing).
- Handle swapchain recreation.
- Fix the shaders in clipping space with a simple 2x2 matrix.
- NativityActivity, AChoreographer, etc.
What's not covered?
- Detect surface rotation in Android Pie and below, which can be fixed by either calling vkGetPhysicalDeviceSurfaceCapabilitiesKHR or the jni Display.getRotation() once a while.
- Fix advanced shader features like dfdx and dfdy, which can be fixed by mapping the intended derivative to +-dfdx or +-dfdy according to preTransform pushed to the shader.
- Other miscellaneous.