Mobile devices can be rotated and mobile applications need to render properly when a device is held in a landscape or portrait orientation. When the current orientation differs from the device’s native orientation, a rotation is required so that the “up” direction of the rendered scene matches the current orientation.
If the Display Processing Unit (DPU) does not natively support rotation, the Vulkan presentation engine can handle this rotation in a separate composition pass. Alternatively, the application can render frames “pre-rotated” to avoid this extra pass. The latter is preferred to reduce power consumption and achieve the best performance because it avoids tasking the GPU with extra work to perform the copy/rotate operation.
Unlike OpenGL ES, the burden of pre-rotation in Vulkan falls on the application. To implement pre-rotation, applications render into swapchain images matching the device native aspect ratio of the display and “pre-rotate” the rendering content to match the device’s current orientation. The burden is more than adjusting the Model View Projection (MVP) matrix in the vertex shader to account for rotation and aspect ratio. The coordinate systems of scissors, viewports, derivatives and several shader built-ins may need to be adapted to produce the correct result.
It is difficult for some game engines to manage this burden; many chose to simply accept the performance/power overhead of performing rotation in the presentation engine.
This extension allows applications to achieve the performance benefits of pre-rotated rendering by moving much of the above-mentioned burden to the graphics driver. The following is unchanged with this extension:
VkSwapchainCreateInfoKHR::preTransform equal to the currentTransform as returned by GetPhysicalDeviceSurfaceCapabilitiesKHR.The following is changed with this extension:
CmdBeginRenderPass, the application provides extension struct VkRenderPassTransformBeginInfoQCOM specifying the render pass transform parameters.BeginCommandBuffer for secondary command buffers, the application provides extension struct VkCommandBufferInheritanceRenderPassTransformInfoQCOM specifying the render pass transform parameters.renderArea, viewports, scissors, and fragmentSize are all provided in the current (non-rotated) coordinate system. The implementation will transform those into the native (rotated) coordinate system.FragCoord, PointCoord, SamplePosition, PrimitiveShadingRateKHR, interpolateAt(), dFdx, dFdy, fWidth) into the rotated coordinate system.position to the rotated coordinate system.VK_QCOM_tile_properties, then GetFramebufferTilePropertiesQCOM and GetDynamicRenderingTilePropertiesQCOM return tile properties in the rotated coordinate space.VK_QCOM_render_pass_transformVK_KHR_swapchain and VK_KHR_surfaceVK_KHR_swapchainVK_EXT_fragment_density_mapVK_KHR_fragment_shading_rateVK_QCOM_tile_properties| Modifier and Type | Field and Description |
|---|---|
| public static final String | VK_QCOM_RENDER_PASS_TRANSFORM_EXTENSION_NAME
The extension name. |
| public static final int | VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION
The extension specification version. |
| public static final int | VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM
Extends |
| public static final int | VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM
Extends |
| public static final int | VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM
Extends |
| Access | Constructor and Description |
|---|---|
| private |
| VK_QCOM_RENDER_PASS_TRANSFORM_EXTENSION_NAME | back to summary |
|---|---|
| public static final String VK_QCOM_RENDER_PASS_TRANSFORM_EXTENSION_NAME The extension name. | |
| VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION | back to summary |
|---|---|
| public static final int VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION The extension specification version. | |
| VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM | back to summary |
|---|---|
| public static final int VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM Extends | |
| VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM Extends Enum values: | |
| VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM Extends Enum values: | |
| QCOMRenderPassTransform | back to summary |
|---|---|
| private QCOMRenderPassTransform() | |