Vulkan Rendering Output skewed on MTK8167 / PowerVR GE8300, wrong pixel pitch?

Hi,
When I test PowerVR samples (01_HelloAPI, 02_IntroducingPVRShell, or any others) on an Acer Iconia One 7 tablet that has MTK8167 processor with PowerVR GE8300 GPU, I found that the rendering output is “skewed” under Landscape mode but perfect under portrait mode, see this linked screen shot.

When I debug into the code where we create Vulkan swapchain,

_vulkan.swapchainExtent = surfaceCapabilities.currentExtent;

I found the size is: 600x976 for portrait mode and 976x600 mode for landscape. I started doubting the skewed output is caused by the non-16-pixel-aligned framebuffer width / pitch, then I tried to make it aligned to 16-pixel when creating the frame buffer, like _vulkan.swapchainExtent.width>>4<<4 but did not succeed.

I also tested PVR samples on Windows (nVidia, AMD, Intel), Android (Adreno, Mali) they all do not have this problem. Anyone can give some suggestions?

UPDATED:
I added the following patch to make the rendering correct:

    	// Get the current surface capabilities
    	VK_ASSERT(vkGetPhysicalDeviceSurfaceCapabilitiesKHR(_vulkan->device->vkPhyDevice, vkSurface, &vkSurfaceCaps));

    	/*
    	 * Patch: this patch is only needed for certain PowerVR GPU: the width must be manually aligned to 16-pixel by adding padding.
    	 * Testing device: Acer Iconia One 7 tablet, Android 7 OS, MTK8167 processor with PowerVR GE8300 GPU
    	 */
    	const int PIXEL_ALIGNMENT = 4;	//16-pixel alignment
    	vkSurfaceCaps.currentExtent.width = (vkSurfaceCaps.currentExtent.width + (1<<PIXEL_ALIGNMENT) - 1) >> PIXEL_ALIGNMENT << PIXEL_ALIGNMENT;

My patch is simply adding a padding to make the swapchain’s width aligned to 16-pixel if it is not. Should we consider this should have been done by PowerVR Vulkan driver? Or did I use Vulkan in a wrong way?

Hi,

This is a known issue on older drivers such as the one you have. The proper fix is 32 pixels :slight_smile:
The issue is fixed on newer (1.10) drivers.

thanks,
Marton

Hi Marton,
Thanks for your info, I’ll change the width padding to make the width aligned to 32-pixel.
If I leave this patch in my code, will it disturb the newer devices with (1.10) driver? Otherwise, I need to detect PVR Vulkan driver version and make this patch only applied for pre-1.10 device.

Hi,

I don’t think it’ll disturb the driver. But you definitely won’t need it for 1.10, so I’d detect the driver version.

bests,
Marton

Thanks, I will detect the driver version.