Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
5.15, 6.x
-
None
-
7ccd2d02463f8076631bc45e5bf1386c61037dc7 (qt/qtbase/dev)
Description
Hello,
All graphics API allow to set the stride of uploaded textures.
For instance:
- GL: glPixelStorei(GL_UNPACK_ROW_LENGTH,stride);
- Vulkan: I assume it's rowPitch in VkSubresourceLayout
- Metal: newTextureWithDescriptor takes a bytesPerRow parameter
- D3D11: looks like it's somewhere in there: https://docs.microsoft.com/en-us/windows/win32/api/d3d11/ns-d3d11-d3d11_subresource_data
This is useful for instance for GPU video playback: some videos are decoded into slightly wider buffers for decoder efficiency reasons; e.g. a 720 * 576 video may be decoded in a 768 * 576 texture with the 48 rightmost pixels of each line to be ignored.
could this feature be added to the QRhiTextureSubresourceUploadDescription API in some way ? Even at texture construction time would already be very useful